This repository was archived by the owner on Jan 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathRepetition.py
More file actions
69 lines (35 loc) · 1.76 KB
/
Copy pathRepetition.py
File metadata and controls
69 lines (35 loc) · 1.76 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## THIS FILE HAS NOT BEEN TOUCHED FOR A LONG TIME, SAVING FOR USE IN THE FUTURE.
import time
class Repetition():
def checkReptInitiate(self,intent,session,settings):
if not intent in session["history"] and not intent in settings["repetition"][0]["repetitionSkip"]:
return True
elif intent in session["history"] and not intent in settings["repetition"][0]["repetitionSkip"]:
return False
def checkReptIgnored(self,intent,settings):
if not intent in settings["repetition"][0]["repetitionSkip"]:
return True
else:
return False
def checkReptContinue(self,intent,session,settings):
if intent in session["history"] and session["history"][intent]["count"] > 0 and session["history"][intent]["count"] < settings["repetition"][0]["ignoreCount"]:
return True
else:
return False
def checkReptContinues(self,intent,session,settings):
if intent in session["history"] and session["history"][intent]["count"] > settings["repetition"][0]["ignoreCount"]:
return True
else:
return False
def checkReptStop(self,intent,session,settings):
if intent in session["history"] and session["history"][intent]["count"] == settings["repetition"][0]["ignoreCount"]:
return True
else:
return False
def setIgnoreResponses(self,settings):
return [settings["repetition"][0]["ignoreMessage"]]
def checkIgnoreStop(self,intent,session,settings):
if "countTime" in session["history"][intent] and int(time.time()) > session["history"][intent]["countTime"] + settings["repetition"][0]["ignoreReset"]:
return True
else:
return False