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
|
@ -38,12 +38,14 @@ async def on_message(message):
|
||||||
await message.channel.send(f"{message.author.mention} 👋")
|
await message.channel.send(f"{message.author.mention} 👋")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Handle @Bot mention
|
|
||||||
messagearray = message.content.split()
|
messagearray = message.content.split()
|
||||||
|
|
||||||
|
if not (isinstance(message.channel, discord.channel.DMChannel)) and not (messagearray[0] == client.user.mention):
|
||||||
|
return
|
||||||
|
|
||||||
|
# Handle @Bot mention
|
||||||
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