parse usernames

This commit is contained in:
Luna Mendes 2017-12-03 03:26:30 -03:00
parent 62f98be69d
commit d0c888a30d

View file

@ -33,9 +33,12 @@ class Rsudo(Cog):
log.warning('command channel not found')
return
# parse it, follows format command,uid
uid = message.split(',')[-1]
command = ','.join(message.split(',')[:-1])
# parse it, follows format command,uid,username
sp = message.split(',')
username = sp[-1]
uid = sp[-2]
command = ','.join(sp[:-2])
log.info(f'[rsudo] {uid!r} {command!r}')