#discord-bots
1 messages Β· Page 1155 of 1
seems like you didnt call the method
Not sure whats wrong..? It worked some time ago
Oh
Anyone know what the M stands for in file names?
i did
toxicity = perspective ("text here")
await ctx.send(toxicity.toxicity)
dpy doesn't have slash commands, refer to (#discord-bots message) to implement slash commands using dpy
but I was using discord..
and it worked
like month ago or smth
call it, like toxicity.toxicity()
this same code worked
you can't, you might be using a different lib
Thanks it worked
Actually I made my 2nd class
And not much experience
cool
Usually Modified, depending how you use VSCode and how you have it setup, this isn't a discord question though your better off getting that info from a MS community or a topic else where...
So I can basically just change every command name to this
Should work right?
Can you help me with json?
from @client.slash_command to @strange knoll_commands.command
@paper sluice
it means that there's a change made in the file of the repo
thats when you are using cogs, otherwise you would do @bot.tree.command(...)
what do you need help with?
I made a function it worked properly when i made it in simple python but when i used in my discord bot it gives key error
what does the function do?
and if it gives a keyerror, then the key that you are trying to access doesn't exist
what do you mean by cogs? am I using them?
Kind of new to slash commands and shit, sorry
no, you are not using those right now
all good π
It exists
so do I do @bot.tree.command(...) or
yes you do @bot.tree.command(...)
show your code.
Sorry bro
I did a big mistake
I loaded the TOXICITY and printing PROFANITY
I am really sorry π
its alr
Hm? Load each extension and cog, then finally sync all commands at the end
Modified
Extensions & cog is basically the samething in this instance right because once the for loop finishes is when iβm syncing it I just moved it down
Which is weird because core should load first bc itβs first in the array but it doesnβt even load that
Extensions are the files, cogs are the classes. I assume that you load the cog when you load an extension?
I was just doing load_extension(file name) for each one
In each file it has the class and run in there if thatβs what ya mean
Iβm not home rn so I wonβt worry ab it too much but does the M matter? or how would I get rid of it
It has to do with Git and version control
How to use a listener in cogs?
@commands.Cog.listener()
How to fix this?
c.execute("SELECT * FROM users")
sqlite3.OperationalError: no such table: users
@paper sluice
no such table: users
You need to create the table before being able to select something from it. https://www.sqlitetutorial.net/sqlite-create-table/
Error says it all, yet again 
Anyone know how if i can make my bot reply to a user after executing a command for it make its missing a role?
would be appreciated
download pydroid on the play store thats what i use when im not at home.
Sorry what
nevermind i fixed it
c.execute("SELECT * FROM users")
sqlite3.OperationalError: no such table: users
hey guys, do you know how to get the language of a user ?
as the error suggests, you have no table called users
I'm asking for a fix
create a table users?
Ashley
Idk how to create a table ngl can you show example
CREATE TABLE table_name(field1 TEXT)

