# 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 GlobopsCommand(Command):
    def onUse(self, user, data):
        if "message" in data:
            message = data["message"]
            for u in self.ircd.users:
                if "o" in u.mode:
                    u.sendMessage("NOTICE", ":*** GLOBOPS from {}: {}".format(user.nickname, message))
    
    def processParams(self, user, params):

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


class GlobopsCommand(Command):
    def onUse(self, user, data):
        if "message" in data:
            message = data["message"]
            for u in self.ircd.users:
                if "o" in u.mode:
                    u.sendMessage("NOTICE", ":*** GLOBOPS from {}: {}".format(user.nickname, message))
    
    def processParams(self, user, params):

        if user.registered > 0: