'Handles the functioning of the command.'

def func(self):

    if (not self.args):
        self.msg(_list_bots())
        return
    args = self.args.split()
    if (len(args) != 2):
        self.msg('Usage:    @ircstatus    [#dbref    ping||nicklist||reconnect]')
        return
    (botname, option) = args
    if (option not in ('ping', 'users', 'reconnect', 'nicklist', 'who')):
        self.msg('Not    a    valid    option.')
        return
    matches = None
    if utils.dbref(botname):
        matches = PlayerDB.objects.filter(db_is_bot=True, id=utils.dbref(botname))
    if (not matches):
        self.msg('No    matching    IRC-bot    found.    Use    @ircstatus    without    arguments    to    list    active    bots.')
        return
    ircbot = matches[0]
    channel = ircbot.db.irc_channel
    network = ircbot.db.irc_network
    port = ircbot.db.irc_port
    chtext = ("IRC    bot    '%s'    on    channel    %s    (%s:%s)" % (ircbot.db.irc_botname, channel, network, port))
    if (option == 'ping'):
        self.caller.msg(('Pinging    through    %s.' % chtext))
        ircbot.ping(self.caller)
    elif (option in ('users', 'nicklist', 'who')):
        self.caller.msg(('Requesting    nicklist    from    %s    (%s:%s).' % (channel, network, port)))
        ircbot.get_nicklist(self.caller)
    elif self.caller.locks.check_lockstring(self.caller, 'dummy:perm(ircstatus)    or    perm(Immortals)'):
        self.caller.msg(('Forcing    a    disconnect    +    reconnect    of    %s.' % chtext))
        ircbot.reconnect()
    else:
        self.caller.msg("You    don't    have    permission    to    force-reload    the    IRC    bot.")
