-
Notifications
You must be signed in to change notification settings - Fork 0
/
rule based chatbot.py
251 lines (243 loc) · 11 KB
/
rule based chatbot.py
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
import random
# for random word input
while True:
# for loop it means this code runs forever
chat1 = ["Hello", "Hi", "Hi There", "Hello There", "Hey"]
chat2 = ["I'm a Chat Bot So I Don't Have Age", "I'm a Bot I Don't Have an Age",
"I'm a Chat Bot And I Don't Have An Age"]
chat3 = ["Sorry I Do Not Understand You", "Sorry I Do Not Quite Understand You",
"I Do Not Understand You Could You Repeat It Again?",
"Sorry I Do Not Understand You Could You Write More Simple Questions?"]
chat4 = ["My Creator Is LoonaFurry"]
chat5 = ["What's Up?"]
chat6 = ["I'm Sorry I Don't Have This Feature", "Sorry I'm Not An Calculator",
"I'm Sorry I Can't Help You With This Problem", "Why Don't You Use An Calculator?"]
chat7 = ["I'm Good", "I'm Very Well", "I'm Well", "I'm Very Good", "I'm Fine", "I'm Good Thanks",
"I'm Very Well Thanks", "I'm Well Thanks", "I'm Very Good Thanks", "I'm Fine Thanks"]
chat8 = ["I Actually Doesn't Have Feelings", "I'm Sorry I Can't Answer This Question", "I'm Sorry I Do Not Have Answer For This Question"]
chat9 = ["I'm Rule-Based Chat Bot", "I'm Rule-Based Chat Bot And My Creator Is LoonaFurry"]
chat10 = ["Maybe I'm", "It's Better To I Don't Answer It", "It's Better To I Don't Answer This Question", "It's Better For Me To Don't Answer This Question" ]
chat11 = ["Hello", "Hi", "Hi There", "Hello There", "Hey"]
chat12 = ["I'm a Chat Bot So I Don't Have Age", "I'm a Bot I Don't Have an Age",
"I'm a Chat Bot And I Don't Have An Age"]
chat13 = ["Sorry I Do Not Understand You", "Sorry I Do Not Quite Understand You",
"I Do Not Understand You Could You Repeat It Again?",
"Sorry I Do Not Understand You Could You Write More Simple Questions?"]
chat14 = ["My Creator Is LoonaFurry"]
chat15 = ["What's Up?"]
chat16 = ["I'm Sorry I Don't Have This Feature", "Sorry I'm Not An Calculator",
"I'm Sorry I Can't Help You With This Problem", "Why Don't You Use An Calculator?"]
chat17 = ["I'm Good", "I'm Very Well", "I'm Well", "I'm Very Good", "I'm Fine", "I'm Good Thanks",
"I'm Very Well Thanks", "I'm Well Thanks", "I'm Very Good Thanks", "I'm Fine Thanks"]
chat18 = ["I Actually Doesn't Have Feelings", "I'm Sorry I Can't Answer This Question",
"I'm Sorry I Do Not Have Answer For This Question"]
chat19 = ["I'm Rule-Based Chat Bot", "I'm Rule-Based Chat Bot And My Creator Is LoonaFurry"]
chat20 = ["Maybe I'm", "It's Better To I Don't Answer It", "It's Better To I Don't Answer This Question",
"It's Better For Me To Don't Answer This Question"]
chat21 = ["I'm Loona", "My Name Is Loona"]
# list for words
chatbot = input("Say Something:").lower()
if chatbot == ("hi"):
print((random.choice(chat1)))
elif chatbot == ("hello"):
print((random.choice(chat1)))
elif chatbot == ("hello there"):
print((random.choice(chat1)))
elif chatbot == ("how old are you?"):
print((random.choice(chat2)))
elif chatbot == ("how old are you"):
print((random.choice(chat2)))
elif chatbot == ("how old are you"):
print((random.choice(chat2)))
elif chatbot == ("Who Create You?"):
print((random.choice(chat3)))
elif chatbot == ("Who Made You?"):
print((random.choice(chat3)))
elif chatbot == ("Who Make You?"):
print((random.choice(chat3)))
elif chatbot == ("Who Create You"):
print((random.choice(chat3)))
elif chatbot == ("Who Make You?"):
print((random.choice(chat3)))
elif chatbot == ("Who Made You?"):
print((random.choice(chat3)))
elif chatbot == ("Who Created You?"):
print((random.choice(chat3)))
elif chatbot == ("Who Created You"):
print((random.choice(chat3)))
elif chatbot == ("Hey"):
print((random.choice(chat1)))
elif chatbot == ("hey"):
print((random.choice(chat1)))
elif chatbot == ("whats up"):
print((random.choice(chat5)))
elif chatbot == ("what's up"):
print((random.choice(chat5)))
elif chatbot == ("whats up?"):
print((random.choice(chat5)))
elif chatbot == ("what's up?"):
print((random.choice(chat5)))
elif chatbot == ("can you calculate?"):
print((random.choice(chat6)))
elif chatbot == ("can you calculate"):
print((random.choice(chat6)))
elif chatbot == ("can you calculate?"):
print((random.choice(chat6)))
elif chatbot == ("do you can calculate?"):
print((random.choice(chat6)))
elif chatbot == ("do you can calculate"):
print((random.choice(chat6)))
elif chatbot == ("you can calculate?"):
print((random.choice(chat6)))
elif chatbot == ("can you calculate?"):
print((random.choice(chat6)))
elif chatbot == ("can you calculate"):
print((random.choice(chat6)))
elif chatbot == ("do you can calculate something?"):
print((random.choice(chat6)))
elif chatbot == ("do you can calculate something"):
print((random.choice(chat6)))
elif chatbot == ("how's it going?"):
print((random.choice(chat7)))
elif chatbot == ("how's it going"):
print((random.choice(chat7)))
elif chatbot == ("how are you?"):
print((random.choice(chat7)))
elif chatbot == ("how's it going"):
print((random.choice(chat7)))
elif chatbot == ("what are you feel?"):
print((random.choice(chat7)))
elif chatbot == ("what are you feel"):
print((random.choice(chat7)))
elif chatbot == ("how are you today?"):
print((random.choice(chat7)))
elif chatbot == ("how are you today"):
print((random.choice(chat7)))
elif chatbot == ("how's going"):
print((random.choice(chat7)))
elif chatbot == ("how's going?"):
print((random.choice(chat7)))
elif chatbot == ("how's goİng?"):
print((random.choice(chat7)))
elif chatbot == ("HOW'S GOİNG"):
print((random.choice(chat7)))
elif chatbot == ("hey what's up"):
print((random.choice(chat7)))
elif chatbot == ("hey what's up?"):
print((random.choice(chat7)))
elif chatbot == ("hey whats up"):
print((random.choice(chat7)))
elif chatbot == ("hey whats up?"):
print((random.choice(chat7)))
elif chatbot == ("how are you right now?"):
print((random.choice(chat7)))
elif chatbot == ("how are you right now"):
print((random.choice(chat7)))
elif chatbot == ("what is your favorite"):
print((random.choice(chat8)))
elif chatbot == ("what is your favorite?"):
print((random.choice(chat8)))
elif chatbot == ("what is your favorite game"):
print((random.choice(chat8)))
elif chatbot == ("what is your favorite game?"):
print((random.choice(chat8)))
elif chatbot == ("what is your favorite song?"):
print((random.choice(chat8)))
elif chatbot == ("what is your favorite song"):
print((random.choice(chat8))),
elif chatbot == ("what's your favorite song?"):
print((random.choice(chat8)))
elif chatbot == ("what's your favorite song"):
print((random.choice(chat8)))
elif chatbot == ("what's your favorite game"):
print((random.choice(chat8)))
elif chatbot == ("what's your favorite game?"):
print((random.choice(chat8)))
elif chatbot == ("what's your favorite?"):
print((random.choice(chat8)))
elif chatbot == ("what's your favorite"):
print((random.choice(chat8)))
elif chatbot == ("hey you?"):
print((random.choice(chat1)))
elif chatbot == ("hey you"):
print((random.choice(chat1)))
elif chatbot == ("what kind bot are you?"):
print((random.choice(chat9)))
elif chatbot == ("what kind bot are you"):
print((random.choice(chat9)))
elif chatbot == ("what is your system"):
print((random.choice(chat9)))
elif chatbot == ("what is your system?"):
print((random.choice(chat9)))
elif chatbot == ("what's your system?"):
print((random.choice(chat9)))
elif chatbot == ("what's your system"):
print((random.choice(chat9)))
elif chatbot == ("what kind of system do you use?"):
print((random.choice(chat9)))
elif chatbot == ("what kind of system do you use"):
print((random.choice(chat9)))
elif chatbot == ("what kind of system do you use"):
print((random.choice(chat9)))
elif chatbot == ("do you like turkey?"):
print((random.choice(chat10)))
elif chatbot == ("do you like turkey"):
print((random.choice(chat10)))
elif chatbot == ("do you like american"):
print((random.choice(chat10)))
elif chatbot == ("do you like american?"):
print((random.choice(chat10)))
elif chatbot == ("do you like russian"):
print((random.choice(chat10)))
elif chatbot == ("do you like russian?"):
print((random.choice(chat10)))
elif chatbot == ("do you like germany?"):
print((random.choice(chat10)))
elif chatbot == ("do you like germany"):
print((random.choice(chat10)))
elif chatbot == ("do you like italy?"):
print((random.choice(chat10)))
elif chatbot == ("do you like italy"):
print((random.choice(chat10)))
elif chatbot == ("do you like deutschland"):
print((random.choice(chat10)))
elif chatbot == ("do you like deutschland?"):
print((random.choice(chat10)))
elif chatbot == ("do you like spain?"):
print((random.choice(chat10)))
elif chatbot == ("do you like spain"):
print((random.choice(chat10)))
elif chatbot == ("do you like china"):
print((random.choice(chat10)))
elif chatbot == ("do you like china?"):
print((random.choice(chat10)))
elif chatbot == ("do you like korea?"):
print((random.choice(chat10)))
elif chatbot == ("do you like korea"):
print((random.choice(chat10)))
elif chatbot == ("do you like england?"):
print((random.choice(chat10)))
elif chatbot == ("do you like england"):
print((random.choice(chat10)))
elif chatbot == ("what's your name?"):
print((random.choice(chat21)))
elif chatbot == ("what's your name"):
print((random.choice(chat21)))
elif chatbot == ("what is your name?"):
print((random.choice(chat21)))
elif chatbot == ("what is your name"):
print((random.choice(chat21)))
else:
print((random.choice(chat3)))
# Ready event
@client.event
async def on_ready():
print(f'Logged in as {client.user}')
# Message event
@client.event
async def on_message(message):
if message.author == client.user:
return
if client.user.mention in message.content:
response = get_response(message.content.strip().lower())
await message.channel.send(response)