'Implementing the command.'

def func(self):

    caller = self.caller
    player = caller
    if (not self.args):
        self.msg('Usage:    delcom    <alias    or    channel>')
        return
    ostring = self.args.lower()
    channel = find_channel(caller, ostring, silent=True, noaliases=True)
    if channel:
        if (not channel.has_connection(player)):
            self.msg('You    are    not    listening    to    that    channel.')
            return
        chkey = channel.key.lower()
        delnicks = ('all' in self.switches)
        if delnicks:
            for nick in [nick for nick in make_iter(caller.nicks.get(category='channel', return_obj=True)) if (nick and nick.pk and (nick.value[3].lower() == chkey))]:
                nick.delete()
        disconnect = channel.disconnect(player)
        if disconnect:
            wipednicks = ('    Eventual    aliases    were    removed.' if delnicks else '')
            self.msg(("You    stop    listening    to    channel    '%s'.%s" % (channel.key, wipednicks)))
        return
    else:
        channame = caller.nicks.get(key=ostring, category='channel')
        channel = find_channel(caller, channame, silent=True)
        if (not channel):
            self.msg(("No    channel    with    alias    '%s'    was    found." % ostring))
        elif caller.nicks.get(ostring, category='channel'):
            caller.nicks.remove(ostring, category='channel')
            self.msg(("Your    alias    '%s'    for    channel    %s    was    cleared." % (ostring, channel.key)))
        else:
            self.msg('You    had    no    such    alias    defined    for    this    channel.')
