Clean up logs

This commit is contained in:
Aadi Desai 2021-11-18 22:29:44 +00:00
parent 558eabccca
commit 34ce7b1716
No known key found for this signature in database
GPG key ID: CFFFE425830EF4D9
2 changed files with 4 additions and 4 deletions

View file

@ -1,3 +1,4 @@
{ {
"python.pythonPath": "gondilinabot\\Scripts\\python.exe", "python.pythonPath": "gondilinabot\\Scripts\\python.exe",
"python.linting.pylintEnabled": true,
} }

7
app.py
View file

@ -27,9 +27,10 @@ async def on_message(message):
return return
else: else:
global counter global counter
print("Message from " + message.author.name + ": " + message.content) # TODO: Add detection for "genshin" and replace with "g*nshin"
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)
if counter > 0: if counter > 0:
counter -= 1 counter -= 1
print("Cooldown: " + str(counter) + " messages") print("Cooldown: " + str(counter) + " messages")
@ -37,8 +38,6 @@ async def on_message(message):
counter = random.randrange(mincooldown, maxcooldown) counter = random.randrange(mincooldown, maxcooldown)
await message.reply("Hi " + reply[1] + ", I'm Dad") await message.reply("Hi " + reply[1] + ", I'm Dad")
print("Replied to " + message.author.name + " with Dad Joke") print("Replied to " + message.author.name + " with Dad Joke")
else:
print("No match, ignoring...")
with open("secrets.yaml") as stream: with open("secrets.yaml") as stream: