-2

I am using this Replit demo to create a Discord bot: https://replit.com/@amasad/Discordpy-Music-Bot

I followed the instructions, and my bot is capable of logging in and staying online. The only thing wrong is it won't respond to any of my commands, not even if I add a simple print function.

If it's not in the code, I could have missed something in the Discord bot's permissions, but it can read and write messages as an administrator. I even went into the specific permissions of the server and enabled read/write messages, join voice, etc. Any idea what's going wrong?

Caladan
  • 2,261
  • 2
  • 6
  • 19
sam
  • 1

1 Answers1

0

I have checked out the repl you just mentioned above. But without reading your code it's not possible for us to know what you are doing wrong, so when you are asking a question please include your source code. And checkout this to know how to ask a good question: https://stackoverflow.com/help/how-to-ask.

The problem you just mentioned above can occur because of intents, I may or may not be right but since I didn't read your code this is the only thing I can think of at the moment. To fix this what you have to do is, add intents in your client definition. For example:

from discord.ext import commands
import discord

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())

After this, go to discord developers portal at https://discord.com/developers/applications and open your bot application. Then from the left tab go to Bot and you will see a section called Privileged Gateway Intents and then turn on the intents. This should fix your problem.

Araf
  • 27
  • 4
  • It worked! I tried this and then troubleshot the rest of the errors that popped up after it started responding to me, and it now functions. Thank you. – sam Dec 23 '22 at 03:09
  • If it worked then mark my answer as correct – Araf Dec 23 '22 at 10:53