]>
jfr.im git - erebus.git/blob - modules/stafflist.py
1 # Erebus IRC bot - Author: Erebus Team
2 # vim: fileencoding=utf-8
4 # This file is released into the public domain; see http://unlicense.org/
8 'author': 'Erebus Team',
9 'license': 'public domain',
10 'compatible': [0], # compatible module API versions
11 'depends': [], # other modules required to work properly?
12 'softdeps': ['help'], # modules which are preferred but not required
17 lib
= modlib
.modlib(__name__
)
18 modstart
= lib
.modstart
23 nicks
= [x
.nick
for x
in lib
.parent
.getuserbyauth(auth
)]
27 return ', '.join(nicks
)
29 @lib.hook(needchan
=False)
30 @lib.help(None, 'lists staff')
32 def stafflist(bot
, user
, chan
, realtarget
, *args
):
33 c
= lib
.parent
.query("SELECT auth, level FROM users WHERE level > %s", (lib
.parent
.cfg
.get('stafflist', 'minstafflevel', default
=lib
.KNOWN
),))
38 if user
.glevel
> lib
.KNOWN
:
39 response
= ["#%s (%s, %s)" % (i
['auth'], _getnicks(i
['auth']), i
['level']) for i
in staffs
]
41 response
= ["#%s (%s)" % (i
['auth'], _getnicks(i
['auth'])) for i
in staffs
]
42 user
.msg("Staff listing: %s" % (', '.join(response
)))