Add !leave to modules/channel_op.py
This commit is contained in:
parent
16474dacef
commit
150788c6c6
2 changed files with 10 additions and 0 deletions
|
@ -237,3 +237,11 @@ class Module(ModuleManager.BaseModule):
|
|||
event["user"].username, event["user"].hostname))
|
||||
event["channel"].send_kick(event["user"].nickname,
|
||||
"highlight spam detected")
|
||||
|
||||
@Utils.hook("received.command.leave", channel_only=True)
|
||||
def leave(self, event):
|
||||
"""
|
||||
:help: Part me from the current channel
|
||||
:require_mode: o
|
||||
"""
|
||||
event["target"].send_part()
|
||||
|
|
|
@ -117,6 +117,8 @@ class Channel(IRCObject.Object):
|
|||
self.server.send_mode(self.name, "-b", hostmask)
|
||||
def send_topic(self, topic):
|
||||
self.server.send_topic(self.name, topic)
|
||||
def send_part(reason=None):
|
||||
self.server.send_part(self.name, reason)
|
||||
|
||||
def mode_or_above(self, user, mode):
|
||||
mode_orders = list(self.server.mode_prefixes.values())
|
||||
|
|
Loading…
Reference in a new issue