From bb0c8ec452ac26d2265869bc818b89c74108bdbd Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Sun, 21 Mar 2021 21:03:29 +0100 Subject: [PATCH] Disallow shell commands on channels --- ubot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ubot.py b/ubot.py index a4e0a56..b1f0782 100644 --- a/ubot.py +++ b/ubot.py @@ -88,6 +88,10 @@ async def edit(event): await client.send_message('me', rpl) if '.sh' in msg: + if event.is_channel and not event.is_group: + await event.edit('Sorry, this is not allowed!') + return + cmd = msg.split(' ', 1)[1] host = os.uname()[1] user = os.environ['USER']