]> jfr.im git - erebus.git/blame - modules/stafflist.py
stafflist module created
[erebus.git] / modules / stafflist.py
CommitLineData
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
6modinfo = {
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
15import modlib
16lib = modlib.modlib(__name__)
17modstart = lib.modstart
18modstop = lib.modstop
19
20# module code
21@lib.hook(needchan=False)
22@lib.help(None, 'lists staff')
23@lib.argsEQ(0)
24def 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)))