Disallow shell commands on channels

This commit is contained in:
Michael De Roover 2021-03-21 21:03:29 +01:00
parent a840b9a1de
commit bb0c8ec452
Signed by: vim
GPG Key ID: 075496E232CE04CB

View File

@ -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']