#discord-bots
1 messages · Page 821 of 1
Yea
i do !help and it show all the function i make and the argment required and all
Discord.py does that automatically
its pretty cool
how do you get the name of a channel from its id
!d discord.Client.get_channel
get_channel(id, /)```
Returns a channel or thread with the given ID.
i want to make help commands
channel = bot.get_channe(...)
channel.name
!d discord.ext.commands.HelpCommand to the rescue
class discord.ext.commands.HelpCommand(*args, **kwargs)```
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.
is there something for help commands? in discord.py
ok
Read pins
function.helpcommand?
ok
@bot.event
async def on_message(message):
await bot.process_commands(message)
if message.content == "last.fm":
await message.reply('1. Create an account on the website https://www.last.fm\n2. Connect it to your spotify music account\n3. Go to bots and link your account by typing `,set (your last.fm username)`\n Run ,np to show what music youre listening to!')
if message.content == "i told you i was down bad":
await message.reply('you hate to see me like that')
if message.content == "strawberry":
await message.reply ('')
if message.content == "Strawberry":
await message.reply ('')
if message.content == "berry":
await message.add_reaction (r":graciestrawberry:935526687351898232") if message.content == "our queen":
embed = discord.Embed(color=0x2f3136)
embed.set_image(url=random.choice(gracie_images))
await channel.send
why doesn’t the embed part work?
i get an error
Ah yr indent
Send is a method, you need to call it
Or something idk
ye
I think they mean the yellow lines
how?
See the if statement
I c
send(embed=embed), tis just another python message
simple
ah ty
And your if should be on the next line as well inline with the others
If statement goes BRRRR
cheap ai probaly
this hurts my eyes
Discord Mobile
ye it's hard coded
no i wrote the code with my friend 😭
i did but
also yes i’m coding on my phone 💀
epic\
no
IM SO DUMB LOL
ur if statement has wrong indents
oh
but it does match the other if statements 🧍♂️
send s
i cant see indents properly cuz its phone
is it replit?
yeah
listen remove the bot token and ur presonal stuff from code for now
i did
i used a getenv file
make sure remove the bot token else u will blame me
has anyone created a task which executes exactly after minute changes in real clock
Basically when flips from 2:44 -> 2:45, then the task executes
Got it
Yeah I could, but then If i run it at 14:36:15 it will execute in -> 14:37:15, but I wanted it to execute exactly 14:47:00, and then start looping with 1 minutes. It's basically in sync with real clock then.
But I think I found solution for that
you can use d.py v2.0's time kwarg for exact time task loops iirc
Hm okay
I use disnake
I created before_loop which calculates the time between next minute, and basically sleeps until then
or you could increment by a second until it's exact
can someone help me? i'm trying to make a ticket bot, but it doesn't create the text channel. i am not getting any error, but it doesn't create the channel. my code: if reaction == "📩": await ctx.guild.create_text_channel('ticket-support')
Can you send the full command code pic?
ok
wait a minute
async def ticket(ctx):
embed = discord.Embed(
title='Create a Ticket',
description='React with 📩 to create a ticket',
color=discord.Colour.green()
)
embed.set_footer(text="Ticket System")
msg = await ctx.send(embed=embed)
await msg.add_reaction("📩")
if reaction == "📩":
await ctx.guild.create_text_channel('ticket-support')
ticket_embed = discord.Embed(
title='This is your ticket channel!',
description='A supporter will help you as quickly as possible!',
color=discord.Colour.blurple()
)
ticket_embed.set_footer(text="Support System")
ticket_channel = discord.utils.get(ctx.guild.text_channels, name='ticket-support')
ticket_msg = await ticket_channel.send(embed=ticket_embed)
await ticket_msg.add_reaction('\u2705')```
😬
whats reaction supposed to be
Your program needs to wait for the emoji
so how can i fix this?
..
📩
yes
what?
ok thanks i'll try
but how can i use that in my code?
!d discord.Client.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
but can i somehow manage to create the channel when someone reacts?
Yes
Wait for the reactions and create a channel
but i don't know how exactly
how to set slash command description in disnake
description=
^
i am lazy to go docs
it's the same like commands.command
@commands.slash_command(name="", description="")
I don't want to set slash command description, I mean option's description in slash command
sorry my bad
Where do u guys code the bot? replit?
Options take a description kwarg too
an ide/code editor , personally I prefer vsc
there's a voice channel parameter, I need for that one
i'm using pycharm
vscode
Could you explain more
!d disnake.Option
class disnake.Option```
Represents a slash command option.
Check the properties
I am new to python what platform should I use? and should I start coding the bot and learn on the way or learn python completely then code?
I have made simple programs using java bluej and c++ before
learn python
too many beginners make teh mistake of not learning python bnefore doing a bot'
there's a parameter in my code channel: disnake.VoiceChannel earlier i was enough to pop up a list of voice channels in the slash command, now descriptions are necessary so how can I set a description for it when its not an option
could you show me how? because i'm struggling with that
alr thank you! Should I learn online on any youtube?
videos aren't the best
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!videos
then?
thought there was a command talking about videos
books are prolly best
maybe
Thank you
i learned a lot with videos
yeah but if you really listen and break down the code you can learn a lot
Any book u recommend? 👀
please go to general or off-topic channels
import asyncio
@bot.command()
async def ticket(ctx):
embed = discord.Embed(
title='Create a Ticket',
description='React with :envelope_with_arrow: to create a ticket',
color=discord.Colour.green()
)
embed.set_footer(text="Ticket System")
msg = await ctx.send(embed=embed)
await msg.add_reaction(":envelope_with_arrow:")
def check(reaction, user):
return user == message.author and str(reacion.emoji) == ':envelope_with_arrow:'
try:
reaction, user = await bot.wait_for('reacion_add', timeout=60, check=check)
except asyncio.TimeoutError:
await ctx.send('You timed out.')
return
channel = await ctx.guild.create_text_channel('ticket-support')
ticket_embed = discord.Embed(
title='This is your ticket channel!',
description='A supporter will help you as quickly as possible!',
color=discord.Colour.blurple()
)
ticket_embed.set_footer(text="Support System")
ticket_msg = await channel.send(embed=ticket_embed)
await ticket_msg.add_reaction('\u2705')```
my question just went up
How do I check if a user id is in a json file?
oh thanks a lot!
You load the data from json file and check if the user id is inside it
^
^^
How so?
context manager
Like
if ctx.author.id in ".json"?
yes, but open it
Search how to load data from json
with open('file.json', 'r') as f:
...
correct me if its wrong
use context managers for this stuff
ikt makes sure the file is closed after the operation is done
Don't you need to load it first? data = json.load(f)
you put that in the with statement
mhm
with open('file.json', 'r') as f:
data = json.load(f)
yep ☝️
oops, yes
not a command ):
How do you guys do that cool up arrow symbol
^ this?
yes
just press on your keyboard xd
shift + 6
&
its on the 6 key'
Don't have that
tkl?
D:
60%*?
yeah
LMFAO
lol
wtf
i dont even see that key WTF
ˇ
I have to press alt + 1, then shift + 1
or smth
no, I have to go alt + 2, then 1
shits not even an option for me
me with android's Google Board
🗿
i love going into the rust server and seeing the craziest code to exist to mankind
rust is cool :0
Have 1200 hours on Rust
@client.command(aliases=["bal", "wallet"])
async def wbal(ctx, user: discord.Member=None):
if not user:
user = ctx.author
with open('mainbank.json', 'r') as f:
data = json.load(f)
if user.id in data:
await get_bank_data()
users = await get_bank_data()
user=user
wallet_amount = users[str(user.id)]["wallet"]
bank_amount = users[str(user.id)]["bank"]
embed = discord.Embed(title="Wallet")
embed.add_field(name="Wallet", value = f"{wallet_amount}")
await ctx.send(embed=embed)
else:
return await ctx.send("Create a bank account")```
Remove tabs behind if user.id in data:
and from there on
And make user.id as string
hmm wait
how do i make user id a string
Thanks king
it worked ☠️
Np :D
I do not recommend using JSON as a economy database
Do not make the same mistake I did
/home/container/.local/lib/python3.8/site-packages/disnake/ext/commands/interaction_bot_base.py:722: SyncWarning: Failed to overwrite commands in <Guild id=928434213538119790> due to 403 Forbidden (error code: 50001): Missing Access
warnings.warn(
whats this 
Maybe your bot doesn't have permissions to overwrite
it has applications.commands on
Hm
and the only guild id in test_guilds is the one its in (my main server) the guild id displaying in that error is my testing server, it was never in there tho ```py
client = commands.Bot(command_prefix = '.', case_insensitive=True, intents=disnake.Intents.all(), test_guilds=[838739082825564180])
Ughh I remember I had the same problem
I fixed it accidentally somehow :(
Missing the permission to do whatever you're trying to do
Oh nvm
You didn't invite the bot with application commands scope
👀 u became a rin lover too
How do I get like an user who did a command?
:/
ctx.author
@desert badger try do test_guild=idofserver
Closing strings when?"
Just add %20application.commands at the end of the invite url and u r fine
thx bud
oke
@desert badger
i did
is bot serverowner?
server owner ?
created server with bot
Yeah
yes
its working :O
;)
:D
thank u so much :)
can I msg someone has closed his DM with bot?
No
xD
Can a Discord Bot create Server invites ?
i remember someone told me its not possible / allowed
yes
yes to not allowed or yes to it can create invites
It's possible and allowed
!d discord.abc.GuildChannel.create_invite
await create_invite(*, reason=None, max_age=0, max_uses=0, temporary=False, unique=True, target_type=None, target_user=None, target_application_id=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates an instant invite from a text or voice channel.
You must have the [`create_instant_invite`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.create_instant_invite "discord.Permissions.create_instant_invite") permission to do this.
@client.command(pass_context=True)
async def createInvites(ctx, time_in_seconds,uses):
invitelink = await disnake.abc.GuildChannel.create_invite(ctx.message.channel, max_uses=uses,max_age=time_in_seconds)
await ctx.send(invitelink)
```?
I just made a command to start a watch together activity in the voice channel, and it should only work if a user is in a voice channel and the channel will be the author's voice channel, this is my code py @bot.command(name="watch-together",description="Starts watch together activity in a voice channel.") async def yt(ctx, channel: disnake.VoiceChannel): channel = ctx.author.VoiceState.channel if channel != None: invite = await channel.create_invite( target_type=disnake.InviteTarget.embedded_application, target_application=disnake.PartyType.watch_together) await ctx.send(invite) else: await ctx.send("❎ You are not in a voice channel!") I'm getting an error console disnake.ext.commands.errors.MissingRequiredArgument: channel is a required argument that is missing why I'm getting it when I have a value assigned for voice channel
pass_context is old
i found it on stackoverflow and just copied lol
how did you invoke the command
the error is clear
prefix command !watch-together
the voice channel in which I'm in
well you need to specify the channel when invoking the command
prolly the channel id
unless you make it optional
Did it work?
how to do that?
i didnt try it yet lol im lazy and watching youtube
bruh
since a few days i dont have motivation to do anything anymore lol
I think I should remove the parameter
how to check when a member joins by an invite link, getting the member of the guild who has invited him?
i copied it and just pasted it in here
ah alright
this needs quite few hacks
I'm pretty skilled xD
Google, there's a good solution on stackoverflow
is there any way i can set max uses and max age to infinite ?
well, googlin time then
:D
from typing import Optional
channel: Optional[disnake.VoiceChannel]
how do i do that 
Check docs
oke
oh thanks let me try
Is it possible to select multiple options from Select menus?
only once at a time
now another error console disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Member' object has no attribute 'VoiceState'
Huh?
yes max_uses=0 max_age=0
how would you be able to spread classes and cogs across multiple files?
just make a file for each cog
how to then connect to main file
you can load all the cogs by searching the directory where all the cogs are in using a for loop
then make sure the filename ends with .py
example please?
and load the files, and remove the .py at the end
for filename in os.listdir("./path_to_cogs_folder"):
if filename.endswith(".py"):
bot.load_extension(f"path_to_cogs_folder.{filename[:-3]}")
ah ty
for filename in os.listdir('./cogs'):
filename.lower()
if filename.endswith('.py'):
filename = filename[:-3]
try:
bot.load_extension(f"cogs.{filename}")
except disnake.ext.commands.errors.ExtensionNotFound as error:
print(f"[Error]: {error.name}.py is missing, please check so the file exists in ./cogs")
sys.exit(1)
else:
print(f"[+] {filename} has been loaded.")
Spoon feeding at its finest
don't spoonfeed
Big spoon feeding mm delicious
very
How i can send file with discord api? without discord.py
I cloned a bot from https://github.com/codeman1o1/TIJK-Bot but i cant get it to work likely one of the hidden/secret files is missing. I already made a bot token and put it in there
Why do you need to?
Why reinvent the wheel
Uh? Help?
@client.command()
@commands.has_permissions(kick_members=True)
async def mute(ctx, user: disnake.User):
for guild in client.guilds:
mutedRole = disnake.utils.get(guild.roles, name="LARPC Muted")
if not mutedRole:
mutedRole = await ctx.guild.create_role(name="LARPC Muted")
for guild in client.guilds:
await guild.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True, read_messages=False)
ctx.send(f"{user} is succesfully kicked!")
await user.add_roles(mutedRole)
await user.send(f"You have been muted in **{ctx.guild.name}** for **{reason}**!)```
you can't add roles to a User
how?
you can only add roles to a Member
camelCase should never be used in python
and ctx.send() was never awaited
quick question how do i make spaces bigger in vsc? like if i click on spaces and set it to like 4 it changes but these spaces stay like it, what do i do
oop sry
who knows
again, #editors-ides
just use visual studio code and all your problems will magic away
lol
why would you make the for loop
?
it's only gonna grab the last role named muted anyways
Huh
how do i fix it?
I think you messed up your indentation
how so..
your about me is literally incorrect
stop looking at my about me and help lavox
commands isnt defined
STOP
Y'all do know that we have talked about his About Me once in the past too, right?
camelCase should never be used in python. snake_case should be used for function and variable names
!e
for number in range(20):
last = number
print(last)
@client.command()
@commands.has_permissions(kick_members=True)
async def mute(ctx, member: disnake.Member):
for guild in client.guilds:
mutedRole = disnake.utils.get(guild.roles, name="LARPC Muted")
if not mutedRole:
mutedRole = await ctx.guild.create_role(name="LARPC Muted")
for guild in client.guilds:
await guild.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True, read_messages=False)
await ctx.send(f"{member} is succesfully kicked!")
await member.add_roles(mutedRole)
await member.send("You have been muted!")
what do I change?
@cold sonnet :white_check_mark: Your eval job has completed with return code 0.
19
only the last one
!e print(range(20)[-1])
@maiden fable :white_check_mark: Your eval job has completed with return code 0.
19
mutedRole to muted_role
y'all do not get my point
for guild in client.guilds:
mutedRole = disnake.utils.get(guild.roles, name="LARPC Muted")
```only returns the last one
OH
What's that? Sorry, ain't following with the convo
Actually the first one*
!d discord.utils.get
discord.utils.get(iterable, **attrs)```
A helper that returns the first element in the iterable that meets all the traits passed in `attrs`. This is an alternative for [`find()`](https://discordpy.readthedocs.io/en/master/api.html#discord.utils.find "discord.utils.find").
When multiple attributes are specified, they are checked using logical AND, not logical OR. Meaning they have to meet every attribute passed in and not one of them.
To have a nested attribute search (i.e. search by `x.y`) then pass in `x__y` as the keyword argument.
If nothing is found that matches the attributes passed, then `None` is returned.
Examples
Basic usage...
what's up with the loop the last guy said?
NO
IT RUNS THROUGH THE FOR LOOP AND RETURNS THE ROLE OF THE LAST GUILD IN THE LIST
okay im out
me too
so is it good or bad? 😂
bad
do I change anything in the code?
indentation
WHAT DO I CHANGE OH MY GOD MY FUCKING ARMS
Uhhh what?
how so
What happened? What do u wanna change
@client.command()
@commands.has_permissions(kick_members=True)
async def mute(ctx, member: disnake.Member):
for guild in client.guilds:
mutedRole = disnake.utils.get(guild.roles, name="LARPC Muted")
if not mutedRole:
mutedRole = await ctx.guild.create_role(name="LARPC Muted")
for guild in client.guilds:
await guild.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True, read_messages=False)
await ctx.send(f"{member} is succesfully kicked!")
await member.add_roles(mutedRole)
await member.send("You have been muted!")
pep8 police
lmao
guys just use damn timeout instead of mute
More efficient and easier to implement
imagine NOT overcomplicating
1 month cap though
😔
lmao what
!d disnake.Member.timeout
await timeout(*, duration=..., until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Times out the member from the guild; until then, the member will not be able to interact with the guild.
Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.
You must have the [`Permissions.moderate_members`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.
New in version 2.3.
you wanna mute for more time???
You can't permamute with timeout can you
Not unless you time them out every 28 days
I get this error
await ctx.command.invoke(ctx)
File "C:\Users\korisnik\PycharmProjects\DiscordBot\venv\lib\site-packages\disnake\ext\commands\core.py", line 929, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\korisnik\PycharmProjects\DiscordBot\venv\lib\site-packages\disnake\ext\commands\core.py", line 184, in wrapped
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10011): Unknown Role
I mean what's the point, just ban the member already if you want to perma mute
Well the role doesn't exists.
get() failed
they want to get all the roles named "LAPRC Muted" in all the servers, for that they run a loop py for guild in client.guilds and use utils.get to get the role assigned a variable mutedRole,
what they need : A list of roles named LAPRC Muted,
what they get : A single role named LAPRC from the last guild,
and then they try to edit the role from one server in all the servers ( which is technically not possible )
might wanna put it in a try except
fetch failed, get doesn't return a 404
back when I was using prefix commands my mute command had over 150 lines lmao
from what i read above
instead of checking if it's None
well uhh?
@client.command()
@commands.has_permissions(kick_members=True)
async def mute(ctx, member: disnake.Member, *, reason =None):
for guild in client.guilds:
muted_role = disnake.utils.get(guild.roles, name="Muted")
await ctx.send(f"{member} is succesfully muted!")
await member.add_roles(muted_role)
await member.send(f"You have been muted in **{ctx.guild.name}** for **{reason}**!")
channel = client.get_channel(801446246954827808)
await channel.send(f"{member} has been **muted** by {ctx.author} for **{reason}**!")```
there is a role with name "Muted"
just use timeouts uh
smort
Why are you iterating all the guilds
plus it says it has been muted even the user hasn't
bc im suck?
bot is only for my server 😂
get returns a user not found error.
Remove that iterator like wtf for do you need to iterate through guilds

I recommend using timeout, you are using disnake already.
You get the muted role for every guild and overwrite it every time
why are people still using mutes with disnake when timeouts are added 🏃♂️
so I remove
" for guild in client.guilds:"
and just keep
" muted_role = disnake.utils.get(guild.roles, name="Muted")"
or?
Yeah but ctx.guild.roles
just check if the role exists in the server if not create one that's it 
I can think of 2 reasons. 28 day cap and when you use a muted role you can customize the permissions
ctx.guild.roles
seems fair
you won't have to check if it doesn't exist
it's your own server afterall
yeah
There are so many "holes" in there 
sidenote, if there are multiple roles named Muted your add_roles fails
Doesn't it also crash if the user already has the role?
in that case, nothing happens
!d discord.utils.get can return a list too
discord.utils.get(iterable, **attrs)```
A helper that returns the first element in the iterable that meets all the traits passed in `attrs`. This is an alternative for [`find()`](https://discordpy.readthedocs.io/en/master/api.html#discord.utils.find "discord.utils.find").
When multiple attributes are specified, they are checked using logical AND, not logical OR. Meaning they have to meet every attribute passed in and not one of them.
To have a nested attribute search (i.e. search by `x.y`) then pass in `x__y` as the keyword argument.
If nothing is found that matches the attributes passed, then `None` is returned.
Examples
Basic usage...
That's why I said the code is full of holes lmao
Missing basic checks
Yeah i assumed, but we got timeout instead so dunno.
!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/master/api.html#discord.Role "discord.Role")s.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the added [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
can't this take a list?
Args list
.add_roles(role1, role2) #yes
.add_roles([role1, role2]) #no
Can I make it so you can mute for a certain time?
# MUTE COMMAND
@client.command()
@commands.has_permissions(kick_members=True)
async def mute(ctx, member: disnake.Member, *, reason =None):
muted_role = disnake.utils.get(ctx.guild.roles, name="LARPC Muted")
await member.add_roles(muted_role)
print(member)
print("has been muted for")
print(reason)
await ctx.send(f"{member} is succesfully muted!")
await member.send(f"You have been muted in **{ctx.guild.name}** for **{reason}**!")
channel = client.get_channel(801446246954827808)
await channel.send(f"{member} has been **muted** by {ctx.author} for **{reason}**!")```
Both are valid
would raise an exception like list has no attribute id
cough
Don't think it does.
You may try to
I'll check the source
yes ofc
!e ```py
def f(*args):
print(args)
f(*['bruh', 'brue', 'brebre'])```
@vale wing :white_check_mark: Your eval job has completed with return code 0.
('bruh', 'brue', 'brebre')
Then tbf this is coded pretty bad, doesn't take much to take in both list and args.
Is this python 3.10 feature or it has always been available
how so?
true, but unpacking the list into a tuple is not a too hard job
it has been there for a long time iirc
cause i saw it on stackoverflow some months back
I can't find an exact dat but i do have PEP 448 here from 29-Jun-2013 that also has list unpacking
I mean I thought you can only unpack tuples lol
Well tbf tuples are almost the same.
!e py a = [1, 2] b, c = a print(b, c)
@vale wing :white_check_mark: Your eval job has completed with return code 0.
1 2
Whoa nice
embed = nextcord.Embed(
colour = 0x983925,
title =f"NSFW",
description = self.language[server_language]["Error"]["is_nsfw"]
)
embed.set_footer(text=f"┗Requested by {ctx.author}")
embed.timestamp = datetime.datetime.utcnow()
message= await ctx.send(embed=embed)
await message.add_reaction('✨')```
why doesn't it able to use embed.timestamp = datetime.datetime.utcnow() ? it return NoneType: None
This used to work in discord.py 1.7.2
!e ```py
In that case this would work aswell
print(*[1, 2])
@cloud dawn :white_check_mark: Your eval job has completed with return code 0.
1 2
Nsfw 😏
You can put the timestamp in constructor
Also why not use datetime.datetime.now()
!d nextcord.Message.created_at
property created_at: datetime.datetime```
The message’s creation time in UTC.
Why even have datetime when it's already done for you.
🧍♂️ whats the point of using f on a normal string
He wants to set the timestamp of the embed 
You look much smarter.
works for that too
ctx.message.created_at does the job :p
many bugs
This is what I wrote 7 months ago. I have no idea what I wrote
what should I use instead ?
i might share my old mute/unmute command i don't guarantee it's perfect because when i did it i was still learning
Yeah
I already putted in what you should do and hikari even fed the answer :d
How tho can you get it when the message is not sent yet
🤔 is that some warning from a ide?
@vale wing
Yes that is pylint telling me I am dumb
please do, would send you my toe pics worth of $30 just back 3 years, a lot more expensive rn
leaked, no socks on 
Because the message object is already send. You use the timestamp of the command message.
wth?

You need to use the time converter. You can create own or use this if you'd like to #discord-bots message
So I just put that above everything?
Could you go to #ot0-psvm’s-eternal-disapproval or just not send those messages?
!pip time-str
this is useful too
O this thing exists
Python has strftime why use a whole module?
Strftime is not for timedeltas is it
it can convert most of user inputs like 1 day 2 week, 1d 5s 1day 3s
timedelta has .days, .hours.
And many more tricks.
You surely can convert datetime to timedelta with some magic but typically strftime is for getting datetime and not timedelta
Ah ig that could be usefull for starters.
hm
Hmm hikari's reason is a bit better. Still don't see the need to use a whole module for that.
I doubt that module has much of contents tho
You can still use the converter like the one I shared
https://pastebin.com/mrCJNmYu
My time converter when i started with dpy
though it worked out quite well (indent is bad because of the paste)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Close to none since it is not hard to do lol
70% of the code is prob meta data and comments
There's just one class and 1-2 methods it seems
Yeah 😂
hence why i said why you need a whole module for that 
Fun fact I made a module based on sqlite3 but didn't know it already has injections so I built my own injections system which is dumb af 😂
@client.command()
async def open_account(ctx, user: discord.Member=None):
if not user:
user=ctx.author
users=await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["wallet"] = 0
users[str(user.id)]["bank"] = 0
with open("mainbank.json", "w") as f:
json.dump(users, f, indent=4)
return True```
The command only creates variables in dictionary for command author and does not make one for the user even when pinged
json
11
11?
Thats the amount of users i've seen using that youtube tutorial.
hello I'm new on this server and I started developping discord bots today and i'm just here for a question, I wanted to mention the author of a message but i don't know how to do it since juste putting an @ doesnt work. Then how can I do it ? (sorry for my englidh im not a native)
yeah lol
well, my one isn't an exact copy i made some adjustments
I can help you if you want but i do recommend using a database. Your choice.
Yeah sounds like a deal
!d disnake.Member.mention
property mention: str```
Returns a string that allows you to mention the member.
Personally stepped easier into postgre than aiosqlite
postgres is relatively easy too. im messing with it also
I do like my interface.
opposite for me, probably because I had someone helping me when I started aiosqlite
Any reason why you are returning true or false
because its for creating account
if user id is already in json there'd be no reason for the command to proceed
But it's a command?
It is for creating new acc if you don't already have one
so if user.id in json file then command breaks
but, if user.id is not in json file, then it creates new acc
I get that but you can just do return no need to send boolleans
^
it's a command ^, just simply return if u don't want to proceed if user id is in json, i don't understand the point of true and false
yeah i got confused too lol
thank you but I've tried and just putting the username.mention doesnt work ('tonino#0837'.mention does not work)
I saw a page where somebody suggested getting the real id of the author but i dont understand the command)
You can do @prime bough but i recommend the .mention
like "tonino#0837".mention ?
what is the difference between Disnake's AutoShardedBot, Bot, InteractionBot, and AutoShardedInteractionBot
i am making a bot for a server, and want to mainly use slash commands. i would assume one of the interaction bots would be the best?
sharded meaning divide usually for large bots to spread the processing load and interaction meaning slash commands. Bot is a combined for bot slash and message commands.
as the name suggests Bot can be used to message commands as well, InteractionBot is based on application commands
sharded bots are used to make clusters of the bot for different servers
ahh so since this bot is just a one server, sharded bot wouldn't make sense
how can i get the number ?
property id```
Equivalent to [`User.id`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.id "discord.User.id")
thank you !
@client.command()
async def open_account(ctx, user: discord.Member=None):
user = user or ctx.author
users = await get_bank_data()
if users.get(str(user.id)):
users[str(user.id)] = {
"wallet": 0,
"bank": 0
}
with open("mainbank.json", "w") as f:
json.dump(users, f, indent=4)
``` let's reformat it a bit first
The id i assume? Enable dev mode on Discord then right click on a user.
Im looking for a web developer to help make a site for my bot.
I recommend telling about your bot, what is it, what do you got so far, what can it do etc.
okay
the thing is that what should i put at the [member] place ?
This means you should use the a member object
why does it say this i dont have a other command named help
Put help_command=None inside the bot kwargs
I am looking for a web developer to carry my web development for our bot
What does our bot do?
Our bot scans all links sent with a guild, compares them to a database of malicious links and deletes the bad ones, if its not in the database we use keywords to see if the link may be suspicious, and then it sends us a alert and we add it to the blacklist if it is
We are in 100 servers, totaling 265k members
a discord.Member object.
How to get it? -> guild.get_member(id)
on line 162?
No next to command_prefix
oh alr
assuming you would be creating help command for commands and cogs too ( since you are using bot.group) as subcommands, its better to use this
!d discord.ext.commands.HelpCommand
class discord.ext.commands.HelpCommand(*args, **kwargs)```
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.
Looks interesting, you got a link?
like this?
:/
Not too literally lol
so just
help_command=None
We have a top.gg page, but no website
Hints the need for web developer :P
i am not using cogs
Yep
thats not related to cogs, but sure
I meant bot source, also is the site just for stats or smth?
Source for the bot is private
The site would be for
Features, inviting, stats, and eventually a web panel
still doesnt work
Async API Wrapper for Phisherman.gg in Python
this is pog
Ah
this what i have
it should be inside commands.Bot
*args and **kwargs
These special parameters allow functions to take arbitrary amounts of positional and keyword arguments. The names args and kwargs are purely convention, and could be named any other valid variable name. The special functionality comes from the single and double asterisks (*). If both are used in a function signature, *args must appear before **kwargs.
Single asterisk
*args will ingest an arbitrary amount of positional arguments, and store it in a tuple. If there are parameters after *args in the parameter list with no default value, they will become required keyword arguments by default.
Double asterisk
**kwargs will ingest an arbitrary amount of keyword arguments, and store it in a dictionary. There can be no additional parameters after **kwargs in the parameter list.
Use cases
• Decorators (see !tags decorators)
• Inheritance (overriding methods)
• Future proofing (in the case of the first two bullet points, if the parameters change, your code won't break)
• Flexibility (writing functions that behave like dict() or print())
See !tags positional-keyword for information about positional and keyword arguments
mind setting the code?
Would you be interested?
setting?
I'm not such a fan of web developing. Also takes longer than coding a Discord bot lol
yes but big project with potential to grow once verified
its literally so easy, just put help_command=None inside commands.Bot
variable = Class(kwarg1=value1, kwarg2=value2)```
get some idea 🧍♂️
command_prefix and help_command are kwargs for the Bot class
Guys no need to say "it's easy" or something similar.
Don't think many people are interested if they can't see the source code of the bot.
They tell a lot about the person you are working with, experience etc.
I’d rather not just give out or project
very true, noone would be able to work on the frontend website without knowing what's actually happening in the backend
I mean if someone was joining sure they’d see it
but i’d rather not make our work public domain
Best is to make some friends in this server, that's what @manic wing also did, we had a team of 8.
Ok got it
thanks
cool, yw
ma-ma-make. -make friends?
how
Just chat, every time i chat here i usually have talked before with 1/2 people.
yea sure if you dont want to make the source public, but atleast some important information about the dependencies, what stuff you use and need for the bot& website to be specified is important
21*
I filtered out the people that were odd.
including me
and had no contribution.
i see
21 just makes it look like its alot when it really wasnt 
Am odd 😦
✅ Hates 'EM
✅ Unvaxxed
yup
Lmao, i would want a new project but i got no time rn.
😄
Now i know around 4 people here lol
hi panda
same
ive got huge exams coming up in a month
How do I add administrator check to a slash command?

Just spam @sick birch He is site expert.
how huge
@sick birch i have befriended you
Same as a normal command.
so disnake.has_permissions?
depends on the library you use but most of the library use commands.has_permissions
yea for disnake it works
Nothing wrong with be lilbit odd tho 😦
- Arch Linux user
robin doesnt know what friends are 😳
Ah true
Perfect
shush, manjaro is arch based too
i love quoting things
i dont use manjaro lol
debian or arch ❤️
Be specific tough, sometimes when you say to him make a site. He will make an api instead.
fancy
i used to
so, you have friends now
#help-dumpling message 'possable'
My dog smells like pee
How to patch bug?
mhm
Seems legit
I can be all your friend
debian for me
acc such bad advice you can use flask with php
ayo! debganggang
#help-cupcake message AHHHH PANDA DID DISCORD BOTS 2 DAYS AFTER LEARNING PYTHON
with replit
Yeah, you left out the part were i learned PHP for half a year.
debian is shit and arch equates to friendless so ill go with red hat based distros, like fedora
At python day 7 i did comprehensions.
🏃♂️
what even is php
the fuck
atleast its not ubuntu
its similar to torture but you do that to yourself and call it programming
do u know ASP? 😄
<?php
$firstvalid = 0;
$total = 0;
foreach (preg_split("#\n\s*\n#Uis", file_get_contents("input.txt")) as $inp) {
$data = "";
foreach (explode("\n", $inp) as $exin2) {
$data .= preg_replace("/\s+/", "", $exin2);
}
foreach (count_chars($data, 1) as $char => $val) {
$firstvalid++;
}
if (stristr($inp, "\n")) {
$answ = array();
foreach(explode("\n", $inp) as $p) {
for($i = 0; $i < strlen($p); $i++) {
if(preg_match('/[a-z]/', $p[$i])) {
if(@!$answ[$p[$i]]) {
$answ[$p[$i]] = 1;
} else {
$answ[$p[$i]]++;
}
}
}
}
foreach ($answ as $k => $v) {
if ($v == count(explode("\n", $inp))) {
$total++;
}
}
} else {
preg_match('/[a-z]+/', $inp, $matches);
$total += strlen($matches[0]);
}
}
echo "Part 1:<br>" . $firstvalid . "<br><br>Part 2:<br>" . $total;
?>
``` this is what i made before python, for advent of code.
🤮 that is absolute cancer
Language lol
php reminds me of old times
what is php used for
web backend
For smaller companies.
its a general purpose language
communicate with db etc
yikes
from looking at this, im not a fan
Today it's more used to make a connection then send to ajax with js.
webshells 👼🏻
!Ot 🏃♂️
» ot
» off-topic-names
e
the fail
Nice fuzzy search lol
😔 why didnt they make the commands case insensitive
@cloud dawnever tested ASP? 😄
!D discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
no wait, some of them are
I've yet to get invested into c#, but hopefully i can get a project.
Coding a c# program for a bowling ally.
@cloud dawndont even waste ur time with ASP 😄
ive done a bit of c++, but its so irrelevant and pointless
am i the only person here who prefers rust over c and c++
C# can be good to learn theres alot of jobs with it
if you're engaging in a conversation with someone you dont really need to ping them every time you say something
c++ is more usefull if you're into Arduinos and robotics.
rust is probably more useful than c and c++ these days
ok CCaeden
I prefer rust over C and C++ not C# though
@cloud dawndo they pay u well for that bowling app?
lmao u pinged him again
@quick gustyes
No clue yet i'm still a student, and also i need to also learn c# 😂
@quick gust lol
oh so you do it for learning / free time
hey!
Yeah.
dont ping! smh!
Sorry.
maybe u get free bowling sessions 😛
its ok just dont do it again!
except for the fact that the syntax is a bit weird, rust is really cool
I already work there as waiter/ bar
ooh
So i can always bowl for free xd
nice cool
any reasons for c sharp to be more preferable?
Compatibility and interface for the end-user.
I get a feeling you are american
Ah
Who is "you"?
you @cloud dawn
I'm dutch
cool, sweden here
Imagine controlling the bowling lanes with a discord bot 😏
germany here
#not-so-discord-bots-chat
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
so trap-love-calculator huh
true
.topic
Suggest more topics here!
yes, gib message intents
someone suggest more topics!
.topic
Make the api more friendly towards all coding languages and not java and js
i can drop an idea - discord chat 1-on-1 with voicechat/video/only text like strangers/omegle but on discord
I mean i can tell you why they won't do that but i'm just gonna recommend to you to go on omegle and as interests girls
i was more thinking of a server+bot doing the matching
and bots open channels for the matched onces and deletes em when done
Well bots already do that in some servers.
what
its an api, its not really friendly or not friendly
It is.
I'm assuming now you have never seen the raw api
always someone else has thought of what you thinking typical
Most likely lol
Just 9/10 times it is poor execution.
true
how can i detect if my on_message author is a bot?
message.author.bot
How to make stuff in pictures like welcome images and stuff
!pypi pillow
Blocking lib though.
Best is to use this and make your own api if you know how to.
For small bots it's fine ig
Idk :(
Can u advice something
Is your bot big or small?
Small now...
Wdym
Well you won't really notice the blocking if it is a small bot.
run_in_executor exists too btw
tyty
Blocking???
In this area python is a bit messy.
!d asyncio.loop.run_in_executor
awaitable loop.run_in_executor(executor, func, *args)```
Arrange for *func* to be called in the specified executor.
The *executor* argument should be an [`concurrent.futures.Executor`](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Executor "concurrent.futures.Executor") instance. The default executor is used if *executor* is `None`.
Example:
!blocking
Why do we need asynchronous programming?
Imagine that you're coding a Discord bot and every time somebody uses a command, you need to get some information from a database. But there's a catch: the database servers are acting up today and take a whole 10 seconds to respond. If you do not use asynchronous methods, your whole bot will stop running until it gets a response from the database. How do you fix this? Asynchronous programming.
What is asynchronous programming?
An asynchronous program utilises the async and await keywords. An asynchronous program pauses what it's doing and does something else whilst it waits for some third-party service to complete whatever it's supposed to do. Any code within an async context manager or function marked with the await keyword indicates to Python, that whilst this operation is being completed, it can do something else. For example:
import discord
# Bunch of bot code
async def ping(ctx):
await ctx.send("Pong!")
What does the term "blocking" mean?
A blocking operation is wherever you do something without awaiting it. This tells Python that this step must be completed before it can do anything else. Common examples of blocking operations, as simple as they may seem, include: outputting text, adding two numbers and appending an item onto a list. Most common Python libraries have an asynchronous version available to use in asynchronous contexts.
async libraries
The standard async library - asyncio
Asynchronous web requests - aiohttp
Talking to PostgreSQL asynchronously - asyncpg
MongoDB interactions asynchronously - motor
Check out this list for even more!
Came with Slash command
SyncWarning: Failed to overwrite commands in <Guild id> due to 400 Bad Request (error code: 50035): Invalid Form Body
Sarthak nitro gorn
could be archived thru Bot.loop.run_in_executor
full exception pls
Code? Or traceback?
SyncWarning: Failed to overwrite commands in <Guild id=894630645547024536> due to 400 Bad Request (error code: 50035): Invalid Form Body
In 0.options.0.description: This field is required
In 0.options.1.description: This field is required
use the old disnake method for slash commands
I think you are using a different command.
I use async function
Doesn't mean the module will be async automatically.
Im confused
Which one
same
Just use pillow
But u say create ur own api??
Well I had two slash commands, i removed the other one and the problem stands
if you use a non asynco with asyncro it will block
Ok
they have an option without description,which is no longer supported by discord py @slash_command(description='qerts') async def my_slash(interaction, option): is no longer working
Pillow is non asynco??
Since when?
Bruh it started working randomly
Also await inter.send() is enough you don't need the whole response.send_message etc
Alright
Thanks
and its for some other command, not this one
Since when is the new one invalid? Since if it is just don't use slash since this old method is very bad.
yes, thats why panda told u it will block
If you use the old method you can almost better make a raw api request lol
Ok then??
It won't be noticeable for small bots, only bigger bots can notice blocking.
@nimble plumei dunno but google gave this https://pypi.org/project/asyncimg/
Ok but wdym by bigger bots
if alot uses bot it will clog up af
bots in alot of servers..... (7-8k+ usually)
Oh
0.0.1 (3/8/2020)
Release (Buggy)
1.0.0 (3/8/2020)
Working release
``` he went from 0.0.1 to 1.0.0 in less than a day, not sure about this one chief
you can do ur bot only for that, and have another bot for moderation e.q
Yesterday Discord changed the validation of slash command options. Empty descriptions and descriptions with invisible symbols are no longer allowed. Since disnake inserted \u200b as a default value of slash command descriptions, old versions no longer allow to register commands with options that miss a description. We released a fix that returns everything back to normal.
This is a critical issue, so we updated both 2.2.x and 2.3.x branches in order to give big bots an opportunity to apply the fix without switching to newer versions.
this was the announcement, im sure its related
oh i didnt look that much into it but thats sketchy indeed
Cant we do both in same
when ur bot gonna process pic, and someone gonna ban or something sametime the ban will take tiime till processed is done
Oh
hey
import discord
import random
Token = "nothing"
client = discord.Client()
@client.event
async def on_ready():
print("logged in ;beep boob; as {0.user}".format(client))
@client.event
async def on_message(message):
if message.author == client.user:
username = str(message.author).split("#")[0]
user_message = str(message.content)
channel = str(message.channel.name)
print(f"{username}: {user_message} ({channel})")
if message.author == client:
return
if message.channel.name == "gogogaga":
if user_message.lower() == "hello":
await message.channel.send(f'Hello! {username}')
return
elif user_message.lower() == "bye":
await message.channel.send(f'bye! {username}')
return
elif user_message.lower() == "!random":
response = f"This is the random number: {random.randrange(1000000)}"
await message.channel.send(response)
return
if user_message.lower() == '!anywhere':
await message.channel.send("this message can be used anywhere")
return
client.run(Token)
That's what hikari suggested with the executor
why that doent work
Thanks for the info.
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
!code
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.
this s$$$ aint working no more
were you talking about a syntex change or smth?
Sucks to be 3th party users lmao
username = str(message.author).split("#")[0] :S
yea the implementation of the options
or just try to update disnake and see if its fixes the issue
username = message.author
This returns name + descriminator
Pls reply or ping me if u are saying to me ...
$pip install -U disnake```
yeah but can just do message.author.name or if its .nick
I think nick is for the nickname in the server.
thats display_name ?
Thanks bro, the update fixed it @slate swan
how can i send in an embed a server's static (not animated) emoji?
yeah like this one in this server:
Bot.get_emoji(id) or \emoji and get the escaped name of the emoji
<a:emoji_name:emoji_id> and remove a: if non animation i think
That emoji id is 439516188771483658
Imagine the amount of duplicated emoji's in their database lmao
copy link of emoji to gets it id's
80% certain they have some kind of imaging filter to remove dupes and merge their id's
Ill create a different bot for server design
<a:name_of_emiji:id_of_emoji>
Im looking for someone to join my bot development team and make the website for it
Already working for one sorry
perfect time to test out django? 😄
^ good learning experience to try it out yourself
You would also need your own oauth later then i f he wants a dashboard.
Though I personally think JavaScript frameworks are better for the job but I never turn down a learning opportunity
oh i thought he just wanted a simple website
I have no clue how to code at all lmao
but you wanna run a project xD?
no, I run a project
Agreed, but if you want a dashboard i'd recommend making the bot in js as well then.
I can market, handle seo n stuff
Unfortunately the bot for us is using disnake and we use next for the website 😂
i pretty sure all who makes websites knows seo too
Yeah super cursed.
whats one more :P
dont you use github for your project tho?
But tbh it’s mostly just changing or adding entries to a database which I just use PrismaORM for so it’s not too bad
Us? Yeah it’s open source
Time these days are pretty valuable.
@sick birchnah zachry
Ah
Like all things should be 
wat
Anything non OSS is cringe
Rip apple
i think windows should be open source 
Yet I still use a MacBook
Windows gets open source once they don't get updated anymore.
didnt they release some old windows as opensource? 😄
Not voluntarily lol
i have to look down at you guys
oh hahahaha yikes
Think about the chad who remade windows 98 inside js
wish windows10 or 11 was opensource 
is it possible to make a bot dm someone it's in a server with without that person triggering an event like send message or react?
trying to make my bot dm me every time it joins a server
98 and 2000 was my favs
like on_member_join?
realistically you wouldnt do anything if it was open source
!d discord.on_guild_join
discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") is either created by the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") or when the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") joins a guild.
This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
every time the bot joins a server: on_guild_join
every time anyone joins a server the bot is already in: on_member_join
find all CIA tools xD
!d discord.ext.commands.Bot.owner
No documentation found for the requested symbol.
no when the bot joins any server it dms me the server it joined
so I can keep track of servers it's in
owner_id
ok I guess?
on_guild_join() for when bot joins a new guild
thats on_guild_join
I did not know we needed to repeat all the answers
😄
yes I know that my question is how do I make it dm me when it does that
just tell bot to send you a message
discord.on_guild_join use this then discord.ext.commands.Bot.owner_id or discord.ext.commands.Bot.owner_ids if you use that then just use get and then use discord.User.send
fetch it by id or something
you can send a message to a user the same way you send to a channel, get the user then send to that object ^ as panda explained above
What? Just use the bot owner kwarg.
by what function
remember you don't need a member object, a user object is enough
oh alr I'll look for that
!d discord.ext.commands.Bot.get_user
get_user(id, /)```
Returns a user with the given ID.
kk thnx
yeah or await self.bot.fetch_user(theid)
I guess something along the lines of _bot.get_user(_bot.owner_id).send("i joined a guild")
Don't need to fetch it.
it's most probably in cache, so rather handle that than make an extra API call
Most likely that the bot owner will always be in the cache.
ah true
disnake getch guys, revolution.
g-getch?
huh?
!d disnake.ext.commands.Bot.getch_user
await getch_user(user_id, *, strict=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Tries to get the user from the cache. If fails, it tries to fetch the user from the API.
aah nice
nice indeed
yeah if seen many otherwise use like u = get_user() or fetch_user()
They removed that it will be added to the cache if it wasn't :DDD
Now this function is absolute god
I made a my own function.
But now i use that.
that wasnt bad thinking tho, then u no need worry about what
Yep this function is disnake only tough.
basedfork
Partly because me and hunter cried about it lol
😄
👋
sometimes crying paysoff 😛
chellow
how are you guys