Add more detailed logging of split function

This commit is contained in:
Aadi Desai 2021-11-19 12:39:42 +00:00
parent 34ce7b1716
commit bfe75cb851
No known key found for this signature in database
GPG key ID: CFFFE425830EF4D9

9
app.py
View file

@ -31,6 +31,15 @@ async def on_message(message):
reply = re.split("(^| )(I'm|Im|i'm|im|I am|i am)( )", message.content, 1) reply = re.split("(^| )(I'm|Im|i'm|im|I am|i am)( )", message.content, 1)
if len(reply) > 1: if len(reply) > 1:
print("Message from " + message.author.name + ": " + message.content) print("Message from " + message.author.name + ": " + message.content)
print(
"Reply: Length:"
+ len(reply)
+ ", Contents: {"
+ reply[0]
+ "}, {"
+ reply[1]
+ "}"
)
if counter > 0: if counter > 0:
counter -= 1 counter -= 1
print("Cooldown: " + str(counter) + " messages") print("Cooldown: " + str(counter) + " messages")