From 472dacb9bd2fd31075e892b9125b61c227f2d31a Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Mon, 22 Mar 2021 23:52:04 +0100 Subject: [PATCH] Log command attempts on channels Not actually needed, but helps me sleep at night --- ubot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ubot.py b/ubot.py index 1984224..82d3e4e 100644 --- a/ubot.py +++ b/ubot.py @@ -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]