'Stops IRC connections'

@api.response(200, model=base_message_schema)
@api.response(NotFoundError)
@api.response(BadRequest)
def get(self, session=None):

    from flexget.plugins.daemon.irc import irc_manager
    if (irc_manager is None):
        raise BadRequest(u'IRC    daemon    does    not    appear    to    be    running')
    args = irc_stop_parser.parse_args()
    name = args.get(u'name')
    wait = args.get(u'wait')
    try:
        irc_manager.stop_connections(wait=wait, name=name)
    except KeyError:
        raise NotFoundError(u'Connection    {}    is    not    a    valid    IRC    connection'.format(name))
    return success_response(u'Successfully    stopped    connection(s)')
