# Path: txircd/modbase.py
# class Command(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def onUse(self, user, data):
#         pass
#     def processParams(self, user, params):
#         return {
#             "user": user,
#             "params": params
#         }
#     def updateActivity(self, user):
#         user.lastactivity = now()


from twisted.words.protocols import irc
from txircd.modbase import Command
        for udata in data["targetuser"]:
            udata.sendMessage(cmd, ":{}".format(message), prefix=user.prefix())
    
    def processParams(self, cmd, user, params):
        if user.registered > 0:
            user.sendMessage(irc.ERR_NOTREGISTERED, cmd, ":You have not registered")
            return {}
        if not params:
            user.sendMessage(irc.ERR_NEEDMOREPARAMS, cmd, ":Not enough parameters")
            return {}
        if len(params) < 2:
            user.sendMessage(irc.ERR_NOTEXTTOSEND, ":No text to send")
            return {}
        targetChans = []
        targetUsers = []
        targetChanModifiers = []
        for target in params[0].split(","):
            if target in self.ircd.users:
                targetUsers.append(self.ircd.users[target])
            elif target in self.ircd.channels:
                targetChans.append(self.ircd.channels[target])
                targetChanModifiers.append("")
            elif target[0] in self.ircd.prefix_symbols and target[1:] in self.ircd.channels:
                targetChans.append(self.ircd.channels[target[1:]])
                targetChanModifiers.append(target[0])
            else:
                user.sendMessage(irc.ERR_NOSUCHNICK, target, ":No such nick/channel")
        return {
            "user": user,
            "targetchan": targetChans,

# Path: txircd/modbase.py
# class Command(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def onUse(self, user, data):
#         pass
#     def processParams(self, user, params):
#         return {
#             "user": user,
#             "params": params
#         }
#     def updateActivity(self, user):
#         user.lastactivity = now()


# Path: txircd/modules/cmd_privmsg_notice.py
from twisted.words.protocols import irc
from txircd.modbase import Command

        for udata in data["targetuser"]:
            udata.sendMessage(cmd, ":{}".format(message), prefix=user.prefix())
    
    def processParams(self, cmd, user, params):
        if user.registered > 0:
            user.sendMessage(irc.ERR_NOTREGISTERED, cmd, ":You have not registered")
            return {}
        if not params:
            user.sendMessage(irc.ERR_NEEDMOREPARAMS, cmd, ":Not enough parameters")
            return {}
        if len(params) < 2:
            user.sendMessage(irc.ERR_NOTEXTTOSEND, ":No text to send")
            return {}
        targetChans = []
        targetUsers = []
        targetChanModifiers = []
        for target in params[0].split(","):
            if target in self.ircd.users:
                targetUsers.append(self.ircd.users[target])
            elif target in self.ircd.channels:
                targetChans.append(self.ircd.channels[target])
                targetChanModifiers.append("")
            elif target[0] in self.ircd.prefix_symbols and target[1:] in self.ircd.channels:
                targetChans.append(self.ircd.channels[target[1:]])
                targetChanModifiers.append(target[0])
            else:
                user.sendMessage(irc.ERR_NOSUCHNICK, target, ":No such nick/channel")
        return {
            "user": user,
            "targetchan": targetChans,

            "chanmod": targetChanModifiers,