'Setup the irc-channel mapping'

def func(self):

    if (not settings.IRC_ENABLED):
        string = 'IRC    is    not    enabled.    You    need    to    activate    it    in    game/settings.py.'
        self.msg(string)
        return
    if ('list' in self.switches):
        self.msg(_list_bots())
        return
    if (('disconnect' in self.switches) or ('remove' in self.switches) or ('delete' in self.switches)):
        botname = ('ircbot-%s' % self.lhs)
        matches = PlayerDB.objects.filter(db_is_bot=True, username=botname)
        dbref = utils.dbref(self.lhs)
        if ((not matches) and dbref):
            matches = PlayerDB.objects.filter(db_is_bot=True, id=dbref)
        if matches:
            matches[0].delete()
            self.msg('IRC    connection    destroyed.')
        else:
            self.msg('IRC    connection/bot    could    not    be    removed,    does    it    exist?')
        return
    if ((not self.args) or (not self.rhs)):
        string = 'Usage:    @irc2chan[/switches]    <evennia_channel>    =    <ircnetwork>    <port>    <#irchannel>    <botname>[:typeclass]'
        self.msg(string)
        return
    channel = self.lhs
    self.rhs = self.rhs.replace('#', '    ')
    try:
        (irc_network, irc_port, irc_channel, irc_botname) = [part.strip() for part in self.rhs.split(None, 4)]
        irc_channel = ('#%s' % irc_channel)
    except Exception:
        string = ("IRC    bot    definition    '%s'    is    not    valid." % self.rhs)
        self.msg(string)
        return
    botclass = None
    if (':' in irc_botname):
        (irc_botname, botclass) = [part.strip() for part in irc_botname.split(':', 2)]
    botname = ('ircbot-%s' % irc_botname)
    botclass = (botclass if botclass else bots.IRCBot)
    irc_ssl = ('ssl' in self.switches)
    bot = PlayerDB.objects.filter(username__iexact=botname)
    if bot:
        bot = bot[0]
        if (not bot.is_bot):
            self.msg(("Player    '%s'    already    exists    and    is    not    a    bot." % botname))
            return
    else:
        try:
            bot = create.create_player(botname, None, None, typeclass=botclass)
        except Exception as err:
            self.msg(("|rError,    could    not    create    the    bot:|n    '%s'." % err))
            return
    bot.start(ev_channel=channel, irc_botname=irc_botname, irc_channel=irc_channel, irc_network=irc_network, irc_port=irc_port, irc_ssl=irc_ssl)
    self.msg('Connection    created.    Starting    IRC    bot.')
