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') log.warning('command channel not found')
return return
# parse it, follows format command,uid # parse it, follows format command,uid,username
uid = message.split(',')[-1] sp = message.split(',')
command = ','.join(message.split(',')[:-1]) username = sp[-1]
uid = sp[-2]
command = ','.join(sp[:-2])
log.info(f'[rsudo] {uid!r} {command!r}') log.info(f'[rsudo] {uid!r} {command!r}')