@@ -0,0 +1,2234 @@
+from twisted.plugin import IPlugin%0Afrom twisted.words.protocols import irc%0Afrom txircd.module_interface import Command, ICommand, IModuleData, ModuleData%0Afrom txircd.utils import ircLower%0Afrom zope.interface import implements%0Afrom fnmatch import fnmatch%0A%0Aclass ListCommand(ModuleData, Command):%0A    implements(IPlugin, IModuleData, ICommand)%0A    %0A    name = %22ListCommand%22%0A    core = True%0A    %0A    def hookIRCd(self, ircd):%0A        self.ircd = ircd%0A    %0A    def userCommands(self):%0A        return %5B (%22LIST%22, 1, self) %5D%0A    %0A    def parseParams(self, user, params, prefix, tags):%0A        if not params:%0A            return %7B%7D%0A        channels = %5B%5D%0A        wildcardNames = %5B%5D%0A        for name in params%5B0%5D.split(%22,%22):%0A            if %22*%22 not in name and %22?%22 not in name:%0A                if channelNames in self.ircd.channels:%0A                    channels.append(self.ircd.channels%5BchannelNames%5D)%0A            else:%0A                wildcardNames.append(ircLower(name))%0A        for lowerName, channel in self.ircd.channels.iteritems():%0A            for wildcardName in wildcardNames:%0A                if fnmatch(lowerName, wildcardName):%0A                    channels.append(channel)%0A                    break%0A        return %7B%0A            %22channels%22: channels%0A        %7D%0A    %0A    def execute(self, user, data):%0A        if %22channels%22 in data:%0A            channels = data%5B%22channels%22%5D%0A        else:%0A            channels = self.ircd.channels.values()%0A        %0A        user.sendMessage(irc.RPL_LISTSTART, %22Channel%22, %22:Users Name%22)%0A        for channel in channels:%0A            displayData = %7B%0A                %22name%22: channel.name,%0A                %22usercount%22: len(channel.users),%0A                %22modestopic%22: %22%5B%7B%7D%5D %7B%7D%22.format(channel.modeString(user), channel.topic)%0A            %7D%0A            self.ircd.runActionProcessing(%22displaychannel%22, displayData, channel, user)%0A            if %22name%22 not in displayData or %22usercount%22 not in displayData or %22modestopic%22 not in displayData:%0A                continue%0A            user.sendMessage(irc.RPL_LIST, displayData%5B%22name%22%5D, str(displayData%5B%22usercount%22%5D), %22:%7B%7D%22.format(displayData%5B%22modestopic%22%5D))%0A        user.sendMessage(irc.RPL_LISTEND, %22:End of channel list%22)%0A        return True%0A%0AlistCmd = ListCommand()

Implement the LIST command