From 566f61d6073fcafd81e62c380fb6912cad4dd8b5 Mon Sep 17 00:00:00 2001 From: stavilam Date: Sat, 10 Nov 2018 19:33:42 +0000 Subject: [PATCH] Trying to find a more secure eval() alternative (in other words a function that doesn't expose your OS and files to being destroyed by a single line of code in discord chat) --- wip.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wip.py b/wip.py index 78190c2..82de27d 100644 --- a/wip.py +++ b/wip.py @@ -1,9 +1,17 @@ """ Work in progress - + check if message id is in message cache async def on_raw_message_delete(self, payload): print (client._connection._messages) #if discord.utils.get(client._connection._messages, id = payload.message_id): #Work in progress await client.get_channel(payload.channel_id).send(f'Message has been deleted at the request of .') + + + evaluate a string WITHOUT eval() - eval() has security issues and therefore is a dangerous + function. this is for the calculator + @commands.command() + async def calc(self, ctx, *args): + print (*args) + print (*args) """