Skip to content

Commit 01ddbde

Browse files
committed
add punctuation stripping to "I hardly know her" joke
1 parent a1e8cff commit 01ddbde

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

protobot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import time #
1717
import asyncio #
1818
import activity #
19+
import string #
1920
#
2021
#####################################
2122

@@ -166,7 +167,8 @@ async def on_message(message):
166167
user_message = message.content.split()
167168

168169
for i in range(len(user_message)):
169-
if (user_message[i][-2:] == "er"):
170+
user_message[i] = user_message[i].translate(str.maketrans('', '', string.punctuation))
171+
if (user_message[i][-2:] == "er" and len(user_message[i]) > 4):
170172
response = user_message[i][0].upper() + user_message[i][1:] + "? I hardly know her!"
171173
await message.channel.send(response)
172174
break

0 commit comments

Comments
 (0)