Skip to content

Commit 0fe1fe8

Browse files
committed
Stop loading the strings DB in general actions
It was not used.
1 parent 9d43f54 commit 0fe1fe8

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

marvin_general_actions.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,11 @@
55
Make general actions for Marvin, one function for each action.
66
"""
77
import datetime
8-
import json
98
import random
109

11-
# Load all strings from file
12-
with open("marvin_strings.json", encoding="utf-8") as f:
13-
STRINGS = json.load(f)
14-
1510
lastDateGreeted = None
1611

1712

18-
def getString(key, key1=None):
19-
"""
20-
Get a string from the string database.
21-
"""
22-
data = STRINGS[key]
23-
if isinstance(data, list):
24-
res = data[random.randint(0, len(data) - 1)]
25-
elif isinstance(data, dict):
26-
if key1 is None:
27-
res = data
28-
else:
29-
res = data[key1]
30-
if isinstance(res, list):
31-
res = res[random.randint(0, len(res) - 1)]
32-
elif isinstance(data, str):
33-
res = data
34-
35-
return res
36-
37-
3813
def getAllGeneralActions():
3914
"""
4015
Return all general actions as an array.

0 commit comments

Comments
 (0)