mirror of
https://github.com/supleed2/gondilinabot-python.git
synced 2024-12-22 21:45:48 +00:00
Add detection for spoiler tags and ignore matching messages
This commit is contained in:
parent
fdb7a2bb6e
commit
411fe4d505
13
app.py
13
app.py
|
@ -25,8 +25,19 @@ async def on_ready():
|
|||
|
||||
@bot.event
|
||||
async def on_message(message):
|
||||
global counter
|
||||
global idleMessageCounter
|
||||
if message.author == bot.user:
|
||||
return
|
||||
elif bool(re.search("\|\|", message.content)):
|
||||
idleMessageCounter += 1
|
||||
if idleMessageCounter % 5 == 0:
|
||||
await bot.change_presence(
|
||||
status=discord.Status.online,
|
||||
activity=discord.Game(
|
||||
name="with Godlina [" + str(idleMessageCounter) + "]"
|
||||
),
|
||||
)
|
||||
elif message.author.id == 581890740360052764:
|
||||
reply = re.split(
|
||||
"(^| )(I'M|IM|I AM|I'm|Im|I am|i'm|im|i am)( )", message.content, 1
|
||||
|
@ -45,8 +56,6 @@ async def on_message(message):
|
|||
"Replied unconditionally to " + message.author.name + " with Dad Joke"
|
||||
)
|
||||
else:
|
||||
global counter
|
||||
global idleMessageCounter
|
||||
# TODO: Add detection for "genshin" and replace with "g*nshin"
|
||||
reply = re.split(
|
||||
"(^| )(I'M|IM|I AM|I'm|Im|I am|i'm|im|i am)( )", message.content, 1
|
||||
|
|
Loading…
Reference in a new issue