'Runs the function'

def func(self):

    caller = self.caller
    args = self.args
    if (not args):
        self.execute_cmd('@channels')
        self.msg('(Usage:    allcom    on    |    off    |    who    |    destroy)')
        return
    if (args == 'on'):
        channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'listen')]
        for channel in channels:
            self.execute_cmd(('addcom    %s' % channel.key))
    elif (args == 'off'):
        channels = ChannelDB.objects.get_subscriptions(caller)
        for channel in channels:
            self.execute_cmd(('delcom    %s' % channel.key))
    elif (args == 'destroy'):
        channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'control')]
        for channel in channels:
            self.execute_cmd(('@cdestroy    %s' % channel.key))
    elif (args == 'who'):
        string = '\n|CChannel    subscriptions|n'
        channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'listen')]
        if (not channels):
            string += 'No    channels.'
        for channel in channels:
            string += ('\n|w%s:|n\n    %s' % (channel.key, channel.wholist))
        self.msg(string.strip())
    else:
        self.msg('Usage:    allcom    on    |    off    |    who    |    clear')
