From 10ae22247493f002b7b06176b0f54c7dc8a2bab7 Mon Sep 17 00:00:00 2001 From: lauralani Date: Mon, 1 Jan 2024 18:40:00 +0100 Subject: [PATCH] make bot responsive in dms without mention --- app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 8bca97d..aa85279 100644 --- a/app.py +++ b/app.py @@ -37,13 +37,15 @@ async def on_message(message): logger.info(f"Ping by {message.author.name}") await message.channel.send(f"{message.author.mention} 👋") return + + messagearray = message.content.split() + + if not (isinstance(message.channel, discord.channel.DMChannel)) and not (messagearray[0] == client.user.mention): + return # Handle @Bot mention - messagearray = message.content.split() if messagearray[0] == client.user.mention: messagearray.pop(0) - else: - return command = messagearray[0].lower()