My discord bot that had i made using python which has 700+ lines of code is not responding to commands and only responding for the part where it sends a message if u mention it. it stopped working for some reason after not using it for a long time. After i came back to it and made some changes, like deleting my db(sql) code. I tried changing the settings on it and even making a new app and bot and it still isnt working. I dint send the code as i thought it was not necessary as it is 700+ lines and idk which parts are not working or causing this problem.
#Bot now working
1 messages · Page 1 of 1 (latest)
?tag message-content
As of Pycord Beta 5, Discord API v10 requires message content intent to receive message content. This affects the traditional commands. Not enabling this intent will result in the messages' content, embeds, and components being empty.
You will need to enable the intent on the developer portal, as well as in your code:
intents = discord.Intents.default()
intents.message_content = True
bot = discord.Bot(intents=intents)
Docs: https://docs.pycord.dev/en/master/api.html#discord.Intents.message_content
oh ill try this then
thx
hey but i hv already defined bot here tho
bot = commands.Bot(command_prefix="<", help_command=None)
yes, you just need to pass intents kwarg
like this
intents = discord.Intents.default()
intents.message_content = True
bot = discord.Bot(intents=intents)
bot = commands.Bot(command_prefix="<", help_command=None)
so it should be like this?
no
dont create instances of different bot classes. just pass intents to commands.Bot(...)
like commands.Bot(..., intents=intents)
oh ok
im now getting this error
File "e:\Progrmming\pycord\Slimey-bot\Slimey.py", line 964, in <module>
bot.run(conf["token"])
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
read the error
.close
Done with your help thread?
Please close your own help thread by using </close:1009144375709814897> with @wicked gulch.
actually nvm now when i send a message im getting this error
AttributeError: 'Bot' object has no attribute 'process_commands'
idk wut that means
what are you trying to do? full error? also show how you defined Bot
"C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 377, in _run_event
await coro(*args, **kwargs)
File "e:\Progrmming\pycord\Slimey-bot\Slimey.py", line 105, in on_message
await bot.process_commands(message)
AttributeError: 'Bot' object has no attribute 'process_commands'
intents = discord.Intents.default()
intents.message_content = True
bot = discord.Bot(command_prefix="<", help_command=None, intents=intents)
?tag client
discord.Client # just for events
discord.Bot # events + slash/user/msg commands
commands.Bot # above + prefixed commands
bridge.Bot # above + bridge commands (application commands and text commands in one)
wut?
you want the 3rd one
dint get it
yes yes i want the third one
yea
sry for the pain
ik im not the brightest
lol no worries
but thx guys
