3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

plugins/admin.py: add 'showuser' command

This commit is contained in:
James Lu 2015-06-19 13:00:23 -07:00
parent d8b562865d
commit 0db5c4c209

View File

@ -109,6 +109,22 @@ def kickclient(irc, source, args):
return return
irc.proto.kickClient(irc, u, channel, targetu, reason) irc.proto.kickClient(irc, u, channel, targetu, reason)
@utils.add_cmd
def showuser(irc, source, args):
checkauthenticated(irc, source)
try:
target = args[0]
except IndexError:
utils.msg(irc, source, "Error: not enough arguments. Needs 1: nick.")
return
u = utils.nickToUid(irc, target)
if u is None:
utils.msg(irc, source, 'Error: unknown user %r' % target)
return
s = ['\x02%s\x02: %s' % (k, v) for k, v in irc.users[u].__dict__.items()]
s = 'Information on user %s: %s' % (target, '; '.join(s))
utils.msg(irc, source, s)
@utils.add_cmd @utils.add_cmd
def tell(irc, source, args): def tell(irc, source, args):
checkauthenticated(irc, source) checkauthenticated(irc, source)