#๐ hi guys, Help with Discord BOT token
22 messages ยท Page 1 of 1 (latest)
@lost rune
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.message_content = True # Enable message content intent if needed
intents.members = True # Enable guild members intent if needed
client = commands.Bot(command_prefix="!", intents=intents)
@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
@client.command
async def intro(ctx):
await ctx.send("Hello, this is ETD")
client.run('my token')
- @client.command
+ @client.command()
async def intro(ctx):
await ctx.send("Hello, this is ETD")
yes?
File "c:\Users\mnali\import discord.py", line 18, in <module>
client.run('my token')
File "C:\Users\mnali\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 860, in run
asyncio.run(runner())
File "C:\Users\mnali\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\mnali\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\mnali\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 849, in runner
await self.start(token, reconnect=reconnect)
File "C:\Users\mnali\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 778, in start
await self.connect(reconnect=reconnect)
File "C:\Users\mnali\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 704, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
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.
It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.