Add unconditional reply and counter init message to log

This commit is contained in:
Aadi Desai 2021-11-26 17:34:15 +00:00
parent 7e7a30e1d6
commit b219f9b65c
No known key found for this signature in database
GPG key ID: CFFFE425830EF4D9

16
app.py
View file

@ -16,6 +16,7 @@ async def on_ready():
print("Logged in as")
print(bot.user.name + "#" + bot.user.discriminator)
print(bot.user.id)
print("Init Counter: " + str(counter))
await bot.change_presence(
status=discord.Status.online, activity=discord.Game(name="with Godlina")
)
@ -25,6 +26,21 @@ async def on_ready():
async def on_message(message):
if message.author == bot.user:
return
elif message.author.id == 581890740360052764:
reply = re.split("(^| )(I'm|Im|i'm|im|I am|i am)( )", message.content, 1)
if len(reply) > 1:
print("Message from " + message.author.name + ": " + message.content)
print(
"Reply: Length:"
+ str(len(reply))
+ ", Final Contents: {"
+ reply[-1]
+ "}"
)
await message.reply("Hi " + reply[-1] + ", I'm Dad")
print(
"Replied unconditionally to " + message.author.name + " with Dad Joke"
)
else:
global counter
# TODO: Add detection for "genshin" and replace with "g*nshin"