diff options
| author | 2020-02-17 15:16:00 +0000 | |
|---|---|---|
| committer | 2020-02-17 15:16:00 +0000 | |
| commit | 7f98ba8310b8d48ee28f3fe90c99845b80edcf2b (patch) | |
| tree | f04f9996b4f26469cbcb5cae0388ab9a8988bccf /modules/channel_op.py | |
| parent | support gitlab wiki events (diff) | |
| signature | ||
send multiple KICKs in the same line when possible
Diffstat (limited to 'modules/channel_op.py')
| -rw-r--r-- | modules/channel_op.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/channel_op.py b/modules/channel_op.py index e87fc6b9..6bbedf5e 100644 --- a/modules/channel_op.py +++ b/modules/channel_op.py @@ -55,9 +55,9 @@ class Module(ModuleManager.BaseModule): server.get_setting("default-kick-reason", self.bot.get_setting("default-kick-reson", KICK_REASON))) - def _kick(self, server, channel, target_user, reason): + def _kick(self, server, channel, nicknames, reason): reason = reason or self._kick_reason(server, channel) - channel.send_kick(target_user.nickname, reason) + channel.send_kicks(nicknames, reason) @utils.hook("received.command.kick") @utils.hook("received.command.k", alias_of="kick") @@ -66,8 +66,8 @@ class Module(ModuleManager.BaseModule): @utils.kwarg("help", "Kick a user from a channel") @utils.spec("!<#channel>r~channel !<nickname>cuser ?<reason>string") def kick(self, event): - self._kick(event["server"], event["spec"][0], event["spec"][1], - event["spec"][2]) + self._kick(event["server"], event["spec"][0], + [event["spec"][1].nickname], event["spec"][2]) def _format_hostmask(self, user, s): vars = {} @@ -143,9 +143,8 @@ class Module(ModuleManager.BaseModule): users = event["spec"][2][1] else: users = [event["spec"][2][1]] - for user in users: - self._kick(event["server"], event["spec"][0], user, - event["spec"][3]) + self._kick(event["server"], event["spec"][0], + [u.nickname for u in users], event["spec"][3]) @utils.hook("received.command.op") @utils.hook("received.command.up", alias_of="op") |
