Skip to content

Commit 1ab3459

Browse files
author
Foxlet
committed
chatbot.py - Using while loops
1 parent 599a7c9 commit 1ab3459

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

data/GeoLite2-City.mmdb

-3 Bytes
Binary file not shown.

plugins/chatbot.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ def ask(text):
1111

1212
try:
1313
answer = session.ask(text)
14-
if answer.startswith("\n"):
14+
while answer.startswith("\n"):
1515
# cleverbot tried to advert us
1616
answer = session.ask(text)
17-
if answer.startswith("\n"):
18-
answer = session.ask(text)
1917
except urllib.error.HTTPError:
2018
return "Could not get response. Cleverbot is angry :("
2119

0 commit comments

Comments
 (0)