#discord-bots

1 messages · Page 259 of 1

buoyant crescent
#
import discord
from discord.ext import commands
import os

from apikeys import *


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

intents = discord.Intents.default()

intents.members = True
@bot.event
async def load():
    for filename in os.listdir("./cogs"):
        if filename.endswith(".py"):
            cog_name = filename[:-3]
            await bot.load_extension(f"cogs.{cog_name}")
            print(f'Extension: {cog_name} succesfully loaded')


initial_extensions = []







bot.run((BOTTOKEN))
#
import discord
from discord.ext import commands


class Greetings(commands.Cog):
    def __init__(self, bot):
        self.bot = bot


    @commands.command()
    async def aide(self, ctx):
        help = discord.Embed(title="Liste des commandes :", url=None, description=None, color=0x7434EB)
        help.set_author( name="Menu Help du bot", url=None, icon_url="https://cdn.discordapp.com/attachments/1122145321535930499/1122145393032040519/20230624_142400_0000.png")
        help.add_field(name="Musiques :", value="!join | !play | !stop | !resume | !pause | !music", inline=False)
        help.add_field(name="Modération :", value="!ban | !kick", inline=False)
        help.set_image(url="https://media.discordapp.net/attachments/1120608535672270939/1123258060983509124/pu.gif?width=747&height=312")
        help.set_footer(text="Demandé par : {}".format(ctx.author.display_name))
        await ctx.send(embed=help)


    @commands.command()
    async def music(self, ctx):
        await ctx.send("La liste des musiques : black_clover, black_rover, demon_slayer_3, night_dancer")


    @commands.Cog.listener()
    async def on_member_join(member):
        channel = bot.get_channel(1121386561150386276)
        join = discord.Embed(title="Bienvenue dans le serveur de la Neo Destiny ! ", url=None, description=f":tada: Bienvenue {member} :tada:", color=0x7434EB)
        join.set_image(url=member.avatar.url)
        join.set_footer(text=f"Nous sommes désormais : {member.guild.member_count}")
        await channel.send(embed=join)


   

def setup(client):
    client.add_cog(Greetings(client))```
buoyant quail
#

There is no load event
So your load function wasn't called at all.

twilit grotto
halcyon acorn
#

import discord
from discord import Client
from discord.ext import commands

bot = commands.Bot(command_prefix='-')



#ping command 
@bot.command()
async def ping(ctx):
    latency = round(bot.latency * 1000)  
    await ctx.send(f'Pong! Latency: {latency}ms')


print('hello world')

bot.run('token')``` 

The bot is not responding to commands.
twilit grotto
#

!intents

unkempt canyonBOT
#
Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.

There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.

Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True

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

For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.

halcyon acorn
#

raceback (most recent call last):
File "c:\Users\Mikey\OneDrive\Desktop\FreelanceFinderBot.py", line 8, in <module>
intents.message_content = True
AttributeError: 'Intents' object has no attribute 'message_content'

potent spear
halcyon acorn
#

how does one update it?

potent spear
#

the same way you installed it

#

it'll overwrite the "older" version

halcyon acorn
buoyant crescent
#

it still say me that my command is not found ```python
import discord
from discord.ext import commands
import os

from apikeys import *

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

intents = discord.Intents.default()

intents.members = True

@bot.event
async def on_ready():
await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
print("The bot is now ready")
print("--------------------")
async def load():

    for filename in os.listdir("./cogs"):
        if filename.endswith(".py"):
            cog_name = filename[:-3]
            await bot.load_extension(f"cogs.{cog_name}")
            print(f'Extension: {cog_name} succesfully loaded')

initial_extensions = []

bot.run((BOTTOKEN))

#
import discord
from discord.ext import commands


class Greetings(commands.Cog):
    def __init__(self, bot):
        self.bot = bot


    @commands.command()
    async def aide(self, ctx):
        help = discord.Embed(title="Liste des commandes :", url=None, description=None, color=0x7434EB)
        help.set_author( name="Menu Help du bot", url=None, icon_url="https://cdn.discordapp.com/attachments/1122145321535930499/1122145393032040519/20230624_142400_0000.png")
        help.add_field(name="Musiques :", value="!join | !play | !stop | !resume | !pause | !music", inline=False)
        help.add_field(name="Modération :", value="!ban | !kick", inline=False)
        help.set_image(url="https://media.discordapp.net/attachments/1120608535672270939/1123258060983509124/pu.gif?width=747&height=312")
        help.set_footer(text="Demandé par : {}".format(ctx.author.display_name))
        await ctx.send(embed=help)


    @commands.command()
    async def music(self, ctx):
        await ctx.send("La liste des musiques : black_clover, black_rover, demon_slayer_3, night_dancer")


    @commands.Cog.listener()
    async def on_member_join(member):
        channel = bot.get_channel(1121386561150386276)
        join = discord.Embed(title="Bienvenue dans le serveur de la Neo Destiny ! ", url=None, description=f":tada: Bienvenue {member} :tada:", color=0x7434EB)
        join.set_image(url=member.avatar.url)
        join.set_footer(text=f"Nous sommes désormais : {member.guild.member_count}")
        await channel.send(embed=join)


   
def setup(client):
    client.add_cog(Greetings(client))```
twilit grotto
buoyant crescent
twilit grotto
halcyon acorn
#

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'c:\python310\lib\site-packages\pip-22.0.4.dist-info\entry_points.txt'
Consider using the --user option or check the permissions.

twilit grotto
#

just so i can see the python version

halcyon acorn
#

I am very outdated, have not coded with discord py in ages. ~

3.10.4

twilit grotto
buoyant crescent
# twilit grotto move the function outside of the event, and run it in the event.

like this ? ```python
async def load():

    for filename in os.listdir("./cogs"):
        if filename.endswith(".py"):
            cog_name = filename[:-3]
            await bot.load_extension(f"cogs.{cog_name}")
            print(f'Extension: {cog_name} succesfully loaded')

@bot.event
async def on_ready():
await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
print("The bot is now ready")
print("--------------------")
load()

halcyon acorn
twilit grotto
#

and fix your indentation for your load function

buoyant crescent
#
async def load():
    for filename in os.listdir("./cogs"):
        if filename.endswith(".py"):
            cog_name = filename[:-3]
            await bot.load_extension(f"cogs.{cog_name}")
            print(f'Extension: {cog_name} succesfully loaded')


@bot.event
async def on_ready():
    await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
    print("The bot is now ready")
    print("--------------------")
    await load()

twilit grotto
#

indeed, perfect

twilit grotto
buoyant crescent
#
File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 947, in _load_from_module_spec
    await setup(self)
TypeError: object NoneType can't be used in 'await' expression

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "c:/Users/MYOUSSEF/Desktop/bot/main.py", line 28, in on_ready
    await load()
  File "c:/Users/MYOUSSEF/Desktop/bot/main.py", line 19, in load
    await bot.load_extension(f"cogs.{cog_name}")
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 1013, in load_extension        
    await self._load_from_module_spec(spec, name)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 952, in _load_from_module_spec 
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Greetings' raised an error: TypeError: object NoneType can't be used in 'await' expression```
halcyon acorn
#

my issue has been fixed

twilit grotto
#

show me your cog "greetings"

twilit grotto
#

in your cog*

buoyant crescent
#
Import discord
from discord.ext import commands


