#Bot now working

1 messages · Page 1 of 1 (latest)

plain willow
#

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.

coarse epoch
#

?tag message-content

glacial lagoonBOT
#

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

plain willow
#

oh ill try this then

#

thx

#

hey but i hv already defined bot here tho

#
bot = commands.Bot(command_prefix="<", help_command=None)
fallow schooner
plain willow
#
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?

fallow schooner
#

dont create instances of different bot classes. just pass intents to commands.Bot(...)

#

like commands.Bot(..., intents=intents)

plain willow
#

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.
coarse epoch
#

read the error

plain willow
#

dint get it

#

wait nvm

#

got it

#

thx guys for ur help!

fallow schooner
#

.close

simple patrolBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @wicked gulch.

plain willow
#

actually nvm now when i send a message im getting this error

AttributeError: 'Bot' object has no attribute 'process_commands'
#

idk wut that means

fallow schooner
#

what are you trying to do? full error? also show how you defined Bot

plain willow
#
"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)
fallow schooner
#

?tag client

glacial lagoonBOT
#
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)
plain willow
#

wut?

fallow schooner
#

you want the 3rd one

plain willow
#

dint get it

fallow schooner
#

change discord.Bot to commands.Bot

plain willow
#

yes yes i want the third one

fallow schooner
#

yea

plain willow
#

ok

#

ok

#

got it

#

OMG thx thx

plain willow
#

ik im not the brightest

fallow schooner
#

lol no worries

plain willow
#

but thx guys