-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
30 lines (25 loc) · 753 Bytes
/
utils.py
File metadata and controls
30 lines (25 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import random
def react_with_random(responses, count):
if count >= len(responses):
return responses[random.randint(0, len(responses) - 1)]
return responses[count]
def react(responses, count):
if count >= len(responses):
return responses[len(responses) - 1]
return responses[count]
def handle_reaction(emot_ai, table, action):
emot_ai.say(
react(
table,
emot_ai.actions_memory.count_value(action)
)
)
emot_ai.actions_memory.add(action)
def handle_with_random_reaction(emot_ai, table, action):
emot_ai.say(
react_with_random(
table,
emot_ai.actions_memory.count_value(action)
)
)
emot_ai.actions_memory.add(action)