Update actions.py
Browse files- 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 |
-
|
|
|
|
|
|
|
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:
|