@@ -123,13 +123,24 @@ def kickban(self, event):
123123 self ._kick (event ["server" ], event ["target" ], args [0 ], args [1 :])
124124
125125 @utils .hook ("received.command.op" )
126- @utils .hook ("received.command.deop " )
126+ @utils .hook ("received.command.up" , alias_of = "op " )
127127 @utils .kwarg ("channel_only" , True )
128128 @utils .kwarg ("require_mode" , "o" )
129129 @utils .kwarg ("require_access" , "op" )
130130 @utils .kwarg ("usage" , "[nickname]" )
131131 def op (self , event ):
132- add = event ["command" ] == "op"
132+ self ._op (True , event )
133+
134+ @utils .hook ("received.command.deop" )
135+ @utils .hook ("received.command.down" , alias_of = "deop" )
136+ @utils .kwarg ("channel_only" , True )
137+ @utils .kwarg ("require_mode" , "o" )
138+ @utils .kwarg ("require_access" , "op" )
139+ @utils .kwarg ("usage" , "[nickname]" )
140+ def deop (self , event ):
141+ self ._op (False , event )
142+
143+ def _op (self , add , event ):
133144 target = event ["args_split" ][0 ] if event ["args" ] else event [
134145 "user" ].nickname
135146 event ["target" ].send_mode ("+o" if add else "-o" , [target ])
0 commit comments