class Greetings(commands.Cog):
    def __init__(self, bot):
        self.bot = bot


    @commands.command()
    async def aide(self, ctx):
        help = discord.Embed(title="Liste des commandes :", url=None, description=None, color=0x7434EB)
        help.set_author( name="Menu Help du bot", url=None, icon_url="https://cdn.discordapp.com/attachments/1122145321535930499/1122145393032040519/20230624_142400_0000.png")
        help.add_field(name="Musiques :", value="!join | !play | !stop | !resume | !pause | !music", inline=False)
        help.add_field(name="Modération :", value="!ban | !kick", inline=False)
        help.set_image(url="https://media.discordapp.net/attachments/1120608535672270939/1123258060983509124/pu.gif?width=747&height=312")
        help.set_footer(text="Demandé par : {}".format(ctx.author.display_name))
        await ctx.send(embed=help)


    @commands.command()
    async def music(self, ctx):
        await ctx.send("La liste des musiques : black_clover, black_rover, demon_slayer_3, night_dancer")


    @commands.Cog.listener()
    async def on_member_join(member):
        channel = bot.get_channel(1121386561150386276)
        join = discord.Embed(title="Bienvenue dans le serveur de la Neo Destiny ! ", url=None, description=f":tada: Bienvenue {member} :tada:", color=0x7434EB)
        join.set_image(url=member.avatar.url)
        join.set_footer(text=f"Nous sommes désormais : {member.guild.member_count}")
        await channel.send(embed=join)

#

    @commands.Cog.listener()
    async def on_member_remove(member):
        channel = bot.get_channel(1121386771087904828)
        leave = discord.Embed(title="Un membre a quitté le serveur !", url=None, description=f"Oh non aurevoir {member} :wave:", color=0x7434EB)
        leave.set_image(url=member.avatar.url)
        leave.set_footer(text=f"Nous sommes désormais : ")
        await channel.send(embed=leave)

def setup(bot):
    bot.add_cog(Greetings(bot))```
twilit grotto
buoyant crescent
twilit grotto
twilit grotto
#
def setup(bot):
    bot.add_cog(Greetings(bot))
```this function of your cog, needs to be async.
buoyant crescent
#

oh ok

twilit grotto
#

ah wait the setup function doesn't need to be async i was wrong, sorry

buoyant crescent
buoyant crescent
#

but i still have a question

twilit grotto
buoyant crescent
twilit grotto
formal basin
#

Anyone know how to fix this

kindred plaza
#
[2023-06-27 22:35:46] [WARNING ] discord.ext.commands.bot: Privileged message content intent is missing, commands may not work as expected.
[2023-06-27 22:35:46] [INFO    ] discord.client: logging in using static token
[2023-06-27 22:35:47] [INFO    ] discord.gateway: Shard ID None has connected to Gateway (Session ID: 4fc3408fa438cb372ad247f8db170185).

can anyone help me fix this

formal basin
#

my bot spams t

unkempt canyonBOT
#
Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.

There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.

Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True

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

For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.

kindred plaza
#

do u know why

twilit grotto
proper thicket
twilit grotto
iron pulsar
hasty pike
proper thicket
# hasty pike It's better to prove error with source code so people can understand it better a...

Traceback (most recent call last):
File "/Users/hervans/Library/Python/3.8/lib/python/site-packages/discord/ext/commands/core.py", line 235, in wrapped
ret = await coro(*args, **kwargs)
File "/Users/hervans/Downloads/Hervy bot/cogs/Moderationcmds.py", line 67, in mute
await ctx.guild.mute(member)
AttributeError: 'Guild' object has no attribute 'mute'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/hervans/Library/Python/3.8/lib/python/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
await ctx.command.invoke(ctx)
File "/Users/hervans/Library/Python/3.8/lib/python/site-packages/discord/ext/commands/core.py", line 1029, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "/Users/hervans/Library/Python/3.8/lib/python/site-packages/discord/ext/commands/core.py", line 244, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Guild' object has no attribute 'mute'

hasty pike
#

' This isn't a code '

#

you can't run it

proper thicket
#

also could of said it nicer but guess not thats how people are these days.

hasty pike
#

Those doesn't work with guild

potent spear
#

this exact error has been fixed for you like an hour and a half ago...
no offense, but are you basically not reading?
#1123398244941176832 message

proper thicket
#

and i am not cause i know javascript

hasty pike
#

Then use djs

proper thicket
hasty pike
#

Learn python first

proper thicket
hasty pike
#

Jumping into dpy library

proper thicket
#

adding laugh emojis very funny hahaha not fuckin funny

hasty pike
#

Triggered

swift edge
#

