Log command attempts on channels

Not actually needed, but helps me sleep at night
This commit is contained in:
Michael De Roover 2021-03-22 23:52:04 +01:00
parent 81aa5914aa
commit 472dacb9bd
Signed by: vim
GPG Key ID: 075496E232CE04CB

View File

@ -90,6 +90,10 @@ async def edit(event):
if msg.startswith('.sh'):
if event.is_channel and not event.is_group:
await event.edit('Sorry, this is not allowed!')
rpl = f'Someone attempted to execute a command on a channel.\n'
rpl += f'Message: `{msg}`\n'
rpl += f'Execution aborted.\n'
await client.send_message('me', rpl)
return
cmd = msg.split(' ', 1)[1]