]>
Commit | Line | Data |
---|---|---|
0ce8eacc | 1 | # Erebus IRC bot - Author: Erebus Team |
2 | # staff list module | |
3 | # This file is released into the public domain; see http://unlicense.org/ | |
4 | ||
5 | # module info | |
6 | modinfo = { | |
7 | 'author': 'Erebus Team', | |
8 | 'license': 'public domain', | |
9 | 'compatible': [0], # compatible module API versions | |
10 | 'depends': [], # other modules required to work properly? | |
11 | 'softdeps': ['help'], # modules which are preferred but not required | |
12 | } | |
13 | ||
14 | # preamble | |
15 | import modlib | |
16 | lib = modlib.modlib(__name__) | |
17 | modstart = lib.modstart | |
18 | modstop = lib.modstop | |
19 | ||
20 | # module code | |
21 | @lib.hook(needchan=False) | |
22 | @lib.help(None, 'lists staff') | |
23 | @lib.argsEQ(0) | |
24 | def stafflist(bot, user, chan, realtarget, *args): | |
25 | c = lib.parent.query("SELECT auth, level FROM users WHERE level > %s", (lib.parent.cfg.get('stafflist', 'minstafflevel', default=lib.KNOWN))) | |
26 | if c: | |
27 | staffs = c.fetchall() | |
28 | c.close() | |
29 | if len(staffs) > 0: | |
30 | if user.glevel > lib.KNOWN: | |
31 | response = ["%s (%s)" % (i['auth'], i['level']) for i in staffs] | |
32 | else: | |
33 | response = [i['auth'] for i in staffs] | |
34 | user.msg("Staff listing: %s" % (', '.join(response))) |