The error is the (f at the start

hasty pike
potent spear
#

!f-string

unkempt canyonBOT
#
Format-strings

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

hasty pike
#

And also you didn't close print with )

wispy locust
hasty pike
#

@wispy locust ?

wispy locust
#

yes?

warped mauve
#

does anyone know how to fix this bug

#

i cant make urls to invite the bot

hasty pike
unkempt canyonBOT
#

10. Do not copy and paste answers from ChatGPT or similar AI tools.

wispy locust
#

WHY

#

@hasty pike WHY.

hasty pike
hasty pike
#

You better obey them

warped mauve
wispy locust
hasty pike
#

Choose bot in SCOPES
Then PERMISSIONS according to your preferences
@warped mauve

wispy locust
hasty pike
wispy locust
#

i just wana know

#

dont ban me

hasty pike
#

Here you can choose anything you want

#

And you'll get your url

warped mauve
#

that’s what i did

hasty pike
#

Make sure your bot is public

warped mauve
#

no luck

hasty pike
#

They don't generate links for private applications

warped mauve
#

it is public

hasty pike
#

One more way

wispy locust
hasty pike
warped mauve
#

i fixed it

hasty pike
#

Put your bot id at ??

wispy locust
hasty pike
warped mauve
#

requires outh2 code grant was on

#

idk what that is

#

but fun…

hasty pike
#

It requires 2 factor code whenever someone tries to add bot to server

#

If it's off i can add bot directly to server
If it's on it requires my 2fa code to add it to server

winter token
#
    async def mute(self, ctx, member: discord.Member, *, reason = None):
        guild = ctx.guild
        permissions = discord.Permissions(permissions = 0, read_message_history = True, view_channel = True, send_messages = False)
        if await guild.fetch_roles("Muted") == True:
            mute_role = await guild.fetch_roles("Muted")
        else:
            mute_role = await guild.create_role(name = "Muted", permissions = permissions)
        await member.add_roles(mute_role)
        await ctx.send("Muted the user!")
winter token
hasty pike
#

Why not fetch role using id

#

You can store id in database
guild id : mute role id

#

1 mute role per guild

#

More efficient

winter token
#

hm im just a beginner rn

hasty pike
#

Okay lemme look at documentation real quick

winter token
#

alr

#

@hasty pike fixed it. So fetch_roles returns a list of all the roles of the guild

#

thats why my code wasnt working

#

anyways thx

hasty pike
#

You can try ```py
"if is in"

warped mauve
#

does discord have areas where you can host discord bots ? (online 24/7)

swift edge
hasty pike
warped mauve
#

i see

hasty pike
#

Your issue

woven schooner
#

Anyone know how to fix this

hasty pike
swift edge
naive briar
#

And read the error

swift edge
#

oh yeah show the code

hasty pike
swift edge
#

ueah

#

yeah

hasty pike
#

from discord.ext import commands

woven schooner
#

I don’t wanna look stupid if it’s a dumb code

naive briar
#

There's no commands module in discord

winter token
hasty pike
winter token
hasty pike
woven schooner
#

Can u look at DMs

swift edge
#
import discord
from discord.ext import commands

bot = commands.Bot(command_prefix="/", help_command=None, discord.Intents.all())``` u can use this
winter token
#

I fixed the old error but im stuck in another mess xd

hasty pike
swift edge
#

wym

#

Eshaan is there anything wrong

naive briar
#

!e

def a(b, c):
    pass

a(c=0, 0)
unkempt canyonBOT
#

@naive briar :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 4
002 |     a(c=0, 0)
003 |             ^
004 | SyntaxError: positional argument follows keyword argument
woven schooner
#

U want me to use that?

swift edge
#

ye

winter token
swift edge
#
import discord
from discord.ext import commands

bot = commands.Bot(command_prefix="/", help_command=None, intents = discord.Intents.all())

async def on_ready():
print("logged in")``` u can use this
hasty pike
winter token
#
    async def mute(self, ctx, member: discord.Member, *, reason = None):
        guild = ctx.guild
        permissions = discord.Permissions(permissions = 0, read_message_history = True, view_channel = True, send_messages = False)
        guild_roles = await guild.fetch_roles()
        if "Muted" in guild_roles:
            mute_role = 'Muted'
        else:
            mute_role = await guild.create_role(name = "Muted", permissions = permissions)
        await member.add_roles(mute_role)
        await ctx.send(guild_roles)
``` i was trying to do this but the bot is creating new even tho there is already one
potent spear
#

guild_roles = await guild.fetch_roles() if "Muted" in guild_roles:
F

naive briar
woven schooner
#

I got all this stuff off the py cord website this what it said to do

naive briar
#

And you can't compare them with strings

winter token
woven schooner
#

It’s all probably messed up

naive briar
#

You leaked your token

woven schooner
#

Idc I’ll reset it

potent spear
naive briar
#

(and that's not how you should be using environment variables)

hasty pike
#

from discord.ext import commands - (line 2)
bot = commands.Bot() - (line 7)

swift edge
#

ph yeah

#

so dumb, i forgot about @bot.event

winter token
#

!d discord.Role

unkempt canyonBOT
#

class discord.Role```
Represents a Discord role in a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild")...
hasty pike
#

@woven schooner reset token and check usage of env variables

swift edge
#

guys

woven schooner
#

It’s not even a working bot

#

I just made it

#

I’ll make another.

swift edge
#

i put the bot token in a folder and i wonder how i can get stuff in the file thats in the folder

hasty pike
swift edge
#

ill show pic wait

hasty pike
#

No big deal

woven schooner
#

Idk which bot it was

#

I created like 20 doing this thing trying to get it to work

hasty pike
#

It'll show you bot's name

hasty pike
woven schooner
#

Ik I was getting new ones cause I thought it’s was the bot that was wrong

woven schooner
hasty pike
winter token
#

well this wont work?```py
discord.Role(name = "Muted")

woven schooner
#

Right there?

naive briar
hasty pike
hasty pike
swift edge
#

as you can see the token is in the folder, but i want to access whats inside that file so i can use it in the main file

winter token
hasty pike
#

@woven schooner run it and you'll get bot name in result then reset for that name

naive briar
swift edge
#

chillax Eshaan

winter token
woven schooner
#

I get this

swift edge
#

i havent learnt py basics but ive watched tutorials

naive briar
hasty pike
woven schooner
swift edge
naive briar
#

You can't import Python files if it has spaces in its name tho

hasty pike
#

@swift edge name it config.py
Make variable for token

from .config import variable

winter token
#

how do I access the role name from the list returned by fetch_roles, kinda confused

naive briar
#

You can just sort it by checking the role.name attr

woven schooner
naive briar
#

With list comprehension and similar things

hasty pike
hasty pike
#

Just use same where you need

swift edge
#

i have a TOKEN var in the bot_token file

naive briar
#

No, the bot_token is a module

#

You need to access the variable inside of it

swift edge
#

alright

potent spear
swift edge
#

did that
wait lemme try

potent spear
#

anyways, calling a file bot_token ain't really it
call it
bot_config.py

swift edge
#

(function) TOKEN : Any

potent spear
#

that way, config.BOT_TOKEN makes more sense

hasty pike
#

@swift edge lemme grab you ss from my bot you'll understand

winter token
naive briar
#

I just answered it, or you want to access the role's name?

naive briar
#

Then just role.name

winter token
sick birch
#

Why does no one use pydantic for loading bot settings 😔

sick birch
hasty pike
sick birch
#

It's pretty neat
Also underrated

sick birch
#

@unkempt canyon uses it as well

sick birch
#

It works but is not nice to work with IMO

woven schooner
hasty pike
hasty pike
#

Make sure you saved changes

woven schooner
#

Like u said

hasty pike
swift edge
#

ima just watch a tutorial

winter token
hasty pike
woven schooner
naive briar
#

It's an attribute of the discord.Role object

swift edge
naive briar
unkempt canyonBOT
naive briar
woven schooner
#

Wym

winter token
naive briar
hasty pike
woven schooner
#

It’s just pip install discord is it not

naive briar
#

No

hasty pike
woven schooner
#

Says I already have

hasty pike
#

Hmmmm

naive briar
#

You could have multiple libraries with the same module name

winter token
#
    @commands.command()
    async def mute(self, ctx, member: discord.Member, *, reason = None):
        guild = ctx.guild
        permissions = discord.Permissions(permissions = 0, read_message_history = True, view_channel = True, send_messages = False)
        guild_roles = await guild.fetch_roles()
        if discord.Role.name("Muted") in guild_roles:
            mute_role = discord.Role.name("Muted")
        else:
            mute_role = await guild.create_role(name = "Muted", permissions = permissions)
        await member.add_roles(mute_role)
        await ctx.send(guild_roles)```
woven schooner
#

What will it say

naive briar
#

It will tell what packages you have installed

woven schooner
#

It says I have a bunch of stuff that I don’t remember downloading

woven schooner
#

Is that bad

naive briar
woven schooner
#

Cause all I’m trynna do it just to get it online and I’ll be happy

naive briar
#

Can you show the screenshot of it

woven schooner
#

My camera quality is doodoo

#

Or it’s all scratched up

swift edge
#

I still cant get the variable in a file thats in a folder

naive briar
# woven schooner

You have both py-cord and discord.py, you should uninstall one of them

woven schooner
#

Which ones better

naive briar
#

(discord.py)

naive briar
hasty pike
woven schooner
#

Ok I deleted py cord

hasty pike
gritty cape
#

lowkey

hasty pike
gritty cape
#

just download the github repo and put it in the same folder

woven schooner
#

When I run it I still get the same thing can one of u send like the code to turn it online and see if that helps

winter token
swift edge
#

ima try rephrasing my problem

winter token
hasty pike
#
import discord
from discord.ext import commands

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

bot.run(TOKEN)
hasty pike
#

@swift edge

swift edge
#

in this ss, im trying to get a variable in a file thats in the token folder, the file name that im trying to get the var in is bot_config

The bots token is located in the bot_config file, im trying to put that token in the parentheses after bot.run at line 10.

hasty pike
#

from token.bot_config import TOKEN

woven schooner
#

It’s saying the same thing I thing something’s wrong

winter token
#

!d discord.utils.get

unkempt canyonBOT
#

discord.utils.get(iterable, /, **attrs)```
A helper that returns the first element in the iterable that meets all the traits passed in `attrs`. This is an alternative for [`find()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.utils.find "discord.utils.find").

When multiple attributes are specified, they are checked using logical AND, not logical OR. Meaning they have to meet every attribute passed in and not one of them.

To have a nested attribute search (i.e. search by `x.y`) then pass in `x__y` as the keyword argument.

If nothing is found that matches the attributes passed, then `None` is returned.

Changed in version 2.0: The `iterable` parameter is now positional-only.

Changed in version 2.0: The `iterable` parameter supports [asynchronous iterable](https://docs.python.org/3/glossary.html#term-asynchronous-iterable "(in Python v3.11)")s...
hasty pike
naive briar
#

If your code doesn't work, replit wouldn't magically make it work

hasty pike
winter token
woven schooner
#

The bot thing

woven schooner
naive briar
#

Are you sure it's the same thing?

woven schooner
#

Yes

hasty pike
#

Uninstall discord py

#

And install again

gritty cape
#

aint no way

hasty pike
#
import discord
from discord.ext import commands

client = commands.Client(command_prefix="!", intents=discord.Intents.all())

client.run(TOKEN)
naive briar
#

There's no commands.Client

hasty pike
naive briar
#

Where are you getting these things

woven schooner
#

I already have it up

warped mauve
#

so it says on my requiremnts.txt discord==2.3.1 and im running py3 couls that be the issue? why my import discord doesnt work?

hasty pike
#

My main bot use client

naive briar
warped mauve
naive briar
#

What

naive briar
#

There's only discord.Client

gritty cape
#

ask chatgpt

#

are you making a self bot

warped mauve
#

says i have it

hasty pike
warped mauve
#

but always get errors its not installed

vocal snow
#

Run py -3 -V

#

Make sure it's the same as the one you're using in your IDE

warped mauve
#

Python 3.11.4

#

was result

woven schooner
#

It’s goin right in the trash can

#

It’s saying the same stuff

sick birch
winter token
#

discord.utils.get() what attribute is used to search if a particular role from the mentioned user

hasty pike
#

It's no big deal

woven schooner
#

How do I run on this

#

Oh nvm

#

It’s a big green button

#

For some reason it always says this to like

#

And idk what that even is this is my first time using Python

woven schooner
#

Is says it on py too

naive briar
#

Just read the error

#

It just quite literally explained how to solve itself

woven schooner
#

But it says line 788

#

I don’t have that many lines

#

I have 6

naive briar
#

It's from discord.py's source code

sick birch
#

Always read errors bottom up

#

The stuff at the bottom of traceback is the most important and the most relevant to your code

woven schooner
sick birch
#

No because discordpy needs that to work

warped mauve
#

py3 -m pip install --upgrade discord.py==2.3.1
'py3' is not recognized as an internal or external command,
operable program or batch file.

#

my goal is to unistall discord and isntall the one for py 3.11

#

or whatver idk

#

brain hurty

woven schooner
#

Is there a way to completely reset all of my Python like it deletes everything

#

Files and all

woven schooner
vocal snow
woven schooner
#

Cause I always get errors from stuff I never did

#

Like line 788 I don’t have that many lines

vocal snow
warped mauve
vocal snow
#

you really need to learn to read your errors properly

woven schooner
#

I did that but it didn’t help

vocal snow
#

go enable the intents in dev portal

vocal snow
warped mauve
vocal snow
#

then which IDE?

warped mauve
#

im not

#

the IDLE?

wispy locust
vocal snow
#

it shows the full version when you open it

warped mauve
#

3.11.4 yes

#

im not getting the error when using IDLE im using a 3rd party thing for hosting but im getting that error so i assume its my PC

swift edge
#

Man this hard

vocal snow
vocal snow
wispy locust
#

just read the chatgpt share link

vocal snow
#

there is a lot of text there

#

what's the actual problem you are facing

wispy locust
#

the whole problem in in the the conversation between me and chat gpt

winter token
#

yo how to fetch all the roles of a particular user

vocal snow
unkempt canyonBOT
#

property roles```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.11)") of [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [‘@everyone](mailto:'%40everyone)’ role.

These roles are sorted by their position in the role hierarchy.
wispy locust
#

MMMMMMMMMMM

vocal snow
#

perhaps read your logs

swift edge
#

in this ss, im trying to get a variable in a file thats in the token folder, the file name that im trying to get the var in is bot_config

The bots token is located in the bot_config file, im trying to put that token in the parentheses after bot.run at line 10.

wispy locust
# swift edge in this ss, im trying to get a variable in a file thats in the token folder, the...

go to https://discord.com/developers/applications setelect ur application click bot then reset token then copy token then delete TOKEN replace it with the text that you copied from your application bot

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

wispy locust
vocal snow
wispy locust
#

wot

winter token
wispy locust
slate swan
#

You cannot read

#

intents.message**_content**

wispy locust
#

oh

wispy locust
winter token
#
@bot.event
async def on_message(message):
    if message.content == bot.user.mention:
        await message.channel.send(f"My prefix here is `{bot.command_prefix}`. Try `{bot.command_prefix}help` for more info!")
#

why does my bot stops responding when I runthe code with this event added

vocal snow
slate swan
wispy locust
slate swan
#

My guy

vocal snow
#

please go learn some python

slate swan
#

**intents.**messag__e_content__

slate swan
#

Sometimes people not even knowing the most basic Python is more than annoying

vocal snow
#

they don't even try

vocal snow
#

just putting random shit in their code

#

expecting it to work

wispy locust
slate swan
#
print(discord.Member.roles)

No print user roles ;(

slate swan
slate swan
#

No, learn Python yourself duh

#

I'd lose braincells teaching someone python

winter token
wispy locust
winter token
#

I learnt from yt

wispy locust
slate swan
wispy locust
#

it worked

slate swan
#

Surprising

#

fyi, client mods like you have can lead in your account getting terminated ThumbsUp

wispy locust
slate swan
#

And it's against the terms of services of Discord

wispy locust
#

its not illegal

wispy locust
slate swan
wispy locust
#

but almost 800k ppl use better discord

hasty pike
slate swan
#

Then almost 800k people have the possibility to get terminated

#

Lots of people doing something doesn't make it allowed out of nowhere

wispy locust
#

just like minecraft launchers

slate swan
#

Again, my point is that it's against ToS

wispy locust
#

downloading discord then going into files and changing rgb and and stuff is illegal?

slate swan
#

ToS are not laws

#

So no it's not illegal, you won't go to court for that

#

Doing such client modifications can get your account terminated though, yes.

wispy locust
buoyant crescent
#

hi i have an issue when the commands is sending two times ```python
import discord
from discord.ext import commands
import os

from apikeys import *

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

intents = discord.Intents.default()

intents.members = True

async def load():
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
cog_name = filename[:-3]
await bot.load_extension(f"cogs.{cog_name}")
print(f'Extension: {cog_name} succesfully loaded')

@bot.event
async def on_ready():
await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
print("The bot is now ready")
print("--------------------")
await load()

initial_extensions = []

bot.run((BOTTOKEN))

potent spear
#

exit them both

buoyant crescent
potent spear
winter token
#

nvm

buoyant crescent
#

k

buoyant crescent
potent spear
winter token
#

quick question: how to host the bot

potent spear
buoyant crescent
#

in one of my cogs

#
import discord
from discord.ext import commands


class Greetings(commands.Cog):
    def __init__(self, bot):
        self.bot = bot


    @commands.command()
    async def aide(self, ctx):
        help = discord.Embed(title="Liste des commandes :", url=None, description=None, color=0x7434EB)
        help.set_author( name="Menu Help du bot", url=None, icon_url="https://cdn.discordapp.com/attachments/1122145321535930499/1122145393032040519/20230624_142400_0000.png")
        help.add_field(name="Musiques :", value="!join | !play | !stop | !resume | !pause | !music", inline=False)
        help.add_field(name="Modération :", value="!ban | !kick", inline=False)
        help.set_image(url="https://media.discordapp.net/attachments/1120608535672270939/1123258060983509124/pu.gif?width=747&height=312")
        help.set_footer(text="Demandé par : {}".format(ctx.author.display_name))
        await ctx.send(embed=help)


    @commands.command()
    async def music(self, ctx):
        await ctx.send("La liste des musiques : black_clover, black_rover, demon_slayer_3, night_dancer")


    @commands.Cog.listener()
    async def on_member_join(self, member):
        channel = self.bot.get_channel(1121386561150386276)
        join = discord.Embed(title="Bienvenue dans le serveur de la Neo Destiny ! ", url=None, description=f":tada: Bienvenue {member} :tada:", color=0x7434EB)
        join.set_image(url=member.avatar.url)
        join.set_footer(text=f"Nous sommes désormais : {member.guild.member_count}")
        await channel.send(embed=join)


  
async def setup(bot):
    await bot.add_cog(Greetings(bot))```
potent spear
#

(and they somehow stop running both once you stop one)

hasty pike
wispy locust
potent spear
# buoyant crescent hi i have an issue when the commands is sending two times ```python import disco...

btw, a bot constructor has an activity, status kwarg please use those instead of change_presence in the on_ready event
await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
=>
bot = commands.Bot(..., status = ...., activity = ...)
also, please use a setup_hook to load your cogs
as on_ready isn't the place to do so

hasty pike
#

It's your choice if you don't follow rules you'll face consequences for

buoyant crescent
potent spear
potent spear
buoyant crescent
#

oh ok

buoyant crescent
potent spear
#

but does it now?

#

add a test command and rerun your bot, check if that responds twice too

buoyant crescent
buoyant crescent
buoyant crescent
potent spear
#

load your cogs in a setup hook

winter token
hasty pike
winter token
potent spear
#

that's good...

winter token
#

bruhhh

hasty pike
winter token
#

I am asking man

#

are they paid

slate swan
potent spear
slate swan
#

but not much like $5-10 a month

hasty pike
slate swan
#

to accept file as arg do you just typhint discord.File?

potent spear
slate swan
#

.Attachment iirc ( atleast for slash cmds)

potent spear
#

yeah, might be that instead

buoyant crescent
potent spear
buoyant crescent
potent spear
#

mind the # after using setup_hook in the second codeblock

#

you can choose any of those methods in the docs to load your cogs
just don't do it in on_ready

hasty pike
buoyant crescent
potent spear
hasty pike
#

@buoyant crescent on_ready executes when your bot is logged and online

But you need to load cogs before logging into a bot so setup_hook is for that purpose

potent spear
#

so instead of bot = commands.Bot(...)
you'll be using that

class MyBot(commands.Bot):
  ... setup_hook(...):
    # burp
    # don't just copy, THINK too
    await load()

bot = MyBot(...)
#

the main issue with on_ready is it having a probability of being called multiple times
hence it not being suitable for "startup tasks"

#

so I was thinking his cogs might be loaded in twice, but I'm not sure if that's even possible, as I would prevent cogs with the same name to be only loaded in once...

hasty pike
potent spear
potent spear
#

that's why I don't want him to copy

hasty pike
slate swan
#

The ... are probably more weird when self is one character longer

potent spear
#

I did before that existed

hasty pike
#

Krypton is good entertainer here

tidal folio
#

Anyone can send me prefix command

#

Bruh

winter token
slate swan
#
@bot.command()
async def prefix(c):
    await c.send("Prefix command1!!1!1!1")
slate swan
#

We don't spoon feed you, learn.

dense barn
#

Is it possible to make lorem ipsum be indented too below the symbol?

tidal folio
naive briar
#

!e

print("😳\nMeow")
unkempt canyonBOT
#

@naive briar :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 😳
002 | Meow
slate swan
# tidal folio

!intents you need to provide an intent value to your Client/Bot init

unkempt canyonBOT
#
Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.

There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.

Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True

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

For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.

dense barn
#

But that's gonna make a weird formatting issue when the embed is seen from a phone, right? Like you'd have to calculate where exactly you should put a new line. Plus you'd have to put the indentation too after a new line.

slate swan
naive briar
dense barn
#

Okay, I suppose I'll just use a code block instead to separate them. thanks

naive briar
#

Ohhhhh, right

warped mauve
#

IndentationError: expected an indented block after function definition on line 57

line 57: async def commands(ctx):

#

how to fix am noob lol

slate swan
#

Indent correctly

warped mauve
#

idk how lol

#

im not good at this

slate swan
#

!indent

unkempt canyonBOT
#
Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

slate swan
#

Among the first things you learn when using Python, if you'd actually learn it

slate swan
#

skull

#
commands. Bot (...)

these whitespaces kek

buoyant quail
slate swan
ivory crypt
#

May I ask that is it possible to distribute slash commands codes to different files?

buoyant quail
#

Sure. Check out cogs.
Or if you want, you can do anything by yourself with add_command

hasty pike
#

commands.Bot inside () ??

pallid path
buoyant quail
ivory crypt
hasty pike
hasty pike
hasty pike
buoyant quail
buoyant quail
hasty pike
hasty pike
buoyant quail
#

It's not very much time to open them

slate swan
#

It's just "discordpy cogs" on google, click the link, ctrlc ctrlv

hasty pike
#

Is there a way to do that?

woven schooner
hasty pike
woven schooner
#

Yea is that the one I need for discord bots?

hasty pike
#

Yep

woven schooner
#

Ok

buoyant crescent
buoyant crescent
#

it says main

hasty pike
#

main what

slate swan
buoyant crescent
# hasty pike main what

# before
bot.load_extension('my_extension')

# after using setup_hook
class MyBot(commands.Bot):
    async def setup_hook(self):
        await self.load_extension('my_extension')

# after using async_with
async def main():
    async with bot:
        await bot.load_extension('my_extension')
        await bot.start(TOKEN)

asyncio.run(main())```
woven schooner
#

How do u install pip again

hasty pike
woven schooner
#

Like when I download Python

buoyant crescent
woven schooner
#

How do I get pip

slate swan
#

There is a check box

#

I belive

woven schooner
#

Yea

#

But here one sec

#

I’m downloading py rn

buoyant crescent
hasty pike
#
# before
bot.load_extension('my_extension')

# after using setup_hook
class MyBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(command_prefix="!", intents=discord.Intents.all())

    async def setup_hook(self):
        await self.load_extension('my_extension')

bot = MyBot()

# after using async_with
async def main():
    async with bot:
        await bot.load_extension('my_extension')
        await bot.start(TOKEN)

asyncio.run(main()) 
slate swan
slate swan
slate swan
#

Bad habit

hasty pike
slate swan
#

No not at all

#

Opposite

#

And it'll be hard to use a bot variable before defining it

woven schooner
#

What does this mean cause I downloaded it but it’s saying I don’t have it

slate swan
#

Installing python/pip is unrelated to this channel either way

woven schooner
slate swan
#

Doesn't matter

woven schooner
#

I was just askin him cause we was talking about it up there

slate swan
#

!rule 7

unkempt canyonBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

slate swan
#

Rules are rules, follow them

woven schooner
#

Ain’t gotta be a dick chill

slate swan
#

How am i

hasty pike
slate swan
#

No need to randomly insult for telling you to follow the rules

hasty pike
woven schooner
slate swan
#

Any issues with doing that?

keen niche
#

how do i detect when a forum has been created?

winter token
#

how do i limit a command to only me

#

like if other try to invoke it, the bot should send some error msg

slate swan
unkempt canyonBOT
#

discord.on_guild_channel_delete(channel)``````py

discord.on_guild_channel_create(channel)```
Called whenever a guild channel is deleted or created.

Note that you can get the guild from [`guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.GuildChannel.guild "discord.abc.GuildChannel.guild").

This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
keen niche
#

yes but how do i make it detect a forum?

#

im trying to make smthn that auto speaks into a forum when it is made

slate swan
#

The channel will be of type discord.ForumChannel

keen niche
#

oh so discord.on_guild_channel_create(channel) would be replaced with discord.on_guild_channel_create(discord.ForumChannel)?

slate swan
#

No.

#

channel will be of type discord.ForumChannel.

#

!d isinstance

unkempt canyonBOT
#

isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised. [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") may not be raised for an invalid type if an earlier check succeeds.

Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
keen niche
slate swan
#

Google is your friend sometimes you know

#

Instead of checking if 5 is an integer, you check if channel is a discord.ForumChannel

keen niche
#

discord.on_guild_channel_create(channel, discord.ForumChannel)?

slate swan
#

My guy

#

Do you really need to be spoon-fed

keen niche
#

yes

slate swan
#

No.

keen niche
#

im confused

slate swan
#

Have you ever created an event

winter token
#
@commands.command()
    async def test(self, ctx, member: discord.Member):
            guild = ctx.guild
            guild_roles = await guild.fetch_roles()
            admin = discord.utils.get(guild_roles, name = "・Admin Bot")
            await member.add_roles(admin) 
#

Error occured: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

keen niche
slate swan
#

Right so you don't know what you're even doing

#

That is an event

vocal snow
slate swan
#

You do not change how an event looks like, you use it

#

If the event is discord.on_guild_channel_create(channel) you don't add stuff, you use it as it is

#

So

@bot.event
async def on_guild_channel_create(channel)
slate swan
#

Admin doesn't bypass everything

keen niche
winter token
slate swan
#

Then I told you to use the isinstance() function, and not to add discord.ForumChannel to the arguments list

vocal snow
# winter token it has admin

Is the top role of the member higher than or equal to the top role of the bot? Is the member the server owner?

slate swan
keen niche
#

if isinstance(channel, discord.ForumChannel):

slate swan
keen niche
#

right thanks

#

did someone here ghost ping me coz i got a ping from this channel

hasty pike
#

If author executes help command and deletes command message then i want bot to delete response help message too?? Is there a way to do this

winter token
#

if that would help u, then im glad to help

hasty pike
buoyant crescent
slate swan
#

!d nextcord.ext.commands.Bot.reload_extension

unkempt canyonBOT
#

reload_extension(name, *, package=None)```
Atomically reloads an extension.

This replaces the extension with the same extension, only refreshed. This is equivalent to a [`unload_extension()`](https://nextcord.readthedocs.io/en/latest/ext/commands/api.html#nextcord.ext.commands.Bot.unload_extension "nextcord.ext.commands.Bot.unload_extension") followed by a [`load_extension()`](https://nextcord.readthedocs.io/en/latest/ext/commands/api.html#nextcord.ext.commands.Bot.load_extension "nextcord.ext.commands.Bot.load_extension") except done in an atomic way. That is, if an operation fails mid-reload then the bot will roll-back to the prior working state.
buoyant crescent
# hasty pike You do

i'm a bit confuse, in my actual code what do i need to keep /delete ```python
import discord
from discord.ext import commands
import os

from apikeys import *

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

class MyBot(commands.Bot):
async def setup_hook(self):
await load()
bot = MyBot()

intents = discord.Intents.default()

intents.members = True

async def load():
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
cog_name = filename[:-3]
await bot.load_extension(f"cogs.{cog_name}")
print(f'Extension: {cog_name} succesfully loaded')

@bot.event
async def on_ready():
await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
print("The bot is now ready")
print("--------------------")
await load()

@bot.command()
async def test(ctx):
await ctx.send("This is a text command")

initial_extensions = []

bot.run((BOTTOKEN))

naive briar
slate swan
#

why run load function twice

buoyant crescent
buoyant crescent
slate swan
#

because you made it to

slate swan
#

you are loading cogs in setup hook and on_ready event

naive briar
hasty pike
buoyant crescent
naive briar
#

What bug

hasty pike
#

This code is giving me PTSD

buoyant crescent
slate swan
buoyant crescent
buoyant crescent
hasty pike
#

You're messing things up yourself

buoyant crescent
hasty pike
#

And where is constructor?

buoyant crescent
slate swan
#

why you create intents when you dont use them

hasty pike
hasty pike
naive briar
#

How is that bullying

hasty pike
#

Intents are mandatory we know that Trap_savagepikalol

slate swan
buoyant crescent
hasty pike
slate swan
hasty pike
#

To load extensions

hasty pike
buoyant crescent
hasty pike
slate swan
#

since when did the super() init call occur

hasty pike
#

Both will work same way for you

hasty pike
#

Wdym

hasty pike
#

That's what i said

buoyant crescent
#

so is it ok now ```python
import discord
from discord.ext import commands
import os

from apikeys import *

class MyBot(commands.Bot):
def init(self):
super().init(command_prefix= '!',intents=discord.Intents.all())

async def setup_hook(self):
    await self.load_extension('my_extension')

bot = MyBot()

intents = discord.Intents.default()

intents.members = True

async def load():
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
cog_name = filename[:-3]
await bot.load_extension(f"cogs.{cog_name}")
print(f'Extension: {cog_name} succesfully loaded')

@bot.event
async def on_ready():
await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
print("The bot is now ready")
print("--------------------")

@bot.command()
async def test(ctx):
await ctx.send("This is a text command")

initial_extensions = []

bot.run((BOTTOKEN))

hasty pike
#

He got all the help needed but still we didn't see any changes

buoyant crescent
#
File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 935, in _load_from_module_spec
    spec.loader.exec_module(lib)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\Users\MYOUSSEF\Desktop\bot\cogs\Music.py", line 13, in <module>
    class Music(commands.Cog):
  File "c:\Users\MYOUSSEF\Desktop\bot\cogs\Music.py", line 71, in Music
    async def test(ctx):
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 1793, in decorator
    return cls(func, name=name, **attrs)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 406, in __init__
    self.callback = func
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 513, in callback
    self.params: Dict[str, Parameter] = get_signature_parameters(function, globalns)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 130, in get_signature_parameters
    raise TypeError(f'Command signature requires at least {required_params - 1} parameter(s)')
TypeError: Command signature requires at least 1 parameter(s)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:/Users/MYOUSSEF/Desktop/bot/main.py", line 55, in <module>
    bot.run((BOTTOKEN))
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 860, in run
    asyncio.run(runner())
  File "C:\Program Files (x86)\Python38-32\lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "C:\Program Files (x86)\Python38-32\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
#
 File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 849, in runner
    await self.start(token, reconnect=reconnect)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 777, in start
    await self.login(token)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 621, in login
    await self.setup_hook()
  File "c:/Users/MYOUSSEF/Desktop/bot/main.py", line 16, in setup_hook
    await load()
  File "c:/Users/MYOUSSEF/Desktop/bot/main.py", line 30, in load
    await bot.load_extension(f"cogs.{cog_name}")
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 1013, in load_extension        
    await self._load_from_module_spec(spec, name)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 938, in _load_from_module_spec 
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Music' raised an error: TypeError: Command signature requires at least 1 parameter(s)
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x03199C88>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python38-32\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Program Files (x86)\Python38-32\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Program Files (x86)\Python38-32\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Program Files (x86)\Python38-32\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed```
#

i got an error

slate swan
#

if you create commands inside Cog

#

you need self param

buoyant crescent
slate swan
#

and then ctx

buoyant crescent
slate swan
#

error says otherwise

winter token
#

whats the attribute for lock/unlock channel

buoyant crescent
#

exept the test command ;-;

slate swan
#
  File "c:\Users\MYOUSSEF\Desktop\bot\cogs\Music.py", line 13, in <module>
    class Music(commands.Cog):
  File "c:\Users\MYOUSSEF\Desktop\bot\cogs\Music.py", line 71, in Music
    async def test(ctx):```
buoyant crescent
#

IT STILL RUN TWICE ;-;

winter token
slate swan
#

what run twice

buoyant crescent
slate swan
#

show code

winter token
buoyant crescent
#
import discord
from discord.ext import commands
from discord.ext.commands import MissingPermissions
from discord.ext.commands import has_permissions
from discord import Member

class Moderation(commands.Cog):
    def __init__(self, bot):
        self.bot = bot


    @commands.Cog.listener()
    async def on_message(self, message):
    

        ban_words = ["ntm", "nike ta mère", "fdp","fils de pute","tg","ftg","Tg","Ftg","Fdp","Ntm","drakyne est gentil"]
        for i in ban_words :
            if message.content == i:
                await message.delete()
                await message.channel.send(":x: Tu n'as pas le droit de dire ce mot !")
        await self.bot.process_commands(message)



    @commands.command()
    @has_permissions(kick_members=True)
    async def kick(self, ctx, member: discord.Member, *, reason=None):
        await member.kick(reason=reason)
        await ctx.send(f'{member} a été kick')

    @kick.error
    async def kick_error(self, ctx, error):
        if isinstance(error, commands.MissingPermissions):
            await ctx.send(":x: Tu n'as pas la permission de kick les membres")


    @commands.command()
    @has_permissions(ban_members=True)
    async def ban(self, ctx, member: discord.Member, *, reason=None):
        await member.ban(reason=reason)
        await ctx.send(f'{member} a été ban')

    @ban.error
    async def ban_error(self, ctx, error):
        if isinstance(error, commands.MissingPermissions):
            await ctx.send(":x: Tu n'as pas la permission de ban les membres")

async def setup(bot):
    await bot.add_cog(Moderation(bot))```
winter token
#

happened to me as well few days ago

buoyant crescent
winter token
#

just restart vsc

slate swan
buoyant crescent
slate swan
buoyant crescent
#
import discord
from discord.ext import commands
import os

from apikeys import *





class MyBot(commands.Bot):
    def __init__(self):
        super().__init__(command_prefix= '!',intents=discord.Intents.all())

    async def setup_hook(self):
        await load()

bot = MyBot()
    

intents = discord.Intents.default()

intents.members = True


async def load():
    for filename in os.listdir("./cogs"):
        if filename.endswith(".py"):
            cog_name = filename[:-3]
            await bot.load_extension(f"cogs.{cog_name}")
            print(f'Extension: {cog_name} succesfully loaded')


@bot.event
async def on_ready():
    await bot.change_presence(status=discord.Status.do_not_disturb, activity=discord.Streaming(name="Pokemon Unite", url="https://www.twitch.tv/mysterymom__"))
    print("The bot is now ready")
    print("--------------------")
    


@bot.command()
async def test(ctx):
    await ctx.send("This is a text command")


initial_extensions = []







bot.run((BOTTOKEN))
slate swan
#

print(f'Extension: {cog_name} succesfully loaded') does this print once per extension?

buoyant crescent
#
Extension: Greetings succesfully loaded
Extension: Moderation succesfully loaded
Extension: Music succesfully loaded     
2023-06-28 12:21:59 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: 03db445d78a549032dbacde950a586ad).
The bot is now ready
--------------------
slate swan
#

then maybe you have two bots running at once

#

try killing the terminal

buoyant crescent
winter token
buoyant crescent
#

ok

winter token
#

!d eval

unkempt canyonBOT
#

eval(expression, globals=None, locals=None)```
The arguments are a string and optional globals and locals. If provided, *globals* must be a dictionary. If provided, *locals* can be any mapping object.
cloud rover
#

I just want to create an app command with parameters that I can use to do other things in my function but I can't figure out how 💩 .

    @client.tree.command(name="embed", description="embed a message")
    @app_commands.describe(option="message to embed")
    async def embed(interaction: discord.Interaction):
        ```
#

this is what I have started with

#

with the help of docs and stack overflow

slate swan
#

you just add it as param to the function

cloud rover
#

oh okay

#

so I don't need the .describe option?

slate swan
#

the app_commands.describe is for giving them description

#

you will see in discord how it looks

cloud rover
#

ohhh okay ty

#

@slate swan tysm, the bot now has the parameters in the command but I am facing an issue with sending embeds. The text provided is what the bot says after I do the embed command which I will provide the code for below.

    @client.tree.command(name="embed", description="embed a message")
    async def embed(interaction: discord.Interaction, embed_title: str, embed_description: str):
        embed_message = discord.Embed(title=embed_title, description=embed_description)
        await interaction.response.send_message(embed_message)
spice dirge
#

embed = embed_message

#

in send_response

cloud rover
spice dirge
#

it's a guess, check the docs

cloud rover
#

yeah im reading through the embed part rn

#

@spice dirge ur solution was right, didn't see anything meaningful in the docs but the bot can succesfuly embed stuff now

#

🙏

slate swan
#

!d discord.InteractionResponse.send_message

unkempt canyonBOT
#

await send_message(content=None, *, embed=..., embeds=..., file=..., files=..., view=..., tts=False, ephemeral=False, allowed_mentions=..., suppress_embeds=False, silent=False, delete_after=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by sending a message.
slate swan
#

embed=...

#

I guess that's not meaningful enough kek

cloud rover
#

I'm sorry

slate swan
#

!d discord.InteractionResponse.edit_message

unkempt canyonBOT
#

await edit_message(*, content=..., embed=..., embeds=..., attachments=..., view=..., allowed_mentions=..., delete_after=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by editing the original message of a component or modal interaction.
slate swan
#

all arguments are keyword only

#

@hasty pike

hasty pike
#

Thanks

#

Can i use interaction.followup with edit_message too?

slate swan
#

!d discord.Webhook

unkempt canyonBOT
#

class discord.Webhook```
Represents an asynchronous Discord webhook.

Webhooks are a form to send messages to channels in Discord without a bot user or authentication.

There are two main ways to use Webhooks. The first is through the ones received by the library such as [`Guild.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.webhooks "discord.Guild.webhooks"), [`TextChannel.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.webhooks "discord.TextChannel.webhooks"), [`VoiceChannel.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.VoiceChannel.webhooks "discord.VoiceChannel.webhooks") and [`ForumChannel.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.ForumChannel.webhooks "discord.ForumChannel.webhooks"). The ones received by the library will automatically be bound using the library’s internal HTTP session.

The second form involves creating a webhook object manually using the [`from_url()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Webhook.from_url "discord.Webhook.from_url") or [`partial()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Webhook.partial "discord.Webhook.partial") classmethods.

For example, creating a webhook from a URL and using [aiohttp](https://docs.aiohttp.org/en/stable/index.html "(in aiohttp v3.8)"):
slate swan
#

you can see what methods it has

hasty pike
#

Can i edit button response message twice in class?

slate swan
#

Why not

hasty pike
#
    @nextcord.ui.button(label="Press me!", style=nextcord.ButtonStyle.red)
    async def sayhi(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        await interaction.response.edit_message(embed=discord.Embed(description='Updating...'), view=None)

        await asyncio.sleep(1)

        await interaction.followup.edit_message(embed=self.embed, view=self)
slate swan
#

Save the message and .edit it twice

hasty pike
#

This is what I tried

hasty pike
#

I don't think it will work, will it?

slate swan
#

Why it wont

#

Try and see i cant check that atm

hasty pike
#

So you're saying

#

Try

msg = message
interaction.response.edit_msg()

#

Is this how you mean? @slate swan

slate swan
#

Something about that yeah

hasty pike
#

Lemme try

sharp whale
#

@hasty pike i need your help lol

#
import discord
from discord.ext import commands


intents = discord.Intents.default()
intents.typing = False
intents.presences = False
bot = commands.Bot(command_prefix="!", intents=intents)


# COMMANDS
@bot.command(name="test", description="test command")
async def test(ctx):
  await ctx.send("testing")



#START UP
@bot.event
async def on_ready():
  print(f"bot is ready and logged on: {bot.user.name}")


from config import TOKEN
bot.run(TOKEN)```
#

the bot isn't responding

#

to !test command

hasty pike
#

You're good to go

sharp whale
#

:o

sharp whale
hasty pike
#

Remove rest 2 intents

sharp whale
#

okay

hasty pike
#

@sharp whale command below on_ready

unkempt canyonBOT
#
Discord Message Content Intent

The Discord gateway only dispatches events you subscribe to, which you can configure by using "intents."

The message content intent is what determines if an app will receive the actual content of newly created messages. Without this intent, discord.py won't be able to detect prefix commands, so prefix commands won't respond.

Privileged intents, such as message content, have to be explicitly enabled from the Discord Developer Portal in addition to being enabled in the code:

intents = discord.Intents.default() # create a default Intents instance
intents.message_content = True # enable message content intents

bot = commands.Bot(command_prefix="!", intents=intents) # actually pass it into the constructor

For more information on intents, see /tag intents. If prefix commands are still not working, see /tag on-message-event.

buoyant quail
sharp whale
#

ok it works

#

ty

sharp whale
#
Traceback (most recent call last):
  File "/home/runner/papernodes-suggestion-bot/venv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 178, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 17, in test
    view.add_item(button1)
TypeError: 'module' object is not callable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/papernodes-suggestion-bot/venv/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 347, in invoke
    await ctx.command.invoke(ctx)
  File "/home/runner/papernodes-suggestion-bot/venv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 950, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/runner/papernodes-suggestion-bot/venv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 187, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'module' object is not callable```
#

when i tried the button tutorial video you sent:

#

@hasty pike

hasty pike
sharp whale
#

yeah sorry

#
import discord
from discord.ext import commands


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

@bot.event
async def on_ready():
  print(f"bot is ready and logged on: {bot.user.name}")
  
# COMMANDS
@bot.command(name="test", description="test command")
async def test(ctx):
  button1= discord.ui.Button(label="Click me", style=discord.ButtonStyle.primary, emoji="⭐")
  view = discord.ui.view()
  view.add_item(button1)
  await ctx.send("testing", view=view)



#START UP



from config import TOKEN
bot.run(TOKEN)```
fringe lake
#

!d

unkempt canyonBOT
odd jasper
#

Hey, how can i change my discord token? Someone have it and he is griefing

hasty pike
#

Double check for capitals

odd jasper
#

Hey, how can i change my discord token? Someone have it and he is griefing

fringe lake
#

how to edit a message

odd jasper
odd jasper
hasty pike
turbid condor
fringe lake
fringe lake
#

i mean a meesage

hasty pike
sharp whale
#

ty

fringe lake
turbid condor
#

Yup

fringe lake
#

thanks again guys

hasty pike
naive briar
#

There obviously should have something

slate swan
#

!d nextcord.ext.tasks.loop

unkempt canyonBOT
#

nextcord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://nextcord.readthedocs.io/en/latest/ext/tasks/index.html#nextcord.ext.tasks.Loop "nextcord.ext.tasks.Loop").
fringe lake
#

does a view class has a message or message id attr ?

naive briar
#

No

slate swan
#

!d discord.ui.View Why dont you check it yourself

unkempt canyonBOT
#

class discord.ui.View(*, timeout=180.0)```
Represents a UI view.

This object must be inherited to create a UI within Discord.

New in version 2.0.
fringe lake
#

thx

sonic vapor
#

i run the bot it shows no problem but bot is not replying when I give him command

#

!resource

buoyant quail
#

Is message content enabled? Do you have on_message event? Show your code

sonic vapor
#
from discord.ext import commands

intents = discord.Intents.default()
intents.typing = False
intents.presences = False

# Create a new bot instance
bot = commands.Bot(command_prefix='!', intents=intents)

# Event handler for bot startup
@bot.event
async def on_ready():
    print(f'Logged in as {bot.user.name}')

# Simple command example
@bot.command()
async def hello(ctx):
    await ctx.send('Hello, world!')
  # Command example: Ping
@bot.command()
async def ping(ctx):
    await ctx.send('Pong!')


# Run the bot
bot.run(i wrote this')```
cloud dawn
#

Message content is not enabled by default.

sonic vapor
#

means?

unkempt canyonBOT
#
Discord Message Content Intent

The Discord gateway only dispatches events you subscribe to, which you can configure by using "intents."

The message content intent is what determines if an app will receive the actual content of newly created messages. Without this intent, discord.py won't be able to detect prefix commands, so prefix commands won't respond.

Privileged intents, such as message content, have to be explicitly enabled from the Discord Developer Portal in addition to being enabled in the code:

intents = discord.Intents.default() # create a default Intents instance
intents.message_content = True # enable message content intents

bot = commands.Bot(command_prefix="!", intents=intents) # actually pass it into the constructor

For more information on intents, see /tag intents. If prefix commands are still not working, see /tag on-message-event.

cloud dawn
#

Meaning this won't run.

sonic vapor
cloud dawn
#

Vitness provided the answer, read the embed and you should be able to get it running.

sonic vapor
#

i will try

#

which code to remove?

buoyant quail
#

You don't need to remove something.

cloud dawn
#

Look at the code, it's very similar to yours.

sonic vapor
#

giving error

#
  File "main.py", line 33, in <module>
    bot.run('
')
  File "/home/runner/cc-1/venv/lib/python3.10/site-packages/discord/client.py", line 860, in run
    asyncio.run(runner())
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/runner/cc-1/venv/lib/python3.10/site-packages/discord/client.py", line 849, in runner
    await self.start(token, reconnect=reconnect)
  File "/home/runner/cc-1/venv/lib/python3.10/site-packages/discord/client.py", line 778, in start
    await self.connect(reconnect=reconnect)
  File "/home/runner/cc-1/venv/lib/python3.10/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.
 ```
cloud dawn
#

The error underneath also explicitly tells you to do something.

slate swan
sonic vapor
vocal snow
slate swan
#

what is so hard to understand in that error message

cloud dawn
slate swan
#

google translate: Ok

sonic vapor
#

i can"t

#

understand

cloud dawn
#

What don't you understand?

sonic vapor
#

😭

sonic vapor
#

part

slate swan
#

what is your native language?

cloud dawn
sonic vapor
cloud dawn
#

You can use google translate yeah.

vocal snow
sonic vapor
slate swan
#

if you dont understand english

sonic vapor
slate swan
#

the error message ?

cloud dawn
#
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.
slate swan
#

yes this

sonic vapor
#

bruh

#
  फ़ाइल "main.py", पंक्ति 33, <मॉड्यूल> में
    bot.run('
')
  फ़ाइल "/home/runner/cc-1/venv/lib/python3.10/site-packages/discord/client.py", लाइन 860, रन में
    asyncio.run(धावक())
  फ़ाइल "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/runners.py", लाइन 44, रन में
    रिटर्न लूप.run_until_complete(मुख्य)
  फ़ाइल "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/base_events.py", लाइन 649, run_until_complete में
    वापसी भविष्य.परिणाम()
  फ़ाइल "/home/runner/cc-1/venv/lib/python3.10/site-packages/discord/client.py", पंक्ति 849, रनर में
    स्व.प्रारंभ की प्रतीक्षा करें (टोकन, पुन: कनेक्ट = पुनः कनेक्ट करें)
  फ़ाइल "/home/runner/cc-1/venv/lib/python3.10/site-packages/discord/client.py", पंक्ति 778, प्रारंभ में
    स्वयं का इंतजार करें। कनेक्ट करें (पुनः कनेक्ट करें = पुनः कनेक्ट करें)
  फ़ाइल "/home/runner/cc-1/venv/lib/python3.10/site-packages/discord/client.py", लाइन 704, कनेक्ट में
    किसी से भी विशेषाधिकार प्राप्त IntentsRequired (exc.shard_id) बढ़ाएं
discord.errors.PrivilegedIntentsRequired: Shard ID None उन विशेषाधिकार प्राप्त इरादों का अनुरोध कर रहा है जिन्हें डेवलपर पोर्टल में स्पष्ट रूप से सक्षम नहीं किया गया है। https://discord.com/developers/applications/ पर जाने और अपने एप्लिकेशन के पेज के भीतर विशेषाधिकार प्राप्त इरादों को स्पष्ट रूप से सक्षम करने की अनुशंसा की जाती है। यदि यह संभव नहीं है, तो इसके बजाय विशेषाधिकार प्राप्त इरादों को अक्षम करने पर विचार करें।```
#

i can't understand

slate swan
#

not whole traceback just the error message

cloud dawn
#

You only need the bottom part.

slate swan
#
discord.errors.PrivilegedIntentsRequired: Shard ID None उन विशेषाधिकार प्राप्त इरादों का अनुरोध कर रहा है जिन्हें डेवलपर पोर्टल में स्पष्ट रूप से सक्षम नहीं किया गया है। https://discord.com/developers/applications/ पर जाने और अपने एप्लिकेशन के पेज के भीतर विशेषाधिकार प्राप्त इरादों को स्पष्ट रूप से सक्षम करने की अनुशंसा की जाती है। यदि यह संभव नहीं है, तो इसके बजाय विशेषाधिकार प्राप्त इरादों को अक्षम करने पर विचार करें।
``` this
sonic vapor
#

so what to do

vocal snow
#

just go and enable the intents in the dev portal man

slate swan
sonic vapor
cloud dawn
#

What it tells you to there, I reverted the text and it's still accurate.

vocal snow
#

open your bot's page and enable the intents you are using

cloud dawn
#

Zeffo not having it lmao🗿

slate swan
#

🗿