#discord-bots
1 messages · Page 472 of 1
Can multiple instances of a task loop run at once?
Yep
So what could I do instead
hurry answe pls how can i make it so certain ids can use a cmd as well as certain perms
why do you want to run the same task multiple times
So individual users can have loops for themselves
I guess I could do that with a command
Srry to bother you but do you know anything about selenium and do you think you could help me
But I still want it to be cancellable with another command
Ok ty
uh if you absolutely need to do that
you could make an async function and implement the looping logic yourself
and start the task with
!d asyncio.loop.create_task
loop.create_task(coro, *, name=None)```
Schedule the execution of a [Coroutines](https://docs.python.org/3.10/library/asyncio-task.html#coroutine). Return a [`Task`](https://docs.python.org/3.10/library/asyncio-task.html#asyncio.Task "asyncio.Task") object.
Third-party event loops can use their own subclass of [`Task`](https://docs.python.org/3.10/library/asyncio-task.html#asyncio.Task "asyncio.Task") for interoperability. In this case, the result type is a subclass of [`Task`](https://docs.python.org/3.10/library/asyncio-task.html#asyncio.Task "asyncio.Task").
If the *name* argument is provided and not `None`, it is set as the name of the task using [`Task.set_name()`](https://docs.python.org/3.10/library/asyncio-task.html#asyncio.Task.set_name "asyncio.Task.set_name").
Changed in version 3.8: Added the `name` parameter.
cancel(msg=None)```
Request the Task to be cancelled.
This arranges for a [`CancelledError`](https://docs.python.org/3.10/library/asyncio-exceptions.html#asyncio.CancelledError "asyncio.CancelledError") exception to be thrown into the wrapped coroutine on the next cycle of the event loop.
The coroutine then has a chance to clean up or even deny the request by suppressing the exception with a [`try`](https://docs.python.org/3.10/reference/compound_stmts.html#try) … … `except CancelledError` … [`finally`](https://docs.python.org/3.10/reference/compound_stmts.html#finally) block. Therefore, unlike [`Future.cancel()`](https://docs.python.org/3.10/library/asyncio-future.html#asyncio.Future.cancel "asyncio.Future.cancel"), [`Task.cancel()`](https://docs.python.org/3.10/library/asyncio-task.html#asyncio.Task.cancel "asyncio.Task.cancel") does not guarantee that the Task will be cancelled, although suppressing cancellation completely is not common and is actively discouraged.
Changed in version 3.9: Added the `msg` parameter.
The following example illustrates how coroutines can intercept the cancellation request:
Ok thanks
I tried this
vc_list = []
for vc in self.client.voice_clients:
for member in vc.members:
vc_list.append(member)
await ctx.send(f"There are {len(vc_list)} connected voice channels!")
but it just always returns 0, would you know if i did something wrong?
(its in a cog)
i believe you could simplify that to a list comp
well, i need to have it working first
Did you take a look at the docs????
server members intents, yes
It says its a VoiceProtocol not a voice channel
VoiceProtocol has a channel property which is what you want to access members on
it didn’t raise an error? 🤔
nop
try the voiceprotocol?
im looking at that now
discord.FFmpegPCMAudio is blocking the main thread and makes my computer a fucking jet taking off? last week it did not do that, any ideas?
It shouldn't tbh... Could be it's just taking too much resources and the bot isn't getting enough resources to run?
Nope, runned smoothly, perfectly, creating 500 instances extremely fast, now its blocking the main thread, making my cpu usage 100%, etc
Do u have logging turned on?
yes
And it's printing that the bot is being blocked or something?
Well, sometimes the bot doesn't respond to commands and thTs when people say it's blocking
Well my best bet would be to see your resources consumption from the task manager or something
Hi! I wanted to make a simple verification bot that presents a picture containing captcha to any new member and checks whether the new member enters it correctly and then gives them a role.
Can someone guide me on how do I go about? I feel lost.
Make like a list of random characters, then create an image w those characters and put some shit over it ig and check if their input matches the list
Is there a way to make a embed's color a hex not the main colors?
0xcode
Anyone know why errors are still raised?
?
does anyone know how to create a thread? guild.create_thread doesn't seem to be working
if isinstance(error, commands.<error>):
did you put that after?
for <error>, its like MissingPermissions or CommandInvokeError
I did, it still raises the error
show the whole thing
what error
have you loaded the cog?
Yes
check again 
maybe do @commands.has_permissions(ban_members=True) but run it again
has.permissions -> has_permissions
typo my bad
I'm using that already
is guild.create_thread is even a thing?
also, you can't do that with 1.7
use 2.0 instead
It prints something out when I load it.
can i see your whole file code?
does it log that?
Yes
ugh
not sure then but maybe ctx not being used
Does it need to be?
nah
no
if he remove it, it will raise an error
that could not be a problem
yeah a ctx requirement error
no that is what I was asking. How do you do it?
Perhaps try putting a print statement outside of any conditions in your error handler, and see if it runs?
you may need 2.0 version or use any 3rd party lib
@wind rapids
Still ran
So that print statement printed?
Yes
odd
you can create threads in master branch
k thx
when I did: pip install discord.py==2.10 it says the highest version is 1.7.3
To install 2.0, you need to install it directly from the repository
pip install git+https://github.com/Rapptz/discord.py@master
or use a fork, which I would do
is a say command ideal? or can it be used for things such as disabling your bot via violating chat tos
It's ideal. Many bots have it
alright thanks
how can I "ping" a channel to see if it exists
Well, if you use fetch_channel and the channel ID, you can see if it exists
If it dosen't exist, it returns None
Anyone know why I can't run my discord bot
The error says I can't run the token
and I
client.run(token)
Is there any method by which I can check whether a guild member is bot or not
there is a way to see if a guild member is a bot or not
like that ?
Wdym
i can't use a link for a server in my button
Show how u did it
The code is what I mean
i can't because the guild thing is in there
@kindred epoch i dmed u it
Can someone please help me with this it won't let me run the token for some reason
import discord
from discord.ext import commands
TOKEN = ('mytoken')
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=';', intents=intents)
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.idle, activity=discord.Game('With cheese!'))
print("Cheese Bot Is Ready!")
@client.command()
async def cheese(ctx):
await ctx.send("cheese :cheese:")
@client.command()
async def embed(ctx):
embed = discord.Embed(title="cheese", url="https://google.com", description="We love cheese", color=0xffa64d)
await ctx.send(embed=embed)
client.run(TOKEN)
why is it inside a tuple
You don't need it stored inside a variable
It doesn't work either way
Yes
try make a new one and use it
full error
exit code 1
send the full traceback
^
!d discord.Member.bot
bot```
Equivalent to [`User.bot`](https://discordpy.readthedocs.io/en/stable/api.html#discord.User.bot "discord.User.bot")
@night onyx
you didnt enable intents inside the bot developer page
OK thankyou
I turned on the wrong thing
Skid
heya
so i have a class that runs with a while True statement
and each time i send a command, i want to create a new instance of that class
however im p sure since it runs by a while loop, it doesnt do anything since thats jus running all at once and the command is waiting for the function to finish
any recommendations on how to implement threading so i can use it?
so i am kindly confused whats wrong with this code lol cause its not giving any errors just wont work
@client.event
async def on_message_send(message):
message = "@,everyone"
logchannel = client.get_channel(886651843051155497)
await logchannel.send(f'Message from bot \nContent: {message.content}')
the , between the @ and everyone isnt there in the code just wont let me send on here
without it
well what are you trying to do?
You are redefining message, you can't get the content attribute of it
it has worked in other things i dont get why not on this etc
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
@client.event
async def on_message_send(message):
# message = "@,everyone" <- remove this for a second
logchannel = client.get_channel(886651843051155497)
await logchannel.send(f'Message from bot \nContent: {message.content}') # This should now run sucessfully
Also, never heard of an event named on_message_send?
alright but now how is it going to know to send the message to my audit log if we dont tell it what word to send it on
?
when somone sends a message containing the word ('@everyon') i want it to send a thing to my log channel
Oh, so you want to check if a message mentions everyone
no
?
Just use an if statement and the mention_everyone attribute
if message.mention_everyone:
logchannel = client.get_channel(886651843051155497)
await logchannel.send(f'Message from bot \nContent: {message.content}')
so how would i intergrate this to what i have etc
Well, it would just go into your event
so just put the if in were i had the message =
alright make sense if statements confuse me alots so sorry for the trouble
Yup
Also, just to clear up any confusion I think you might have, = is for assignment of variables, and == is for comparison of values
!comparison
Assignment vs. Comparison
The assignment operator (=) is used to assign variables.
x = 5
print(x) # Prints 5
The equality operator (==) is used to compare values.
if x == 5:
print("The value of x is 5")
alright thanks
remove the ()
do like this TOKEN = 'MYTOKEN'
I did it now but ty anyway
Do you know how I can add text infron and after the number?```py
@client.command()
async def cheesy(ctx):
await ctx.send((random.randint(1,100)))
@slate swan f strings
I keep getting errors so I'm guess I put it in the wrong place
!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.
oh
f strings
@slate swan
@client.command()
async def cheesy(ctx):
await ctx.send(f"My Text {(random.randint(1,100))}")
@drifting arrow y spoonfeed
Coz he's gonna be back anyway
no spoonfeeding
Relax. I give it 5 minutes before he's back
Why?
Why what?
Why will he come back after 5 minutes?
Coz he will. Trust.
I've done this before anyway I just couldn't remember that well
@drifting arrow stop spoonfeeding
Yall know any good asynchronous api wrappers for mojang api?
No I'm watching someone watch top 2000 cheese live
wot
Top 2000 cheese
def lock_bro(self):
if self.pages.cur_page == self.pages.total:
self.children[0].disabled = False
self.children[1].disabled = False
self.children[2].disabled = True
self.children[3].disabled = True
elif self.pages.cur_page == 1:
self.children[0].disabled = True
self.children[1].disabled = True
self.children[2].disabled = False
self.children[3].disabled = False
elif 1 < self.pages.cur_page < self.pages.total:
for b in self.children:
b.disabled = False
``` why is it disabling the stop button
https://media.discordapp.net/attachments/829947392651427860/887526753587839036/unknown.png
Because of ```py
self.children[2].disabled = True
self.children[3].disabled = True
Did you perhaps mean
self.children[3].disabled = True
self.children[4].disabled = True
I would say that is just setting the label of the buttons, plus an emoji
now i got this
Make sure you make the change in your elif too
when i pressed the double left button
like?
self.children[3].disabled = False
self.children[4].disabled = False
its not a tuple
sure
!d discord.Embed
class discord.Embed(**kwargs)```
Represents a Discord embed.
`len(x)` Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
thxthx
yeah ofc
is making music bots now banned, cant I even make my own ??
u can make private ones
its not banned
you can make your own, even public ones
it depends on how the bot runs, groovy and rythum were using youtube to get their music, if you use some other platform/api which supports such usage, your good to go
what if some song is only on youtube
cant then
i have a problem
what is it
ImportError: cannot import name 'Player' from 'music_bot'
How to make this drop down thing ?
async def servericon(self, ctx):
icon = ctx.guild.icon.url
if icon == None:
await ctx.send('Este servidor no tiene ícono.')
else:
em = discord.Embed(title='Este es el ícono de este servidor.', color= discord.Color.red())
em.set_image(url=icon)
em.set_footer(text=f'Pedido por {ctx.author}', icon_url=f'{ctx.author.avatar.url}')
await ctx.send(embed=em)```
Does it help how do I make when there is no icon, send a text saying so?
dropdowns arent in discord.py and will never be. if you want the features like slash commands, buttons, dropdowns, etc, use a fork of d.py like pycord. your old code will still work.
oh ok
Isn't those select menus?
they may add the dropdowns which are in d.js soon though
but most other features are already added
Isn't dropdown menus already in djs
is it?
yeah ig rythm has dropdown menus which uses djs
djs has 100% coverage currently
i thought rythm used java
java is the best for music bots, but its pretty bad for general ones
so most music bots used it
nevermind, i read d.js as d.py lol
@commands.Cog.listener()
async def on_component(self, ctx: ComponentContext):
if ctx.custom_id == 'c_ticket':
overwrites = {
ctx.guild.default_role:
discord.PermissionOverwrite(read_messages=False),
ctx.guild.me:
discord.PermissionOverwrite(read_messages=True),
ctx.author:
discord.PermissionOverwrite(read_messages=True,
send_messages=True)
}
channel = discord.utils.get(ctx.guild.channels,
name=f'{ctx.author.name} ticket',
overwrites=overwrites)
if channel is not None:
await ctx.guild.create_text_channel(
f'{ctx.author.name} ticket', overwrites=overwrites)
else:
await ctx.send("You've already created a ticket please close it to make a new one", hidden=True)
``` it straight away jumps to `else` statement
and like here i wanna check that if that user already has a channel or not
:/ whats wrong
member = ctx.guild.get_member(id here)
await member.send("text")```
u = await bot.fetch_user(id)
await u.send("dm")
Also check if you are passing the id as int
o
Uhh i won't recommend doing it like that, but most probably the member isn't cached
!d discord.Guild.fetch_member
await fetch_member(member_id)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a [`Member`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Member "discord.Member") from a guild ID, and a member ID.
Note
This method is an API call. If you have [`Intents.members`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Intents.members "discord.Intents.members") and member cache enabled, consider [`get_member()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild.get_member "discord.Guild.get_member") instead.
Try using it
anyone wanna collab in my bots rewrite?
Also do you have intents enabled
@commands.Cog.listener()
async def on_component(self, ctx: ComponentContext):
if ctx.custom_id == 'c_ticket':
overwrites = {
ctx.guild.default_role:
discord.PermissionOverwrite(read_messages=False),
ctx.guild.me:
discord.PermissionOverwrite(read_messages=True),
ctx.author:
discord.PermissionOverwrite(read_messages=True,
send_messages=True)
}
channel = discord.utils.get(ctx.guild.channels,
name=f'{ctx.author.name} ticket',
overwrites=overwrites)
if channel is not None:
await ctx.guild.create_text_channel(
f'{ctx.author.name} ticket', overwrites=overwrites)
else:
await ctx.send("You've already created a ticket please close it to make a new one", hidden=True)
```it like straight away jumps to `else`
maybe its because your channel var is inside an if statement, idk much about this, but it must be that channel is None
nvm i think its not the problem
but python must recognize channel as None
so, your channel here doesnt return anything successfully, try checking your code again
in your discord.utils.get() you don't need to pass overwrites there. Also if channel is not None means that channel exists already, instead do you mean if channel is None?
i wanna make a check that if the channel already exists then the bot doesnt make a channecl
if channel is not Nonemeans that channel exists already, instead do you meanif channel is None?
is None...ill try it
not working its still making multiple channels
channel = discord.utils.get(ctx.guild.channels,
name=f'{ctx.author.name} ticket')
if channel is None:
channell = await ctx.guild.create_text_channel(
f'{ctx.author.name} ticket', overwrites=overwrites)
tickty = discord.Embed(
title=f"Ticket for {ctx.author.name}",
description=
"`Close` for closing the ticket \n `Save` for saving the ticket in `Archived Tickets` requires admin permissions (Please dont change the name of the channel and the category",
color=0x530101)
create_actionrow(
create_button(style=ButtonStyle.red,
label="Close",
custom_id="c_close"),
create_button(style=ButtonStyle.green,
label="Save",
custom_id="c_save"))
]
await ctx.send(embed=newticket, hidden=True)
await asyncio.sleep(1)
await channell.send(f"{ctx.author.mention}",
embed=tickty,
components=components)
else:
await ctx.send("You've already created a ticket please close it to make a new one", hidden=True)```
for buttons ?? or ?
yeah
anyone wanna collab in my bots rewrite
discords-components and discord-slash-components
ur bot is ?\
an economy, im planning to use sqlite for it. over 1.5k lines of code as the old bot
fyi

economy bot...cant help it lol

💣

im not that good with databases so like i cant make good eco commands
i can make the bot look good and other commands

yea lmao
but have you ever worked with sql before
how do i reply in event?
@bot.event
async def on_message(message):
if message.content.startswith('hi'):
await message.channel.send('hello!')
await bot.process_commands(message)```
i want to change "message.channel.sned('hello!')" to reply the author of the message
na never needed it
oh well rip then


