arde0909 commited on
Commit
d111908
1 Parent(s): cb19f4d

Update actions.py

Browse files
Files changed (1) hide show
  1. actions.py +5 -1
actions.py CHANGED
@@ -1,4 +1,5 @@
1
  import httpx
 
2
  import os
3
 
4
  def wikipedia(q):
@@ -10,7 +11,10 @@ def wikipedia(q):
10
  }).json()["query"]["search"][0]["snippet"]
11
 
12
  def calculate(what):
13
- return eval(what)
 
 
 
14
 
15
  def current_time(place):
16
  try:
 
1
  import httpx
2
+ import math
3
  import os
4
 
5
  def wikipedia(q):
 
11
  }).json()["query"]["search"][0]["snippet"]
12
 
13
  def calculate(what):
14
+ try:
15
+ return str(eval(what, {"__builtins__": None}, {"math": math}))
16
+ except Exception as e:
17
+ return str(e)
18
 
19
  def current_time(place):
20
  try: