We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfb074c commit 950a06eCopy full SHA for 950a06e
plugins/pacokick.py
@@ -0,0 +1,20 @@
1
+from random import choice
2
+from tabs import MucTab
3
+
4
+from plugin import BasePlugin
5
6
+class Plugin(BasePlugin):
7
+ def init(self):
8
+ self.add_command('pacokick', self.command_kick, '/pacokick <nick> [reason]\nPacokick: kick a random user.')
9
10
+ def command_kick(self, arg):
11
+ tab = self.core.current_tab()
12
+ if isinstance(tab, MucTab):
13
+ kickable = list(filter(lambda x: x.affiliation in ('none', 'member'), tab.users))
14
+ if kickable:
15
+ to_kick = choice(kickable)
16
+ if to_kick:
17
+ to_kick = to_kick.nick
18
+ tab.command_kick(to_kick + ' ' +arg)
19
+ else:
20
+ self.core.information('No one to kick :(', 'Info')
0 commit comments