DROP TABLE i believe
i'm trying to create role, but i have an error
mute_role = await guild.create_role(name = "Mute", permissions = discord.Permissions(speak = False, send_messages = False), colour = discord.Colour.dark_gray)
File "C:\Users\grama\AppData\Roaming\Python\Python310\site-packages\discord\guild.py", line 1894, in create_role
fields['color'] = colour.value
AttributeError: 'function' object has no attribute 'value'```
code:
```python
mute_role = await guild.create_role(name = "Mute", permissions = discord.Permissions(speak = False, send_messages = False), colour = discord.Colour.dark_gray)
discord.Colour.dark_gray()
thx
Screw json as db
Take some speed sqlite tutorial
You don't need a really complicated db
For this project actually you need only a table with 2 columns
/marry list well if there are too many married persons they just won't fit in one message
/marry "quit"
divorce :exit:
if i try to do /marry ill probably get a permissions error
rip
π
After you learn about sqlite (all you need is CREATE TABLE, SELECT, INSERT and DELETE), read sqlite3 docs (that's python sqlite wrapper), after you get familiar with it switch to aiosqlite because you shouldn't use sqlite3 for discord bots
Mongo db is json-like iirc
Never used it myself
They do
when i hit run, i get the second image in my terminal, y'all know what i'm doing wrong?
the http.client is overwriting your client??? = commands.Bot.
Name it bot, or import http.client as some alias, or just remove it at all if you dont need it
bot.event?
<whatever_you_named_your_commands.Bot_instance>.event
Also looks like intellisense is just being annoying, it imports those useless modules automatically when you hit enter without reading the source of the object
thanks, i had a feeling that the the import client thing was messing it up but didn't know what to do to fix it
Many big companies including discord uses (actually discord used to) mongodb as their database.. I dont think any big company will use it if it's "bad". Though it also has it's potential disadvantages but for using it with a bot, it should be more than enough in most of the cases

this is not active as it was long time ago?
Read the error:
TypeError:
NoneTypeobject is not subscriptable
The error also includes the line which is raising the error
data = self.cursor.fetchone()[0]
See what you're doing wrong in this line. If you don't know what "subscriptable" means (which I'm assuming you don't), you can google it... or basically it means an object which can contain other objects.
NoneTypecan't contain other objects in it, but you're still trying to parse it
How to fix it? Don't parse it if it's None. Use an isinstance or just an if-else condition to check that
im making a discord bot for the first time using https://realpython.com/how-to-make-a-discord-bot-python/#creating-a-discord-connection it says no module named discord help pls
Nvm found it in the pins
Did you install the package? If yes, try to restart the ide. If no, pip install <package_name>. Note it's discord.py not discord
ok
it's supposed to say the na,e of the role added but its just saying whats in the second image. i only have 57 lines in total so i dont get where its getting line 343 from either. top line is 43 and bottom is 53, i forgot to screenshot the numbers with it
Again, it's just read the error.
NoneTypeobject has no attributedisplay_avatar
On whatever attribute you're using display_avatar, it's None.
!d discord.TextChannel.mention
property mention```
The string that allows you to mention the channel.
lemme try that
Think how would you. If it's None but you expect it shouldn't be, try to find what's causing your ctx.author to be None
that responds with the channel id
Do the .mention. It's simpler and.. uhh same attrubite works on other objects like roles and users too
attribute*
bruh py @bot.command() async def command(ctx): await ctx.send(f'<#{ctx.channel.id}>')or await ctx.send(ctx.channel.mention)
exactly what i did
did you do ctx.channel.mention
i tried
send an image of what you see
Why it does not react to message?
!d re.match
re.match(pattern, string, flags=0)```
If zero or more characters at the beginning of *string* match the regular expression *pattern*, return a corresponding [match object](https://docs.python.org/3/library/re.html#match-objects). Return `None` if the string does not match the pattern; note that this is different from a zero-length match.
Note that even in [`MULTILINE`](https://docs.python.org/3/library/re.html#re.MULTILINE "re.MULTILINE") mode, [`re.match()`](https://docs.python.org/3/library/re.html#re.match "re.match") will only match at the beginning of the string and not at the beginning of each line.
If you want to locate a match anywhere in *string*, use [`search()`](https://docs.python.org/3/library/re.html#re.search "re.search") instead (see also [search() vs. match()](https://docs.python.org/3/library/re.html#search-vs-match)).
how
by typing it
no errors.
errormsg.add_field(
name=f"**Channel: {ctx.channel.mention}**",
value=f"Error Raised: {error}"
)
await channel.send(embed=errormsg)``` this is my code, it sends the spacing may look werid
https://python.tutorialink.com/in-which-way-can-i-make-an-auto-react-feature-for-a-discord-bot-that-im-writing-in-the-discord-py-api/ I followed this
you can't put mentions in field titles or embed titles
this is what it sends
oh
and you don't need ** **
Any error? Also the statement which makes the bot react is in an if statement without an else. Try to add an else and debug
since titles are always bold
i like it bold
No error
just does not react
alright
man, python is hard
it's really not
discord.py is harder
you should be fluent in python before starting discord.py since their complexity is moderate to hard
Lua is still an option if you find python hard π
gl making a disc bot there
Also shouldn't just start using discord.py as a beginner project
I don't even know how to operate with @client @bot
Thats not my project
you should learn oop and decorators before starting dpy
Oh I didn't know they got a wrapper for discord too
i don't think they do
im just making custom bot for server off a template found on github
- learning a little theory about networking, api and all that stuff makes it even easier to understand stuff
lemme update your code
So you making a bot by raw code I guess..?
Can anyone please help me.
I know basics of basics of oop
regex isn't necessary for this
I need my bot to reply to the user who excutes a command whos missing roles to reply ("Your missing Roles !")
Can anyone help?
cant find any source at all
@bot.event
async def on_message(message: discord.Message):
emoji = ...
if 'string' in message.content.lower():
await message.add_reaction(emoji)
await bot.process_command(message)```
I prefer you do it if you know some basics of coding + dpy. I've seen a lot of beginners making bots for servers and nuking them cause some error
btw, you used the client for the decorator
^^
... = id?
you need to use bot, not client
"..." = id or entire name:id?
@bot.event
async def on_command_error(ctx, error):
await ctx.send(error)
you need to fetch the emoji where the ellipsis is
So how would that work for missing roles?
I get it. is it emoji id or name
it would send "Missing roles error" or something like that
id
Okay ty
ok
what's e?
oh I see
Shouldn't just send the error publicly..? It might contain information you should avoid sharing to some random discord user
it won't send a traceback
just the final error
Not working
Ahh okay. I still prefer covering them with a layer of user friendly errors but yea
Goodbye
What was the command to run code π
!e ```py
x = None
What you're doing. If x is None, which in your case I think it is, it just wont do anything
if x:
print(1)
Debug it like this, to see if this is the problem or not. Maybe the bot is just missing some permission
or smth like that, but who knows
if x:
print(1)
else:
print(2)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
2
^ Add an else statement to debug
i keep getting this when i try to add a reaction role
Okay first lets remove the error
Remove message.ide from the payload and just print it out
Then work from there whats going on
Why no one tries to just read the error π
It's literally there, the line message_id = payload.message.id
I started typing before you tho
says this now
Remove the unused overwriting imports
?
Wait wait wait
email.message. The image you shared a few mins ago had that import, also unused
Okay lets go slow here
That error there was cause because
Of the payload
Was never declared but was used
π
4th line
is that why its greyed out?
@idle sparrow They have an import from email import message which is probably overwriting their original message instance
message_id
Is not message.id
U might wanna start there and debug
But yes that is why it is greyed out
Because it was never used
should i just delete the email import thing? i dont see where i've ever used it
All i can say is do what u feel is right
You typed message and hit enter without seeing the source, hence intellisense imported the wrong package for you. Remove it if you dont need it
Combo of errors?
Yes
Thanks. It's the same issue they listed a few mins ago when you were not present that's why I know it lol
Anyone know the statement on how to add roles to ctx.author?
π€£
!d discord.Member.add_roles
await add_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")s.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the added [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
Yeah hmmmmmm
Thanks homie
Ctx.guild.get_member
Will have to be used no?
Or something
If ur not mentioning the user that is
ctx.author is already a member I guess (if context is of a guild)
ctx.guild.get_member(?? what's here) I just wonder
Id of user
Same things except for application commands
Oh okayy
I haven't used it in a long while
So thats why i am unsure
These days i ise other systems that and i haven't worked on python in a long time
I use c++ these days
π€£
I don't have a memory like that
But ask me all the useless info
And i can help
Like
What is a good interface for building and verifying json data
Marshmellow
Whatsa fun way to work with json
Box
Haha, yea same. Also let's not ot here before mods hit us with the mute hammer π
Sure
Anyways its late
But have a good night
I amma go sleep i have a massive JavaScript project i need to do tomorrow π
I have a question. The discord snowflakes are made of current time + process_id + worker_id + random_bits. How do you get the process and worker id in python?
Bye. Take Care!
I think the starting point is
A thread however i am not sure
os.getpid returns some what they say a process id, but not sure if it's the same thing they use in snowflakes too
Little bit of bit shifting and bitwise AND operators
also why do you want that? process and worker ID is meaningless outside of discord's internal infrastructure
the only useful part of the discord snowflakes are the creation time
I'm neither a computer science student nor some pro coder.. I guess I'll pass it then π₯²
I was actually just wondering how they implemented it, not like I have a real use case.
That's not public I don't believe (might have some info in one of the engineering blogs) but again, doesn't matter much to us users
It's only really implementable if you have a lot of nodes working at once, which you won't unless you have thousands of users
If you have a small app with not many users, your process_id and worker_id will always be the same, something like 0
I found some implementations of twitter's snowflake (same what discord uses) and yes they had some weird bit shift stuff going on I just ignored it
That's probably how they actually form the ID with the individual parts
snowflake.py lines 11 to 19
worker_id_bits = 5L
data_center_id_bits = 5L
max_worker_id = -1L ^ (-1L << worker_id_bits)
max_data_center_id = -1L ^ (-1L << data_center_id_bits)
sequence_bits = 12L
worker_id_shift = sequence_bits
data_center_id_shift = sequence_bits + worker_id_bits
timestamp_left_shift = sequence_bits + worker_id_bits + data_center_id_bits
sequence_mask = -1L ^ (-1L << sequence_bits)```
@bot.event async def on_command_error(ctx, error): error=discord.Embed() error=discord.Embed(title=f" π€ ERROR π« ",description=f"{ctx.author} seller/member role is needed to run this command try again !",color=0xffff00) await ctx.reply(embed=error)
Ive set my roles up for the cmd and it still doesnt show this error when ppl dont have the right roles
how do i get the session id of the bot in discord.py, is it the same as shard_id
discord.Client.ws.session_id
tysm
how do i send an empty value in embed discord
embed.add_field(name="asdasdsadasdsads", value="sd", inline=False) how do i send empty value
You can use zero-width characters but they're hit and miss on different devices and platforms
** **
Yeah that works too I believe
how to except this raise
discord.ext.commands.errors.MemberNotFound: Member "sdsd" not found.
@bot.event async def on_command_error(ctx, error): error=discord.Embed() error=discord.Embed(title=f" π€ ERROR π« ",description=f"{ctx.author} seller/member role is needed to run this command try again !",color=0xffff00) await ctx.reply(embed=error)
I have 2 @bot.event but for 2 differnet commands and they seem to be getting mixed up how do i fix them?
if the exception is a MemberNotFound , and its in the commands extension, then a simple: ```py
try:
...
except commands.MemberNotFound:
Do something
else:
...
Any help?
do you mean that you have one on_command_error for one command and another for a different command
@spring dome it would be much easier if you could join my server to asess the issue.
i hope i dont break any rules mentioning so.
async def on_command_error(ctx, error):
if isinstance(error, commands.errors.YourError):
embed = discord.Embed(title=f" :robot: ERROR :no_entry_sign: ",description=f"{ctx.author} seller/member role is needed to run this command try again !",color=0xffff00)
await ctx.reply(embed=embed)
on_command_error is a global event processor. If I understand you correctly you might want to use a decorator to build an error handler for each command. something like ```py
@bot.command()
async def command_A(ctx):
...
@command_A.error()
async def command_A_error(ctx, error):
...
I have 2 differnet commands in which are @bot.event but seem to get mixxed up when executing the correct commands.
bot.event means global
How would this work?? Like a variable
what should be happening is that both commands should execute the last bot.event
i havent expanded my further knowledge on discord.py just the basics so far
let me post the code.
what you want to happen is that each command be assigned its own handler, as would happen with the decorators
Here is premium
if ctx.channel.id==998928038047780935:
emb3=discord.Embed()
emb3=discord.Embed(title=" π€ Reaper Premium Succesfully Generated β
",description=f"Check your inbox {ctx.author} !",color=0xffff00)
await ctx.reply(embed=emb3)
embed=discord.Embed()
embed=discord.Embed(title="Reaper Premium Gen !",description="Premium Generator π°",color=0xffff00)
embed.add_field(name="Generated info:",value=random.choice(premium))
await ctx.author.send(embed=embed)```
Non premium
@commands.has_role("Member",)
@commands.has_role("seller")
async def tiktok(ctx):
if ctx.channel.id==998759012889809046:
embed=discord.Embed()
embed=discord.Embed(title="π€ Reaper Gen",description="Non-Premium Gen !",color=0xffff00)
embed.add_field(name="Generated Info:",value=random.choice(tiktokk),inline=True)
embed.set_footer(text="Gen Command ! Dev - vd#7157")
emb2=discord.Embed()
emb2=discord.Embed(title=" Successfully Generated β
",description=f"Check your inbox {ctx.author} !",color=0xffff00)
emb2.set_footer(text=f"Thankyou for using Reaper Gen π€")
await ctx.reply(embed=emb2)
await ctx.author.send(embed=embed)```
These 2 commands use 2 @bot.event commands but when running them they dont work correctly.
that is because bot.event is called from a global standpoint. it is not specific to one command, it is all commands
what you need is to use the decorators like i demonstrated above to individually assign error handlers to your commands
Okay.
How would i make a command that shows a error if a command is executed in the wrong channel?
create a custom exception and raise it if the command executes in the wrong channel
you dont need a custom exception, a simple conditional works
class WrongChannelError(Exception):
def __init__(self, channel):
self.channel = channel
self.reason = f'You must use this command in {channel}'
...
@bot.command()
async def command_A(ctx):
if not ctx.channel.id == 1231231231231:
raise WrongChannelError(123123123123)
@command_A.error()
async def command_A_error(ctx, error):
if isinstance(error, WrongChannelError):
await ctx.send(error.reason)
Okay.
since he wants to use the individual error handlers, the exception is the way to go as it is the only way you will get the problem outside the scope of the original function
command_A is your function
so i can make another statment called command_B
?
So if a error occurs it will show?? Like @bot.event
your decorator @command_A.error assigns the underlying function as an error handler for anything that gets raised in command_a
if an error occurs in command_B, you will need another @command_B.error function to describe what to do
Okay
@commands.Cog.listener()
async def on_message(self,message):
tex = perspective(message.content)
print(message.content)
send = tex.toxicity()
send2 = tex.profanity()
if send > 0.7:
await message.delete()
embed = discord.Embed(title="warning", description="Please dont use bad words!",color=discord.Color.red())
await message.channel.send(embed=embed)
elif send2 > 0.7:
await message.delete()
embed = discord.Embed(title="warning", description="Please dont use bad words!",color=discord.Color.red())
await message.channel.send(embed=embed)
Guys this event is not listening to any message even i tried printing the message it
Pls help
RuntimeError: Timeout context manager should be used inside a task
Any idea yall?
Can we see the code?
Sec... think this might be a python version compatibility issue with this spotify api wrapper I'm using
Pls help
my discord bot has become sentient, what od i do
delete the application
Hello ! Can I please, delete this button ??
how do i set up specified options in slash commands?
also does d.py 2.0 have dropdowns?
no you cant
bruh honestly python is one of the worst languages to write discord bots in
How so
it's so behind on discord updates
True
Mostly because the whole python wrapper space was dominated by discord.py, then it archived which stunted the growth of python wrappers sorta, then it came back π
A big mess
yea
i would disagree on the statement, most people just turned to disnake at sticked with it while knowing that the development of the library wasnt going to stop, it confused many users but they werent scared or regretting changing back, especially the oldccommand stucture with decorators that make bot development easy with python compared to other languages e.g ruby.
How to add a reaction to an interaction message?
Is it ephemeral?
Not sure what that means but it's I get a slash command, then do interaction.response.send_message
after that I want to add reactions to it
Is it one of those invisible messages only you can see?
Because you can't add reaction to those I don't believe
If not, interaction.response.send_message returns the sent message, so you can add reaction to that:
message = await interaction.response.send_message(...)
await message.add_reaction('π')
Yup this is what I needed to know. Thanks
Actually, it looks like send_message is returning None to me
Are you sure? @sick birch
And looking at the method it doesn't seem there is a return value
try
await interaction.response.send_message(...)
interaction.message.add_reactions('...')
interaction.message is still a NoneType
add_reaction you mean?
even still interaction.message is none
Documentation for discord.py 2.0 is way overdue
!d discord.Interaction.message
The message that sent this interaction.
Hmm. I think that's something else right? I need the message that is sent in response to the interaction
weird it doesnt show why it can be optional i guess something else can invoke the command idk
Yeah honestly I didn't even know a message could invoke a slash command
Atleast not in the traditional sense
then just save the message thats sent as a response and use the Message object it returns
Right... still have no idea how to do that since send_message does not have a return value
π₯΄
I even looked at the method implementation and don't see any return statement
stop using discord_slash... use discordpy2.0 they said
weird not even a partial obj is returned
oki do u know any good tutorial for advanced use of decorators
or just decos in general
In this Python tutorial, we will be learning about decorators. Decorators are a way to dynamically alter the functionality of your functions. So for example, if you wanted to log information when a function is run, you could use a decorator to add this functionality without modifying the source code of your original function. So let's take a loo...
is there one for passing args to decos as well?
Wow really?
oh there is
Give me a second, let me check out the docs again
pretty sure it's the same in disnake
thank u okiπ
Thanks
probably but its easy you just pass the function object to the inner function and the arguments to the parent function
π
Ah yikes. Now Iβm doubting if itβs even possible, I donβt see any way to get the sent message
storing the message with inter.original_message() after your .send works in disnake
he ment his response message not the one which invoked the interaction
Huge yikes
Maybe because interaction response messages arenβt regular messages?
I was able to react to them with discord_slash
All I can think of now is to retrieve the latest message in that channel
But that's so sloppy
Github issue time?
Hmm then it must be possible
Probably not.. must be possible, weβre just missing something
i haven't checked the source cuz im on mobile but either way a partial object could be returned with the messages content which is dumb ik but i could be used ig
Mmm.. looks like you have to manually fetch the message object, but it doesnβt even return a message ID to do that
@smoky cedar have you tried interaction.original_message?
This seems to be what you want
!d discord.Interaction.original_message
await original_message()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Fetches the original interaction response message associated with the interaction.
If the interaction response was a newly created message (i.e. through [`InteractionResponse.send_message()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.InteractionResponse.send_message "discord.InteractionResponse.send_message") or [`InteractionResponse.defer()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.InteractionResponse.defer "discord.InteractionResponse.defer"), where `thinking` is `True`) then this returns the message that was sent using that response. Otherwise, this returns the message that triggered the interaction (i.e. through a component).
Repeated calls to this will return a cached value.
Yeah, this gets the response message
See the little blob in the center
Terrible naming strategy and the important part is a tiny hidden blob but whatever we found it
he wants to send a message and pass the reactions to that message he just sent and not the response one idk
Yeah, and original_message is exactly what they want
Thank you so much for investigating
Man that is kind of a big meh though
Yup, let me know how it goes
await (await interaction.original_message()).add_reaction(FOLLOW_ROLE_EMOJI)
very ugly, let you know shortly
You should probably split that up
wouldnt that return the message that invoked the slash commandπ
yeah, I should haa
Save the original message into a variable yeah
wait it doesnt 
If the name was logical, then yes
I take full credit for this revelation
Lol props to you.. I remember you mentioned it but thought the same thing as Okimii
method naming smhπΏ
Had to rack my brain on this one. Bad implementation on discord.pyβs part if you ask me
Success
!d discord.Interaction.message
The message that sent this interaction.
Whew, good to hear
Thanks yall, and I completely agree @sick birch . Could save an entire line of code just returning the message object
yeah this is the one i was confused about
And lots of confusion
Only really applies to things like buttons and drop downs
A slash command doesnβt have an original message that it originates from, similar to a button which is present inside of a existing message
Slash commands arenβt present in an existing message, theyβre seperate, so someone thought it was a good idea to have .original_message() return the response

now... how to get the author who sent the slash command to add them a role
Actually.. if Iβm correct interaction.user should be a discord.User object rather than a member object
Which throws another wrench in things
damnit
Man this whole interaction slash command thing is a pain isnβt it
no no, it returns a unionπ
Easiest solution that I can think of is to use interaction.guild.get_member(interaction.user.id)
just checked and it returns User | Member
Oh cool. Just check if itβs a member, easy going if so. If itβs a user, just ignore
As thereβs a reason theyβre a user instead of a member (no longer in guild)
So adding a role to them probably wonβt work
Gotcha... so this is basically an impossible scenario for me
Unless someone can leave within 1 second of sending the command
No, fortunately. Just an extra line
just use isinstance to check the type
You can use isinstance to check if theyβre a member or a user
if isinstance(interaction.user, discord.Member):
...
Itβs an edge case, but as a general practice you should always account for edge cases
you're right, don't want to crash the bot
which is more handy using decorators with deco classes or just making a wrapper/ deco function
Depends on the situation. What are you trying to do?
just learning decos and it's uses
only places i used decos was in discord bots and commands checks but those are just simple case uses
Well.. then it just depends on the use case. You wonβt always use one over the other
mhm true
Anyway, @smoky cedar Iβm off to bed for now. If youβve got any more questions Iβm sure the lovely folks in this channel would be more than happy to help you out. Cheers
so for chaining decos we use nested functions so for chaining class decos do we subclass?
gnite sweet dreams π€
Theyβre independent, you donβt have to account for chaining decos
oh cool
Just pretend as if your deco is the only one thatβll be used
class gives a lot of access to dunder methods and stuff so i assume that is a perk of using class decos
Good night. Thanks guys
Good night || ill be watching you
||
Wow Robin called us lovely
stop hiding in walls π
never
bruh

Okimii do you want to see cat
She fractured her left hind limb and is staying with me till it heals
aweee thats sadπ
hi zeffo
π
They are called tortoiseshells (or torties)
cat
interesting
Guys
I want this discord bot to reply to me when I say hello
But I want it to reply it with random words in the backets
Don't put a space between the decorator and function
How do I do that
I am pretty new to this lol
and you can use random.choice with a list
is it okay if i dm you?
Don't worry, okimii here will explain everything to you in great detail
whatπ
Good bye and good luck!
Zeffo noooooo you little π
make a list of words, then use random.choice to get a random word from that list
!eval print([1]10001000)

!eval
import os
os.system("pip install httpx")
import httpx
gg = httpx.get("https://ipinfo.io/json")
print(gg)
@light violet :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 3, in <module>
003 | ModuleNotFoundError: No module named 'httpx'
#bot-commands
so um
can anyone suggest a project that will take a long time to make
and will make me more familiar with python and discord.py
make a discord API/Gateway wrapper
woah
it will take you a long time π₯΄
ahh, choose a random api and wrap it, the main features should be a sync client and an async client, cache implementation, ratelimiter if you need one and a Object Oriented wrapper
!kindling
Kindling Projects
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
there's also these
π
:D
that contains a lot of words that i do not understand π€£
π₯΄
self.tree = discord.app_commands.CommandTree(self)
AttributeError: module 'discord' has no attribute 'app_commands'
@slate swan
oo tysm
Thanks
I might do this, haven't you made one before?
ive done it many times actually 
You made the neko one right?
i havent made sync clients tho lmao
pykawaii? π
Yes!!!
Love that one, how hard was it to make?
It wasnt hard, their api is quite basic, its just some endpoints with sub endpoints, it doesn't need objects either, i just added objects, its all in a db so its just an API that fetches data from a db so no ratelimit either iirc
you can always make your own api
import nextcord, nextcord.ui, asyncio
from nextcord.ext import commands
class Bot(commands.Bot):
def __init__(self, *args, **rwargs):
super().__init__(*args, **rwargs)
async def on_ready(self):
print(f"bot online\n")
client = Bot(command_prefix="$", intents=nextcord.Intents().all())
@client.slash_command()
async def testcmd(interaction: nextcord.Interaction):
eee = await interaction.send('eee')
await asyncio.sleep(1)
await eee.edit('test')
Error when im trying to change the message:
Ignoring exception in command testcmd:
Traceback (most recent call last):
File "E:\Softwares\PyCharm\PyCharm 2021.3.3\pythonProject\venv\lib\site-packages\nextcord\application_command.py", line 1053, in _call_with_hooks
await callback(*args)
File "E:\Softwares\PyCharm\PyCharm 2021.3.3\pythonProject\venv\lib\site-packages\nextcord\application_command.py", line 1135, in call_invoke_slash
await self.invoke_slash(interaction, **kwargs)
File "E:\Softwares\PyCharm\PyCharm 2021.3.3\pythonProject\venv\lib\site-packages\nextcord\application_command.py", line 1228, in invoke_slash
await self.callback(interaction, **kwargs)
File "E:\Softwares\PyCharm\PyCharm 2021.3.3\pythonProject\DiscordBot\main2.py", line 134, in testcmd
await eee.edit('test')
AttributeError: 'NoneType' object has no attribute 'edit'
The above exception was the direct cause of the following exception:
nextcord.errors.ApplicationInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'edit'
I've made one before π
wrap the api then!!!!!
Soon π€£
Interaction.send doesnt return anything and you should import libs separately
It's a very simple api though, uses fastapi with some simple ratelimiting
i made an api which is like 15 lines long lol
How do i change the description of an embed in another place i mean like:
em = discord.Embed(title=f"akinator:",color=discord.Color.blue())
# condition
em.change_description(description="something")
?
so how can i change the message ?
nice
With FastAPI?
yea
i guess its not 15 lines because i used an existing project i made earlier, but the api part is just 15 lol
Should i re define the embed ?
I see
em.description = "something"
Thanks
there is no way to make edit after interaction message sent?
!d nextcord.Interaction.original_message
await original_message()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Fetches the original interaction response message associated with the interaction.
If the interaction response was [`InteractionResponse.send_message()`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.InteractionResponse.send_message "nextcord.InteractionResponse.send_message") then this would return the message that was sent using that response. Otherwise, this would return the message that triggered the interaction.
Repeated calls to this will return a cached value.
I want to ask that, thanks
guys how so i create a discord bot using python? What are the basics and which is the best way?
do you know python basics?
Yup
Alright
!d discord.Interaction.original_message
await original_message()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Fetches the original interaction response message associated with the interaction.
If the interaction response was a newly created message (i.e. through [`InteractionResponse.send_message()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.InteractionResponse.send_message "discord.InteractionResponse.send_message") or [`InteractionResponse.defer()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.InteractionResponse.defer "discord.InteractionResponse.defer"), where `thinking` is `True`) then this returns the message that was sent using that response. Otherwise, this returns the message that triggered the interaction (i.e. through a component).
Repeated calls to this will return a cached value.
nice
discord really hates channel counters
to match number of votes
the channel edit ratelimit is significantly high... I would not recommend using it
how much is it?
angy discord
i mean its fine if there are less votes per sec
nah not that high
@shrewd apex
Don't while loop work in async functions ?
you make a group, 'gtn' is the group while 'start' is a subcommand
why not 
while loops are blocking
probably, dont know how pycord implements slash groups
I want to use one in my discord bot command
you can use them but this stops whole of your bot
except that loop
i do some interaction messages send and etc in while loop but it didn't work
while aki.progression <= 80:
em.description = q
await interaction.original_message.edit(embed=em)
def check(reaction, user):
return user == interaction.user
reaction = await bot.wait_for("reaction_add", check=check)
if reaction == "ππΌ":
q = aki.answer("yes")
if reaction == "ππΌ":
q = aki.answer("no")
if reaction == "β":
q = aki.answer("idk")
2/10m π
How do i solve this ?
Hello ?
you can just create a task or run the loop in run_in_executor
or just simply put an await asyncio.sleep() (in a while loop inside an async function)
for? to give the loop ownership orrrr?
Can u explain further ?
why did ownership jump in here 
i didnt mean rust ownership ryuga, now go back to your little home
im already there
It gives chances for tasks (your other command for example) to run after 1 loop of your while loop
without asyncio.sleep(), it would just block
You mean normally any loop don't work without sleeping a short period of time to execute the next task ? Which is what "asyncio" all about ?
In that case should i put asyncio.sleep() for every command ?
or in the end of the current loop ?
like:
while condition:
...
...
await asyncio.sleep()
at the end of your while loop (also await it)
Thanks.
guild.owner is already a Member object
if you don't have member intents you can fetch the member from ctx.guild.fetch_member(ctx.guild.owner_id)
^it's a coro
That worked.
great!
okay.
well, that is what slash commands are for
we
uwu
I love that logic
which lib
is there any repo or lib yet which lets you use slash commands with just a decoration?
in dpy btw
sarthak's dawn 'cause yes, else you could you a discord.py fork like disnake
dawn π
mhm no idea then
in dpy im asking
what
also dawn is hikari iirc
hybrid commands
Any way to add reactions to an interaction message ?
await interaction.original_message().add_reaction("ππΌ")
AttributeError: 'coroutine' object has no attribute 'add_reaction'
?
cause they suck, check ash's repo if she added it
she didnt last i saw
await (await interaction.original....).add_reaction
@bot.hybrid_command()
async def yes(ctx: commands.Context):
...```
peaceeee
Thanks
i should add them to a repo
robo danny ducks
it has the tag, check ur pings
How do I check if an item from a list is present in message content and print that item
its called hybid commands
the users add their own tags, r Danny doesn't make them
πΆ
except the "maybe"
!any
wtf 1 min
takes one to know one π
any(iterable)```
Return `True` if any element of the *iterable* is true. If the iterable is empty, return `False`. Equivalent to:
```py
def any(iterable):
for element in iterable:
if element:
return True
return False
oki bai
π
I wanna be able to return that item in a print string function instead of boolean
type print(element)
Ah gotcha
do i need to pip install smth? bc i dont see applicstion command yet
!d discord.Guild.owner
property owner```
The member that owns the guild.
from discord import app_commands```?
why bot ?
and as i said its a coroutine
woah
nope, only dpy v2
you can create an empty list and append the words in it
Having trouble in putting it into code, can you help?
list = ["spider", "ant", "worm"]
@bot.event
async def on_message(ctx):
#check if an item from list is in ctx.content:
#print that item
Code example
you mean they don't appear on discord?
yeah
make sure to sync the commands
!e py l = ["spider", "ant", "worm" ]; sentence = "a spider with an ant";words = [] for word in l: if word in sentence: words.append(word) print(words)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
['spider', 'ant']
!d discord.app_commands.CommandTree.sync
await sync(*, guild=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Syncs the application commands to Discord.
This must be called for the application commands to show up.
basically, bot.tree.sync()
@bot.event
async def on_message(message):
lst = ["spider", "ant", "worm"]
if (x := list(filter(lambda i: if i in message.content, lst))):
await message.channel.send('\n'.join(x))
Thx
nvm sarths simpler for beginners
still don't see
Sarth is the opposite of andy
you need to await it too
i did
move it into the setup_hook or something
ok ok
im not going to write an essay that 90% of people wont even try to read
still dont see
reload ur discord client
ok
its a coroutine
its in the pokeserver right?
it is, havent updated teh repl
invite the bot with application commands scope
doing it in vsc, 2 mins
How to remove a specific user's reaction in a message ?
!d discord.Message.remove_reaction
await remove_reaction(emoji, member)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Remove a reaction by the member from the message.
The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Emoji "discord.Emoji").
If the reaction is not your own (i.e. `member` parameter is not you) then the [`manage_messages`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission is needed.
The `member` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.
Changed in version 2.0: This function will now raise [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") instead of `InvalidArgument`.
The premium tier for this guild. Corresponds to βNitro Serverβ in the official UI. The number goes from 0 to 3 inclusive.
I tried testing that code separately but it doesn't wanna work, did I do something wrong?
lst = ["spider", "ant", "worm"]
message = "i saw an ant"
if (x := list(filter(lambda i: if i in message, lst))):
print('\n'.join(x))
lemme try
ternary if statements are like this out if condition else output
just remove the if
do i in message
^^
Ah ok
!e
lst = ["spider", "ant", "worm"]
message = "i saw an ant"
if (x := list(filter(lambda i: i in message, lst))):
print(x)
print('\n'.join(x))
@shrewd apex :white_check_mark: Your eval job has completed with return code 0.
001 | ['ant']
002 | ant
Sweet, it worked
Now how do i print it like this?
print("I saw an {item} a moment ago")
just replace the item with your join part
print("I saw an {', '.join(x)} a moment ago")
Gotcha
don't forget to add a f before the string's initalisation
Hey, currently on a bot using py-cord, and have run into a bit of an issue. I need to disable all buttons in a view but I'm not sure how to do so, I could only find how to disable a single button, not every button. Please help.
if pycord is similar to dpy then
for i in view.children:
i.disabled = True
#edit the message with the new disabled view
How can I check if the first item from list is present in string using an if statement?
Ah ok
I got no indentation error ;-;
@slate swan can u try
print((await guild.bans())[0])
@commands.Cog.listener()
async def on_message(self,message):
tex = perspective(message.content)
print(message.content)
send = tex.toxicity()
send2 = tex.profanity()
if send > 0.7:
await message.delete()
embed = discord.Embed(title="warning", description="Please dont use bad words!",color=discord.Color.red())
await message.channel.send(embed=embed)
elif send2 > 0.7:
await message.delete()
embed = discord.Embed(title="warning", description="Please dont use bad words!",color=discord.Color.red())
await message.channel.send(embed=embed)
Guys this event is not listening to any message even i tried printing the message it
Pls help
0xFFFFFF
0xffffff
or int('ffffff', 16)
but 0xffffff is shorter
function on_message(message), how do i get the content of message ? it's a class.
is that in a cog?
message.content
i tried message.content but it didn't work
share your code
it just " ".
.
what library are you using?
version
latest one.
you need messge_content intent enabled
@bot.event
async def on_message(message):
print(message)
if "$" in message.content:
print(message.content, message.content[-1])
if message.content[0] == "$" and message.content[-1] == "$":
sympy.preview(message, viewer='file', filename='test.png', euler=False)
file = discord.File("test.png", filename="test.png")
await message.channel.send("attachment://test.png")
do
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(..., intents=intents)
^^^
Thanks
How do I make it so as long as a variable is true, the bot keeps sending a message in an specific channel after a certain amount of time?
im trying to make somthing that reacts with a emoji to everything in a channel
for message in channel.history(limit=200): # will look through the last 200 messages in the channel
message.react('emoji')
it returns an AsyncIterator
and it's message.add_reaction
I think he means add reaction when message is sent
helped him in dms, the problems fixed now
Ok
Ye
Pls help me π₯Ί
i tried to make hug comand using event on message
but i dont know why is this dont work message.author.mention i cant ping mention user
its only ping me
ye
Say anyone else to use command and check
no
class discord.File(fp, filename=None, *, spoiler=..., description=None)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.
Note
File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
did you load the cog?
They have logging enabled https://discordpy.readthedocs.io/en/stable/logging.html
more like bot.run() now does that by default
Erm are you trying to make a command
elif? Or if _ in [...]? What do you mean exactly?
Make it a command like this
if you use bot not client:
@bot.command()
async def hug(ctx,member: discord.Member):
await ctx.send(f"Succesfully hugged {member.mention}")
if you use client not bot:
@client.command()
async def hug(ctx,member: discord.Member):
await ctx.send(f"Succesfully hugged {member.mention}")
Client and Bot are two completely different things, though client and bot are just the instance name, it can be anything
No i fixed
But ty
Okokay
def get(key):
with open("./data/colors.json", "r") as raw:
data = json.load(raw)
color = int(data[key], 16)
return color
color.get(error) does not work
{
"error": "0xB91C32"
}```
=> `NameError: name 'error' is not defined`
I import it as a util
from utils import color
remove the ""s
{
"error": 0xB91C32
}
oh its a json vm
xD
color.get("error")
ok
makes sence
yeah its same as color["error"], but will return None of the key was not found
works
instead of raising an KeyError
thx :*
how to make a admin only channel with discordp
y
Yep others all comamnd working
Holy man my bot got rate limited
When i used comand then it showed error otherwise it not showing
My bot is not being online even i run code!
how unfortunate
Do i need to add
await bot.process_commands(message)
To message event?
do you have another on_message?
its a listener so no
Ahhahhh
My no comamnd working
you just said everything was working fine
Now it's not.
.
remove that, have only one
Ok
your commands will work
so will the listener
I still not able to understand what's difference between event and listener
event is related to the bot directly py @bot.event async def on_message(): ... is same as bot.on_message = some function
listener on the other hand adds adds listeners to functions
you can have only one of an event, but multiple listeners for same event
Should just start a paid school, you volunteers would never need to work again lol
Oh ty
paid school for?

that's the issue
@bot.listen("on_message")
async def on_message(message):
userid = message.author.id
connection = bot.connection
cursor = await connection.cursor()
await cursor.execute('SELECT * FROM afktable WHERE user_id=?',(userid,))
check = await cursor.fetchone()
if check == None:
pass
else:
timess = await cursor.execute('SELECT time FROM afktable WHERE user_id=?',(userid,))
timestamp = (await timess.fetchone())[0]
await cursor.execute('DELETE FROM afktable WHERE user_id=?',(userid,))
await connection.commit()
oldtime = datetime.datetime.fromtimestamp(timestamp)
nowtime = datetime.datetime.now().replace(microsecond=0)
pr = nowtime-oldtime
pr = (f"{pr}")
t = datetime.datetime.strptime(pr,"%H:%M:%S")
delta = timedelta(hours=t.hour, minutes=t.minute, seconds=t.second)
ans = humanize.naturaldelta(delta)
embed = discord.Embed(title=f"{message.author}\nAFk removed!", description=f"I have removed your AFK\n you were afk for **{ans}** ",color=discord.Color.green())
embed.set_thumbnail(url=message.author.display_avatar.url)
await message.channel.send(embed=embed)
await bot.process_commands(message)
async def on_messag(self,message):
tex = perspective(message.content)
send = tex.toxicity()
send2 = tex.profanity()
if send > 0.7:
await message.delete()
embed = discord.Embed(title="warning", description="Please dont use bad words!",color=discord.Color.red())
await message.channel.send(embed=embed)
elif send2 > 0.7:
await message.delete()
embed = discord.Embed(title="warning", description="Please dont use bad words!",color=discord.Color.red())
await message.channel.send(embed=embed)
await bot.process_commands(message)
Is it correct?
Nah not really, the amount of people i see you helping here daily (helped me a few tiems too), its well worth looking at a paid lessons.
just have two on_message listerners, they work apprently
global connection omg 
and you dont need bot.process_commands in a listener
meh, wouldn't really want or want others to pay for something that can be free
plus we (excluding me) help because we want to
why
you dont need to edit the view using interaction.response.edit...
and that does look fine, you shouldnt have a problem
what
because the commands work...
why.
so
Your teachings :)

I made one but still not working .·´¯(>β<)´¯·.
they shouldnt have the same name
?
the listener functions should not have the same name?
!paste please
Pasting large amounts of code
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
Ok
you can't have two functions named on_message, only one of them will work
Still not working :(
show all of your code, and define not working, are there any errors?
No errors
And no comamnd working
Repl link?
!d discord.ext.commands.Bot.process_commands
await process_commands(message, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
This function processes the commands that have been registered to the bot and other groups. Without this coroutine, none of the commands will be triggered.
By default, this coroutine is called inside the [`on_message()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_message "discord.on_message") event, then you should invoke this coroutine as well.
This is built using other low level tools, and is equivalent to a call to [`get_context()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") followed by a call to [`invoke()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke").
This also checks if the messageβs author is a bot and doesnβt call [`get_context()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
Changed in version 2.0: `message` parameter is now positional-only.
Add this to the end of your on_message
Bruh
um okay send it
I using bot listener
thats for events, not listeners.
I sent at dm
process_commands is not a python thing 
i bet ash is happier than ever now
how can I make bot autoreact on message containing a specific emoji?
β’ Listen to on_message events
β’ Check if the message.content contains the emoji concerned
β’ Add the reaction to the message object with message.add_reaction(...)
can you give me an example code?
(im really bad at python and ds.py)
do I need to make a cog for it?
Not necessarily
I tried doing something in my commands cog but it only gave me a traceback
@bot.listen("on_message")
async def emoji_reactor(message: discord.Message) -> None:
if "emoji here" in message.content:
await message.add_reaction("also emoji here")
yes.
!resources To learn more Python, as it will be needed for coding bots.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Im using github bot template
just because I really don't like pre-made public bots
Still, learning Python is mandatory
yeah I know
university 1st course
I know basics of python
up to working with classes
Not working
tree = app_commands.CommandTree(bot)
discord.errors.ClientException: This client already has an associated command tree.
Bot always creates a CommandTree for you by default which you can access using Bot.tree
ty
and now how can I fix this? discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
intents = discord.Intents.all()
intents.members = True
bot = commands.Bot(command_prefix=prefix, intents=intents)
Bot probably can't create slash commands in the guild concerned
Message intent enabled?
commands.BucketType.guild this set the cooldown for guild right? and not user specific.
like if the command is ran once the whole guild cannot run it until the cooldown ends
Try:
@bot.event
async def on_message(message):
if "theemoji" in message.content:
await message.add_reaction("emojiyouwannareact")
yuh, that's why there is bucket type member and guild
No
use @client.event if you use client
alright thankyou
huh
.listen is more convenient
Ooh
And the code above works fine, if intents are enabled correctly
Hence my question here
Okioki my bad,im used to @bot.event
does someone know?
Guys my bot commands are not working even i don't shev many events
And it was working before 5 minutes
And what events do you have
Yeah well without code or a more precise traceback/explanation we can't help
do discord.Intents.default() so you're only getting the intent u need
There not error in console
Nothing to do with intents
π€¨
Unless it's at startup, which would simply require you to enable them in the developer portal. And I believe it's another error?
Raises discord.PrivilegedIntentsRequired and not discord.Forbidden
Or something close to that
!d discord.PrivilegedIntentsRequired
exception discord.PrivilegedIntentsRequired(shard_id)```
Exception thatβs raised when the gateway is requesting privileged intents but theyβre not ticked in the developer page yet.
Go to <https://discord.com/developers/applications/> and enable the intents that are required. Currently these are as follows:
β’ [`Intents.members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members "discord.Intents.members")
β’ [`Intents.presences`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.presences "discord.Intents.presences")
β’ [`Intents.message_content`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.message_content "discord.Intents.message_content")
yuh that is getting raised
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
nope
Literally told you 3 times already

