# 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

class PartCommand(Command):
    def onUse(self, user, data):
        if "targetchan" not in data:
            return
        reason = data["reason"] if "reason" in data else None
        for channel in data["targetchan"]:
            if user not in channel.users:

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


class PartCommand(Command):
    def onUse(self, user, data):
        if "targetchan" not in data:
            return
        reason = data["reason"] if "reason" in data else None
        for channel in data["targetchan"]:
            if user not in channel.users:

                continue