duck kis

yes
await message.reply(...)
thanks
how to ping the author?
message.author.mention
ping the author using the reply or just mention them?
mention_author=True
channel = discord.utils.get(ctx.guild.channels,
name=f'{ctx.author.name} ticket')
if channel is None:
channell = await ctx.guild.create_text_channel(
f'{ctx.author.name} ticket', overwrites=overwrites)
else:
await ctx.send("You've already created a ticket please close it to make a new one", hidden=True)
```the `else` aint working its still creating channels even though it exists
@bot.event
async def on_message(message):
if message.content.startswith('hi'):
await message.reply('hello!')
await bot.process_commands(message)```
i want to make the message that start with hi, Hi, hI(like allow caplock)
{ctx.author.name} ticket are u sure this is a valid channel name? @shell wing
message.content.lower().startswith
message.content.lower().startswith
ok thanks
Won't work... Spaces are replaced with hyphens
can anyone suggest a fun command, i will try to make it
its a ticket channel name so yea...
Isn't that what I said....?
i didnt..get it...
-ticket not ticket
they doe when the bot makes one they are with -
k
did that still not working
and well there are sometimes spaces in user names too...so ig that they are causing an issue ??
str.replace(old, new[, count])```
Return a copy of the string with all occurrences of substring *old* replaced by *new*. If the optional argument *count* is given, only the first *count* occurrences are replaced.
count...
str(ctx.author).replace(" ", "-")
this should work
Yea
eh lol str here is ?
thats useless, but in cases when the object isnt a string itd be handy
you can remove them if u want
it aint working..ill try to do the count one
Don't
?
message.content.contains()
it wont work
@slate swan BTW you need only 14 Boosts for Level 3 now
whyd you ping me lol
Idk
wanna collab in my bots rewrite
any help/
what do u mean ?
What's it about?
Don't use the count arg
economy, im planning to use sqlite for it, over 1.5k lines of code as the old bot
ok..then ?
dm if interested, ill ask about the timezone
if "word" in message.content
Ah. Well, I am also rewriting my AI Chatbot haha
so you cant collab rite
kk thanks
Yea, not nowadays
Uhhh. Can u show me the channel name in discord server?
It's on GitHub or something?
the old code?
The one u have to rewrite, yea
well we will commit to a repo, but im not hosting the bot on github tho
hello hunter
the old code, yes
Ah, unicode problems
Try printing the channel name in your code. I am damn sure it will be different cz of unicode
Sure. But I don't think I will be able to cz me noon in dpy
brutally ignored
Hi
do u remember me
I didn't notice that message
nice
i d t s
do u remember textbook
yeh lost that account
Ah
channell = await ctx.guild.create_text_channel(
f'{ctx.author.name}-ticket', overwrites=overwrites)
print (chanell)
``` like this ?
str(channell)
aᶜᴵᴰ-eʸᴱˢ-ticket
``` shows this
Hmm
So the unicode is correct
prob yes lol
so like the issue is ?
Well
I don't really know tbh
Can I see the code again?
Where u check for an existing channel?
channel = discord.utils.get(ctx.guild.channels,
name=f'{ctx.author.name}-ticket')
if channel is None:
channell = await ctx.guild.create_text_channel(
f'{ctx.author.name}-ticket', overwrites=overwrites)
print (str(channell))
else:
await ctx.send("nahi")
f"{ctx.author.name.replace(" ", "-")}-ticket"
eh nope...lol still makes the channel
DUDE WTF


Hi How do you make a discord bot with python? (PLEASE DM OR PING ONCE YOU REPLY)
Yea take care man


how do i make the bot cant reply his own message?
yo
(:
:)
can someone pls help me?
kaise ho
nice
someone pls help me
i tryed using
if message.author.bot:
but it will reply to any message
pls help
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
hello pls help me
maybe change the file to JPG or PNG? idk
maybe i am trying
how do i make 2 command to one reply?
elif 'rip bozo' or 'ripbozo' in message.content.lower():
await message.reply('https://tenor.com/view/rip-bozo-ripus-bozus-nik0321-unlive2774-potato-chip-smoker-bozo-gif-21079712')``` but it didnt work, it will reply all word and other character
!or
When checking if something is equal to one thing or another, you might think that this is possible:
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
what is ! means?
That's the prefix. But read the embed please
ok
Is their a module to keep command logs of your discord bot?
Like whenever a person invokes a command or something?
didnt work
!d discord.on_command @slate swan
discord.on_command(ctx)```
An event that is called when a command is found and is about to be invoked.
This event is called regardless of whether the command itself succeeds via error or completes.
Thanks
Ah
just ignore the file name and folder name :>
Bro... Why said to add !or to yr code?
oh
im confusee
pls help
in bot.latency
try use client or something that you write on
bot = commands.Bot(command_prefix='>')
if u write it client = commands.Bot(blablabla) then use client
if u write bot then use bot
kk
Isnt it just "or"?
please why are you people not helping me please help
@slate swan
Whag about the a
a?
after i using rip bozo trigger the bot will reply all characters
elif 'rip bozo' or 'ripbozo' in message.content.lower():
await message.reply('https://tenor.com/view/rip-bozo-ripus-bozus-nik0321-unlive2774-potato-chip-smoker-bozo-gif-21079712')```
.....
uh
change client to clients
Wdym all characters
because you use clients = commands.Bot(command_prefix="*")
all messages
can i invite you to my dummy server?
Sure
How can I fix this error
@client.command()
async def banner(ctx, *, bannermember : discord.Member=None):
if bannermember == None:
bannermember = ctx.author
userBannerUrl = bannermember.banner_url
embed = discord.Embed(title=f"{ctx.author}'s banner", color=0x030203)
embed.set_image(url=user.banner.url)
await ctx.send(embed=embed)
what did i do wrong
Guys my bot is now working like it says that bot is ready but its responding
Like I created a command by which whenever I say hello the bot will say hi but the bot is not responding
!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/stable/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/stable/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/stable/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/stable/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/stable/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
Add that at the bottom of your on_message event
Umm can you send screenshot
Read the error
Ok i did
Yeah, now yk what's wrong
user instead of member?
No
That attribute doesn't exist
so what should i do
It's .banner.url
.banner returns an asset object
Ah mb, u don't seem to have it
Did u restart
And use your prefix
Did u restart
Bro my internet 😭😭
Yeah that should work
¯\_(ツ)_/¯
if u want use it without prefix, use
if message.content.startswith("yourcommand"):
U can also make ur prefix be " " which will make commands with no prefix
eh?
It's a decorator that registers an event
never try that
¯\_(ツ)_/¯
thank you
i think it wont work
can someone also tell me what "async" means?
When you have an asynchronous function (coroutine) in Python, you declare it with async def, which changes how its call behaves. In particular, calling it will immediately return a coroutine object, which basically says "I can run the coroutine with the arguments you called with and return a result when you await me"
from google
It will
I just tried it
OK thanks buddy
no?
i think space is a string too
i did run "hi" and " hi" and it still wont work
Did u restart too
ye
yep 100% it wont work if u use " " prefix
Weird
How to check who invoked the help command with commands.HelpCommand?
wait nvm. prepare_help_command can be used
@maiden fable help
Yea?
Is it necessary to run the dashboard and the bot on the same machine to use ipc
no
I got a error
???
I never used ipc, so cannot help you, Sorry
Ah ok
@hoary gust
Here
idk if i can actually help u
@errant shuttle I need help regarding ipc
but i could try
^
whats that? ipc
hmmmmm
It does
If you pass an empty string
It would work
But make sure its
""
Not
" "
That space matters
Someone help
Are you trying to run Lavalink?
No I am using ipc to make my dashboard@untold token
No that " " wont work
Just pass ""
And then it would work
So that's the error you are getting?
Yep
.event basically waits for an event to happen / registers it
Usually that error means the connection wasn't properly made
To the port you defined to
U mean I have issue with the port?@untold token
Yes, most likely
Whatever you are trying to connect is not properly hosted on port 2000
But my port is something like 54316
it work if it was "" and not " "
That's why aiohttp cannot connect to it
Yeah I said that
@untold token u mean I need to set my port as 20000
Well there is 20000 written@untold token
yo can we edit a ephemeral message?
like this:
https://images-ext-1.discordapp.net/external/vrE4ib4IDgiFqgRD-Gk2O63JYiiOIA6LTQ8q71mETVA/https/i.imgur.com/rXhBxvN.mp4
Show your code?
Yes you can
i tried normally how u edit normal messages but it doesn't work
Code?
code for current inter edit where self_inter is inter.message
await self_inter.edit(content=">>> **`>` Select the games you play!**\n_ _", components=[row1, row])
(switching to disnake.py(forked from discord.py))
Well then refer docs
its not there
Of disnake
:/
like how do u usually edit in discord.py tho?
I only know about nextcord
message.edit()
Message should be the message object
ya
!d discord.Message.edit
await edit(**fields)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the message.
The content must be able to be transformed into a string via `str(content)`.
Changed in version 1.3: The `suppress` keyword-only parameter was added.
i get "Unknown Message"
Cool
Well its ephemeral
for ephemeral message alone
ya thats the problem
That message is temporary
Ohhh
It doesn't edit the message
It just sends a new ephemeral message
If it would have edited it, there should be a sign that says edited
oh but how does it dismiss the previous one?
Like this.
oh ya forgot that 🤔
is it possible?
Editing ephemeral message isn't possible, idts
ya i get it
You need to remove the previous message and send a new one
but liek sending new one and dismissign the previous one is possable?
Refer to docs of disnake
how do u do in nextcord or original discord.py?
bcause disnake is like exactly similar to the original discord.py
or ig i will switch to nextcord
I have never used ephemeral messages really
That won't help you
How can I make a welcome command for my discord bot
You would still need to figure out
You need an on_member_join event and db
How do I add them
The db will store channel where the welcome messages need to send
For eg
@bot.listen() # decorator that listen for events
async def on_member_join(member):
channel = bot.get_channel(welcome_channel_ID) # the channel ID where the welcome messages need to be send.
# this method will get channel object from the ID of channel
await channel.send("Member joined")```
This is a simple example of on_member_join event
@untold token
Can you show your code?
of what backend or the html file?
@commands.Cog.listener()
async def on_component(self, ctx: ComponentContext):
if ctx.custom_id == 'c_ticket':
overwrites = {
ctx.guild.default_role:
discord.PermissionOverwrite(read_messages=False),
ctx.guild.me:
discord.PermissionOverwrite(read_messages=True),
ctx.author:
discord.PermissionOverwrite(read_messages=True,
send_messages=True)
}
channel = discord.utils.get(ctx.guild.channels,
name=f'{ctx.author.name} ticket')
``` how do i add cooldown on this ??
lib?
honestly, you should just use 2.0
discord-components
me ?
yes you
what kind of error
oh
^
but like can u tell me how to solve it ?
are you trying to connect to websockets from your browser
i am using ipc
Backend ofc
ok
if time_difference < 120:
if ctx.custom_id == 'c_ticket':
``` this wont work right ?
The code where you are connecting with
well i took help from a tutorial, so plz dont get angry on me cause i am just learning how to work with ipc
@app.route("/dashboard")
async def dashboard():
if not await discord.authorized:
return redirect(url_for("login"))
guild_count = await ipc_client.request("get_guild_count")
guild_ids = await ipc_client.request("get_guild_ids")
user_guilds = await discord.fetch_guilds()
guilds = []
for guild in user_guilds:
if guild.permissions.administrator:
guild.class_color = "green-border" if guild.id in guild_ids else "red-border"
guilds.append(guild)
guilds.sort(key = lambda x: x.class_color == "red-border")
name = (await discord.fetch_user()).name
return await render_template("dashboard.html", guild_count = guild_count, guilds = guilds, username=name)
@untold token@hasty iron
your server returned an invalid status code response when the client sent a request to connect i guess?
Is this swastik's tutorial?
your server should return a 101(?) switching protocols http status code response
yea but we modified the backend
and by server and client i mean ipc ofc
except the dashboard route and the login
also can you send the full error
well i am running the dashboard and the bot in different machines
well its repl, so lemme send the ss
@hasty iron
guild_count = await ipc_client.request("get_guild_count")
this line is causing the error
What's the error
@untold token
Invalid response status hmm
what should i do?
Where's somewhere I can save my code? Like on discord I can't send a lot of words
!pastebin
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.pydis.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.
@untold token in the console bot didnt print that the server is ready but why
isint is supposed to be ready on its own
?
Well, I don't really get why its showing that
Hm....okay! I will try it out
bot is just printing that it is online but not the ipc server
class MyBot(commands.Bot):
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
self.ipc = ipc.Server(self,secret_key = "zzz")
async def on_ready(self):
"""Called upon the READY event"""
print("Bot is ready.")
async def on_ipc_ready(self):
"""Called upon the IPC Server being ready"""
print("Ipc server is ready.")
async def on_ipc_error(self, endpoint, error):
"""Called upon an error being raised within an IPC route"""
print(endpoint, "raised", error)
Hmm try
self.wait_until_ready() method
!d discord.ext.commands.Bot.wait_until_ready
await wait_until_ready()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits until the client’s internal cache is all ready.
self.bot.wait_until_ready()?
Not bot
ok
self is already bot instance that you subclassed
self.wait_until_ready(MyBot)
wait a sec i am doing this in my main file
And read about some OOP also
i need to do bot not self
You subclassed commands.Bot as MyBot
its the main file not any cog
yes
Please learn what OOP is and how python works
^
Yea
And the self is the instance of MyBot
well can u plz tell me what should i do for now cause i will learn about OOP but a bit later
Bro...
Why do people keep getting in libs that aren't easy for beginners and require some knowledge when they have 0 knowledge of python like bruh
You've already been told
You are tryna drive a car without knowing how to change the gears, no offense
Your IPC isn't connecting because your bot and ipc both are trying to connect at the same time
self.wait_until_ready would make your code wait until the bot ready and then ipc will connect
^^
Oh okay
@commands.Cog.listener()
async def on_component(self, ctx: ComponentContext):
time_difference = (datetime.datetime.utcnow() - self.last_timeStamp).total_seconds()
if time_difference < 120:
time_difference = (datetime.datetime.utcnow() - self.last_timeStamp).total_seconds()
#rest code
else:
await ctx.send("sry cant")
``` it straight away jumps to `else`
Can someone suggest me a good video for learning about Cogs in discord.py
hi, anyone has any idea how to use tagscript in discord.py? searched youtube and cant find anything. i wanna try and allow people to make custom commands
Try seeing the documentation folder
hi
Ah hey there again BugCat!
Hey
Hi
@untold token is it necessary to run the bot and the dashboard on the same machine to run the ipc
@help.command()
async def lock(self, ctx):
colors = [0xFFE4E1, 0x00FF7F, 0xD8BFD8, 0xDC143C, 0xFF4500, 0xDEB887, 0xADFF2F, 0x800000, 0x4682B4, 0x006400, 0x808080, 0xA0522D, 0xF08080, 0xC71585, 0xFFB6C1, 0x00CED1]
em13 = discord.Embed(title="Lock :lock:",description="A lock command through which the admin,mods of the server can lock the text channels of the server",color = random.choice(colors))
em13.add_field(name="__**NOTE**__",value="You will require mod or admin role to run this command")
em13.add_field(ame="__**Syntax**__",value="`fl.lock [channel] (reason)`")
await ctx.send(embed=em13)
bot isnt responding to fl.help lock but i have coded fl.help mute in the similar manner and bot is responding to that idk why ?
#Help mute command
@help.command()
async def mute(self, ctx):
colors = [0xFFE4E1, 0x00FF7F, 0xD8BFD8, 0xDC143C, 0xFF4500, 0xDEB887, 0xADFF2F, 0x800000, 0x4682B4, 0x006400, 0x808080, 0xA0522D, 0xF08080, 0xC71585, 0xFFB6C1, 0x00CED1]
em10 = discord.Embed(
title="Mute 🔇",
description="A mute command through which the admin,mods of the the server can mute the server members",
color = random.choice(colors)
)
em10.add_field(name="__**NOTE**__",value="You will require mod or admin role to run this command")
em10.add_field(name="__**Syntax**__", value="`fl.mute [user] (reason)`")
await ctx.send(embed=em10)
Don't know what you mean by bugcat but sure
The name of the person
ipc is "inter process communication" so ofc?
!d discord.ext.commands.HelpCommand subclass this
class discord.ext.commands.HelpCommand(**options)```
The base implementation for help command formatting.
Note
Internally instances of this class are deep copied every time the command itself is invoked to prevent a race condition mentioned in [GH-2123](https://github.com/Rapptz/discord.py/issues/2123).
This means that relying on the state of this class to be the same between command invocations would not work as expected.
wait a sec i need to run it it the same machine?
They are making a dashboard...
No lmao
then whats the point of the ipc
there isnt any error popping the console as well
ipc lets you connect between two programs on the same machine
Well I think they are using discord.ext.ipc
thats still ipc?
yes i am using discord.ext.ipc
well discord.ext.ipc connects and starts a server on localhost so yes
The package name is discord.ext.ipc and is used to make dashboard, sooo
you need it to be on the same machine
ipc can be used to do other things
literally anything between 2 programs
Yea, but most of the people use it to make dashboards
well i have a main bot file and a backend file so how will i run 2 files at a time
@maiden fable ?
the bot is just ignoring that command
@maiden fable is it even possible?
actually, you're using quart right?
wait
wdym?
#Lock command
@commands.command(case_insensitive = True)
@commands.has_any_role(885434191783788564, 856071314740740096, 856061783722426378, 856465667296985108)
async def lock(self, ctx, channel: discord.TextChannel=None, *, reason=None):
channel = channel or ctx.channel
overwrite = channel.overwrites_for(ctx.guild.default_role)
if overwrite.send_messages == True:
overwrite.send_messages = False
await channel.set_permissions(ctx.guild.default_role, overwrite=overwrite)
em_reason = discord.Embed(title="**Channel locked**", description=f":lock: {reason}",color=discord.Color.red())
embed = discord.Embed(description = f":fl_check: Locked channel <#{channel.id}>",color=discord.Color.green())
await ctx.send(embed=em_reason)
await ctx.send(embed=embed)
elif overwrite.send_messages == False:
em = discord.Embed(description=":fl_no: That channel is already locked.", color=discord.Color.red())
await ctx.send(embed=em)
bot is ignoring this command as well :(
but there is no error popping in the console :lemon_angrysad:
@maiden fable
# do routing stuff here
async def run():
await app.run_task(*args, **kwargs)
import webserver
# bot stuff
bot.loop.create_task(webserver.run())
bot.run()
Do u have an error handler?
@hoary gust
then you can run bot.py and it would run the web server too
yeah that is only for the cooldown part
ahh found it
?
i fixed it
Cool
Against ToS
Ohk
Soooo @hasty iron I am a Music producer so what if I use my music and songs from NCS
then you can freely make a music bot without breaking any tos or laws
hey one more question
yes?
what to put in the place of *args and **kwargs
the positional and keyword arguments that that function takes
ah i am still comfused
i mean what args shall i keep there
read the docs
discord.py docs?
ok lemme
!d discord.File
class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/stable/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/stable/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
It takes two args
Ah yea. Saw that after running the command. Mb
can i run it like this
async def run():
app.run(host="0.0.0.0", debug = True ,port=20000)
ok
I really should stick to discord.py, because this isn't code, this is crap.
its called "another language other than python that uses a difference coding style"
@hasty iron
your ipc server is running on that port
why are you setting your webserver's port to 20000?
it should be 8080 or 8888
20000 is only working else a error is occuring
what
yes
that doesnt make sense, your webserver should be running on 8080
i will be talking after a few mins
Yes
@client.event() async def on_message(message): username = str(message.author).split('#')[0] user_message = str(message.content) if message.channel.name == 'chat': if user_message.lower() == 'hello': await message.channel.send(f'Sup {username}?') elif user_message.lower == 'bye': await message.channel.send(f'Later {username}!')
hey hi
umm..
so the lock is working but it isn't locking the channel where i am running the channel like for example i am running the command in #general so fl.lock #general this isnt working but for example i ran the command in #staff-chat fl.lock #general this is working
#Lock command
@commands.command(case_insensitive = True)
@commands.has_any_role(885434191783788564, 856071314740740096, 856061783722426378, 856465667296985108)
async def lock(self, ctx, channel: discord.TextChannel=None, *, reason=None):
channel = channel or ctx.channel
overwrite = channel.overwrites_for(ctx.guild.default_role)
if overwrite.send_messages == True:
overwrite.send_messages = False
await channel.set_permissions(ctx.guild.default_role, overwrite=overwrite)
em_reason = discord.Embed(title="**Channel locked**", description=f":lock: {reason}",color=discord.Color.red())
embed = discord.Embed(description = f":fl_check: Locked channel <#{channel.id}>",color=discord.Color.green())
await ctx.send(embed=em_reason)
await ctx.send(embed=embed)
elif overwrite.send_messages == False:
em = discord.Embed(description=":fl_no: That channel is already locked.", color=discord.Color.red())
await ctx.send(embed=em)
umm.. so whats the issue ?
@hasty iron
Remove the () from event
Indentation is not the best either
i just started any tips?
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
getting this error when trying to make a missing required arugment error handler
AttributeError: module 'discord.ext.commands' has no attribute 'MissingRequiredArugment
typo ```
MissingRequiredArugment
^
!d discord.ext.commands.MissingRequiredArgument
exception discord.ext.commands.MissingRequiredArgument(param)```
Exception raised when parsing a command and a parameter that is required is not encountered.
This inherits from [`UserInputError`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.UserInputError "discord.ext.commands.UserInputError")
that's how you spell it
ohh ok
Argument*
thoughts ?
Good
I love the discord UI
is it possible to make a argument optional
Working on this for Lancebot
=None
What are you trying to do exactly though?
Yes you can
You can also use typing.Optional
async def func(ctx,* ,args=None):
...```
how
This too
so if user does not give arguments it will not spill error
Argument args would be optional so if you don't pass any thing, it would be None
So if an user types the command sui
You want to make user say F ?
Oh you want to pay respect to someone? Like another user?
So you need to use context for this
ctx.author aka Context.author returns the Member object of who ever invoked the command
So
For example
@bot.command()
async def somecommand(ctx):
await ctx.send(f"{ctx.author} used this command")```
The first argument of the function takes ctx aka context object
.author attribute returns member object of who invoked the command and in an f string it shows their name and tag and the message where command was invoked ctx.send()
Hm np
await ctx.send(f"{ctx.author} payed respects to {member.name}")
{ ]
It would raise a syntax error
define if then
That means you didn't define bot
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
help????
import psutil
class about(discord.ui.View):
@discord.ui.button(label='About', style=discord.ButtonStyle.blurple)
async def func(self, button: discord.ui.Button, interaction: discord.Interaction):
owner = self.bot.get_user(862906093373751337)
total_memory = psutil.virtual_memory().total >> 20
used_memory = psutil.virtual_memory().used >> 20
cpu_used = str(psutil.cpu_percent())
chnl_count = Counter(map(lambda ch: ch.type, self.bot.get_all_channels()))
total_members = sum(g.member_count for g in self.bot.guilds)
cached_members = len(self.bot.users)
guild_value = len(self.bot.guilds)
i = discord.Embed(description=f"**Running since:** {discord.utils.format_dt(self.bot.user.created_at, style = 'R')}\n**Uptime since:** <t:{int(self.bot.launch)}:R>",timestamp=datetime.utcnow(),colour=0xffffff)
i.add_field(name="System",value=f"**RAM**: `{used_memory} MB`/`{total_memory} MB`\n**CPU:** `{cpu_used}%` used")
i.add_field(name="Members",value=f"Total `{total_members:,}`\nCached `{cached_members:,}`")
i.add_field(name="Servers", value=f"Total `{guild_value}` guilds")
i.add_field(name="Channels",value=f"Total `{chnl_count[discord.ChannelType.text] + chnl_count[discord.ChannelType.voice]:,}`\nText `{chnl_count[discord.ChannelType.text]:,}`\nVoice `{chnl_count[discord.ChannelType.voice]:,}`",)
i.add_field(name=f"Version", value=f":python: Python `{str(sys.version).split(' ')[0]}`\n:dpy~1: Discord.py `{discord.__version__}`")
i.set_author(name=ctx.author, icon_url=ctx.author.display_avatar)
i.set_thumbnail(url=self.bot.user.display_avatar)
i.set_footer(text=f"Made with :heart: by {owner}",icon_url=owner.display_avatar)
await interaction.response.send_message(embed=i, ephemeral=True)
await ctx.send("tt",view=about())
Ignoring exception in view <about timeout=180.0 children=1> for item <Button style=<ButtonStyle.primary: 1> url=None disabled=False label='About' emoji=None row=None>:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ui/view.py", line 359, in _scheduled_task
await item.callback(interaction)
File "<repl>", line 6, in func
AttributeError: 'about' object has no attribute 'bot'
overload the __init__ and add the bot argument to it and set it as an attribute
You forgot to initialize it.
and when you instantiate the view, do about(bot=self.bot) or whatever
class about(discord.ui.view):
def __init__(self, bot):
self.bot = bot
Yeah you didn't add the bot argument
nice spoonfeed
No problem. 
Eh it's not really spoonfeed lol
Cool
cross post lol
Crossposting 🍋
Hello
hi
Why shitpost
shitpost= ban ez
i was trying cogs and this error came
Hey!
@rancid light you spelled extension wrong
extension

args would be one string
ohhh
if you want a list of strings you should do *args
mb sry for the trouble
dw happens to us all. we're cruising on by when we forget we have to know how to spell good and suddenly boom. mispell the word
this is why i use aliases.
That would take a list of strings
,* ,
Is called consume rest operator
nah it's one string "x y", *args will give you ["x", "y"]
("x", "y")
If you pass multiple strings, it will take them all
*args is a tuple
*args would convert it to tuple
okay but i am having another error
== is for comparision
ok
should be just 1
use =
= is for assignment
in main.py
import discord
from discord.ext import commands
import os
bot = commands.Bot(command_prefix = '-')
@bot.command()
async def load(ctx, extension):
bot.load_extension(f'cogs.{extension}')
@bot.command()
async def unload(ctx, extension):
bot.unload_extension(f'cogs.{extension}')
for filename in os.listdir('D:\Coding\Python\Cogs_test\cogs'):
if filename.endswith('.py'):
bot.load_extension(f'cogs.{filename[:-3]}') ```
show the cog
in cogs
import discord
from discord.ext import commands
class Example(commands.Cog):
def __init__(self, bot):
self.bot == bot
@commands.Cog.listener()
async def on_ready(self):
print("Bot Ready!")
@commands.command()
async def ping(self, ctx):
await ctx.send("pong")
def setup(bot):
bot.add_cog(Example(bot)) ```
yeah
self.bot = bot
yeah
probs tech with tim
Not ==
self.bot = bot
ok
"self.bot == bot" first error. single = is assigning, double is comparison
tech with Tim tuts are old
not him
ok
In this video, we learn about cogs and how to implement them in a discord bot.
If you have any suggestions for future videos, leave it in the comments below.
GITHUB: https://github.com/Rapptz/discord.py
DOCUMENTATION: https://discordpy.readthedocs.io/en/latest/
OFFICIAL DISCORD.PY SERVER: https://discord.gg/r3sSKJJ
JOIN MY HELP SERVER: https:...
May be old but still good enough to get a start. from there you can move on.
i tried from this ^
oh right yeah thats good too
Lucas is old too
and if you couldnt understand the examples, you lack python knowledge
or use vcokltfre.dev
If you really want updated tutorials go watch carberra tutorials
Yeah this too
how to make the song queue in the music discord bot, like if i want to play a song then queue another song, how do i do that ?
You need to use asyncio.queue class
class asyncio.Queue(maxsize=0)```
A first in, first out (FIFO) queue.
If *maxsize* is less than or equal to zero, the queue size is infinite. If it is an integer greater than `0`, then `await put()` blocks when the queue reaches *maxsize* until an item is removed by [`get()`](https://docs.python.org/3.10/library/asyncio-queue.html#asyncio.Queue.get "asyncio.Queue.get").
Unlike the standard library threading [`queue`](https://docs.python.org/3.10/library/queue.html#module-queue "queue: A synchronized queue class."), the size of the queue is always known and can be returned by calling the [`qsize()`](https://docs.python.org/3.10/library/asyncio-queue.html#asyncio.Queue.qsize "asyncio.Queue.qsize") method.
This class is [not thread safe](https://docs.python.org/3.10/library/asyncio-dev.html#asyncio-multithreading).
Thanks for pointing it out
actually now i want to make my own Queue class lol
Good luck lol



