make bot responsive in dms without mention
This commit is contained in:
parent
fd66696361
commit
10ae222474
1 changed files with 5 additions and 3 deletions
8
app.py
8
app.py
|
@ -37,13 +37,15 @@ async def on_message(message):
|
||||||
logger.info(f"Ping by {message.author.name}")
|
logger.info(f"Ping by {message.author.name}")
|
||||||
await message.channel.send(f"{message.author.mention} 👋")
|
await message.channel.send(f"{message.author.mention} 👋")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
messagearray = message.content.split()
|
||||||
|
|
||||||
|
if not (isinstance(message.channel, discord.channel.DMChannel)) and not (messagearray[0] == client.user.mention):
|
||||||
|
return
|
||||||
|
|
||||||
# Handle @Bot mention
|
# Handle @Bot mention
|
||||||
messagearray = message.content.split()
|
|
||||||
if messagearray[0] == client.user.mention:
|
if messagearray[0] == client.user.mention:
|
||||||
messagearray.pop(0)
|
messagearray.pop(0)
|
||||||
else:
|
|
||||||
return
|
|
||||||
|
|
||||||
command = messagearray[0].lower()
|
command = messagearray[0].lower()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue