# 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
        cdata = self.ircd.channels[params[0]]
        if not user.hasAccess(cdata, self.ircd.servconfig["channel_minimum_level"]["KICK"]):
            user.sendMessage(irc.ERR_CHANOPRIVSNEEDED, cdata.name, ":You must have channel operator access to kick users")
            return {}
        if params[1] not in self.ircd.users:
            user.sendMessage(irc.ERR_NOSUCHNICK, params[1], ":No such nick")
            return {}
        udata = self.ircd.users[params[1]]
        if udata not in cdata.users:
            user.sendMessage(irc.ERR_USERNOTINCHANNEL, udata.nickname, cdata.name, ":They are not on that channel")
            return {}
        if cdata.users[udata] and not user.hasAccess(cdata, cdata.users[udata][0]):
            user.sendMessage(irc.ERR_CHANOPRIVSNEEDED, cdata.name, ":You must have higher operator access than the user to kick")
            return {}
        if len(params) < 3 or not params[2]:
            reason = user.nickname
        else:
            reason = params[2]
        return {
            "user": user,
            "targetchan": cdata,
            "targetuser": udata,
            "reason": reason
        }

class Spawner(object):
    def __init__(self, ircd):
        self.ircd = ircd
    
    def spawn(self):

# 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_kick.py
from twisted.words.protocols import irc
from txircd.modbase import Command

        cdata = self.ircd.channels[params[0]]
        if not user.hasAccess(cdata, self.ircd.servconfig["channel_minimum_level"]["KICK"]):
            user.sendMessage(irc.ERR_CHANOPRIVSNEEDED, cdata.name, ":You must have channel operator access to kick users")
            return {}
        if params[1] not in self.ircd.users:
            user.sendMessage(irc.ERR_NOSUCHNICK, params[1], ":No such nick")
            return {}
        udata = self.ircd.users[params[1]]
        if udata not in cdata.users:
            user.sendMessage(irc.ERR_USERNOTINCHANNEL, udata.nickname, cdata.name, ":They are not on that channel")
            return {}
        if cdata.users[udata] and not user.hasAccess(cdata, cdata.users[udata][0]):
            user.sendMessage(irc.ERR_CHANOPRIVSNEEDED, cdata.name, ":You must have higher operator access than the user to kick")
            return {}
        if len(params) < 3 or not params[2]:
            reason = user.nickname
        else:
            reason = params[2]
        return {
            "user": user,
            "targetchan": cdata,
            "targetuser": udata,
            "reason": reason
        }

class Spawner(object):
    def __init__(self, ircd):
        self.ircd = ircd
    
    def spawn(self):

        if "channel_minimum_level" not in self.ircd.servconfig: