#Bot only responds in dms

1 messages · Page 1 of 1 (latest)

slender phoenix
#

Hello! I made my code and the bot is able to work perfectly in dms, but in a server where they are added in with administrator perms, they do not respond. I am confident that I am sending the right command. Code is attached, please help!

ashen notch
#

This is the disnake server. You're using discord.py it seems. We don't support that library here.
In the future, you'll need to ask for help there: https://discord.gg/dpy

However, the issue is with your intents. You don't have message_content which is required for the bot to access message content in guild channels.

DMs and messages where the bot is tagged, this doesn't apply.

slender phoenix
#

oooh I see ok thanks for giving me the server link!

#

I see, tysm, I'll look into that!

ashen notch
#

I'd also recommend using the correct tools for the job. In this case, you want to use commands.Bot to create proper commands rather than all this manual work with on_message

slender phoenix
#

ah ok thanks!

#

yea that was my original method and then it didn't work so I redid all my code into client cause I thought that was the problem 😓

ashen notch
#

Right. For prefix commands like this, message_content intents are still required due to the nature of how these commands work. Internally, they're still on_message events and require access to the content, just the same.

#

but the lib does all the heavy lifting for you so you just focus on building the command rather than all the if statements to validate the content.

slender phoenix
#

oooh I see ok

#

AH! thank you so much, it works now!

ashen notch
#

Good luck and just make sure you're asking in the right server for the next issue. Unless you want to switch to disnake, which is recommended, but I'm also biased.