I tried using if not message.author.bot: but it still react to itself.
I searched on google, but i didn't find any useful solution.
I asked this on the official discord server, but nobody knew the answer :c
I will be very happy if someone could give me any useful information.
Show the code probably?
Show the code probably?
@commands.Cog.listener()
async def on_message(self, message):
if not messgae.author.bot:
if message.channel.type == discord.ChannelType.private:
# some stuff here
- There's no error there, maybe you have a selfbot or you didn't restart the bot.
Also, better check it like bot.user.id != message.author.id
2.The issues page is for library issues, for questions about your code ask in the support guild
Try this:
@commands.Cog.listener()
async def on_message(self, message):
if not message.author.bot:
if message.channel.type == discord.ChannelType.private:
print("asd")
@commands.command()
async def test(self,ctx):
await ctx.author.send("test")
When you type [prefix]test it will send the message and the bot will print asd.
And that is what I don't want.
Same with bot.user.id != message.author.id.
You've spelled message incorrectly as messgae.
When you type [prefix]test it will send the message and the bot will print asd.
And that is what I don't want.
But in that case, the message author would NOT be bot - it would be the person that typed [prefix]test. Can you explain?
Why did you delete the issue template instead of filling it out?
You've spelled message incorrectly as
messgae.When you type [prefix]test it will send the message and the bot will print asd.
And that is what I don't want.But in that case, the message author would NOT be bot - it would be the person that typed
[prefix]test. Can you explain?Why did you delete the issue template instead of filling it out?
Ok, I wrote it bad, but when I write it correct it will not fix the issue 馃槩
Have you tried this?
```@commands.Cog.listener()
async def on_message(self, message):
if message.author.bot:
return print('Bot, ignoring.')
if message.channel.type == discord.ChannelType.private:
print("Private DM")