IRC Bot for interacting with salt.

    nick
        Nickname of the connected Bot.

    host
        irc server (example - chat.freenode.net).

    port
        irc port.  Default: 6667

    password
        password for authenticating.  If not provided, user will not authenticate on the irc server.

    channels
        channels to join.

    use_ssl
        connect to server using ssl. Default: False

    use_sasl
        authenticate using sasl, instead of messaging NickServ. Default: False

        .. note:: This will allow the bot user to be fully authenticated before joining any channels

    char
        command character to look for. Default: !

    allow_hosts
        hostmasks allowed to use commands on the bot.  Default: False
        True to allow all
        False to allow none
        List of regexes to allow matching

    allow_nicks
        Nicks that are allowed to use commands on the bot.  Default: False
        True to allow all
        False to allow none
        List of regexes to allow matching

    disable_query
        Disable commands from being sent through private queries.  Require they be sent to a channel, so that all
        communication can be controlled by access to the channel. Default: True

    .. warning:: Unauthenticated Access to event stream

        This engine sends events calls to the event stream without authenticating them in salt.  Authentication will
        need to be configured and enforced on the irc server or enforced in the irc channel.  The engine only accepts
        commands from channels, so non authenticated users could be banned or quieted in the channel.

        /mode +q $~a  # quiet all users who are not authenticated
        /mode +r      # do not allow unauthenticated users into the channel

        It would also be possible to add a password to the irc channel, or only allow invited users to join.

def start(nick, host, port=6667, username=None, password=None, channels=None, use_ssl=False, use_sasl=False,
          char='!', allow_hosts=False, allow_nicks=False, disable_query=True):
    '''
    IRC Bot for interacting with salt.

    nick
        Nickname of the connected Bot.

    host
        irc server (example - chat.freenode.net).

    port
        irc port.  Default: 6667

    password
        password for authenticating.  If not provided, user will not authenticate on the irc server.

    channels
        channels to join.

    use_ssl
        connect to server using ssl. Default: False

    use_sasl
        authenticate using sasl, instead of messaging NickServ. Default: False

        .. note:: This will allow the bot user to be fully authenticated before joining any channels

    char
        command character to look for. Default: !

    allow_hosts
        hostmasks allowed to use commands on the bot.  Default: False
        True to allow all
        False to allow none
        List of regexes to allow matching

    allow_nicks
        Nicks that are allowed to use commands on the bot.  Default: False
        True to allow all
        False to allow none
        List of regexes to allow matching

    disable_query
        Disable commands from being sent through private queries.  Require they be sent to a channel, so that all
        communication can be controlled by access to the channel. Default: True

    .. warning:: Unauthenticated Access to event stream

        This engine sends events calls to the event stream without authenticating them in salt.  Authentication will
        need to be configured and enforced on the irc server or enforced in the irc channel.  The engine only accepts
        commands from channels, so non authenticated users could be banned or quieted in the channel.

        /mode +q $~a  # quiet all users who are not authenticated
        /mode +r      # do not allow unauthenticated users into the channel

        It would also be possible to add a password to the irc channel, or only allow invited users to join.
    '''
    client = IRCClient(nick, host, port, username, password, channels or [], use_ssl, use_sasl, char,
                       allow_hosts, allow_nicks, disable_query)
    client.io_loop.start()