#discord-bots
1 messages Ā· Page 31 of 1
ty
did not work
Is there a way to check if someone is server muted?
what now?
in voice?
yes
hold on
!d discord.Member.voice
property voice```
Returns the memberās current voice state.
!d discord.VoiceState.mute
Indicates if the user is currently muted by the guild.
client event?
no?
I need a client event
I need something to check if someone is server muted by me
And if Someone tries to unmute them, Mute them instantly
i guess message was edited in DMs cus that member doesn't exist, probably try fetching it, maybe that'll somehow help (user = await after.guild.fetch_member(after.author.id))
it wasnt in DMs bc I edited it in the server
yes
on_member_update event will check if member is updated including VoiceState, check if before.voice != after.voice to make sure that VoiceState was edited, then check if before.voice is not None and after.voice is not None to not get into any errors and after that check if before.voice.mute == False and after.voice.mute == True. Checking if you muted the member is... um.. a bit of a cluster fuck, but to do so you need to get the last element of audit logs and check if augit_log_entry.user.id == your_id, then you do what you want
in case you didn't understand anything: I can't explain further
How is it possible to do this?
.epoch
**```
.epoch [date_time]
*Convert an entered date/time string to the equivalent epoch.
**Relative time**
Must begin with `in...` or end with `...ago`.
Accepted units: "seconds", "minutes", "hours", "days", "weeks", "months", "years".
eg `.epoch in a month 4 days and 2 hours`
**Absolute time**
eg `.epoch 2022/6/15 16:43 -04:00`
Absolute times must be entered in descending orders of magnitude.
If AM or PM is left unspecified, the 24-hour clock is assumed.
Timezones are optional, and will default to UTC. The following timezone formats are accepted:
Z (UTC)
±HH:MM
±HHMM
±HH
Times in the dropdown are shown in UTC*
Ends in is time tag <t:1102980123123> (see more info here: https://gist.github.com/LeviSnoot/d9147767abeef2f770e9ddcd91eb85aa)
.epoch in 14 hours
!d discord.Embed.timestamp this is the Tomorrow, ... below
The timestamp of the embed content. This is an aware datetime. If a naive datetime is passed, it is converted to an aware datetime with the local timezone.
^^
I have an embed which has select menu on it and i made add_item with class but why every time i change the code to fix error and restart the bot, i should type the command again so the bot to generate new embed with menu? And the previous menu i generated is not working anymore
that's just how it works, menus are granted to the sessions of your bot, when your restart it you close the old session and open new one
But with buttons this doesnt happen. With buttons i just added add_view in the on_ready and i dont have to generate new embeds with buttons
@silk fulcrum i fixed it
I used before.author instead of after.author and for some reason it worked
oh yeah forgot about add_view existance, well, it adds a View and view contains buttons and select menus, all of them, what's the problem? you add view with select menus and it doesnt work after restart?
I haven't tried it yet. Let me try it
Do i have to make a class with add_item?
idk? just make a view?
I removed the add_item class but i got error
TypeError: expected an instance of View not <class 'cogs.auto_roles.menu'>
how can i fetch a channel and post a message in a non-async function?
idk what "add_item class" means
noway
class selectmenu(discord.ui.View):
def __init__(self):
super().__init__()
self.add_item(menu())``` š
Looks like you might have a naming conflict
can i thread with a async function?
True
wdym thread?
the threading lib
You can send a message using the requests library and the raw API
how
Hey! I just found out, if a server doesnt have a server profile my bot spits a error... How can i make it that if the server has no profile it just disables the embed.set_thumbnail...?
if server.icon is not None:
embed.set_thumbnail(server.icon.url)```
that's if you use dpy 2.0
i have the server moderation set for that, i just want the role to be assigned to them after the 10 minutes because if i assign it beforehand, then it bypasses the server moderation
how do i send a message/embed via the api not dpy
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute == True and after.voice.mute == False:
I'm stuck here
@client.event
async def on_member_update(before, after, member):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute == True and after.voice.mute == False:
await member.server.mute(member)
let me see
I want to check if a member is server muted, And if someone else other than me tries to unmute them, The bot should mute them back
aight I wasted like 5 mins but my message seemed rude so I decided to delete it and type this:
get server's audit logs, get it's last entry by augit_logs[0] and check if audit_entry.user.id == ur_id
would guild.mute work?
wtf is augit_logs[0]
*audit
read the docs
BRUH
!d discord.Guild.audit_logs
async for ... in audit_logs(*, limit=100, before=..., after=..., oldest_first=..., user=..., action=...)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") that enables receiving the guildās audit logs.
You must have the [`view_audit_log`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.view_audit_log "discord.Permissions.view_audit_log") permission to use this.
Examples
Getting the first 100 entries:
```py
async for entry in guild.audit_logs(limit=100):
print(f'{entry.user} did {entry.action} to {entry.target}')
```...
why do I have to send this? it could've even not helped
@silk fulcrum i need your help but i'll let you finish first with Jason Statham
Ok
help with what
So
bruh that bug on my screen is annoying
@client.event
async def on_member_update(before, after, member):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute == True and after.voice.mute == False:
await member.mute()
What would this do?
just test it
you cannot get member from on_member_update
you either use after or before, they're both Member type
How do I mute the member then?
b u
r h
HOW DO I AWAIT IT THEN
AWAIT AFTER.MUTE()
thats what i was going to say
š¤¦āāļø
LIKE NORMAL TEXT?
with keyboard
ohhh my cat is so cute))
Can i say now my problems master?
yes I guess
ok
rapgodmaster32 not defined
sit tight š
It doesn't work
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute == False and after.voice.mute == True:
await after.mute()
IF THE MEMBER IS ALREADY MUTED, AND SOMEONE TRIES TO UNMUTE, THEN MUTE THEM AGAIN
WHY IS IT SO HARD TO DO IT?
Just use if statements
Please stop shouting
jk
work with if statements and else
Just be respectful of other members
switch False and True places if you want to just mute them again
don't check if before != after
that already means the guy switched channels
and that has nothing to do with mutes
this is endless, i need help, can someone dm me?
why don't you just send your problem?
shy?
It doesn't work
I already tried 3 times
.
feelin ignored
No i didnt send it cause the only thing is sent is It doesn't work
then send what doesn't work
why doesn't it?
before.voice and after.voice are voice channels
a voice channel can't be on mute, just the guy
I have embed with menu for auto roles. The max_values is equal to 7 => max_values=7. I want when I select for example 3 roles, the bot to make 3 separate replies that i got role1, role2 and role3. But my code doesnt work like that. The way my code works is when i select 2 roles, it only adds the first role and it replies only for the first role
are they?
something like this
what's your code
is it ok if i send you a structure of my code?
Can someone help please?
ig?
do you have any errors?
.
no
!d discord.VoiceState
class discord.VoiceState```
Represents a Discord userās voice state.
so, what are you doing to get this to work? muting some member in a voice channel and then unmuting him? @crystal glen
NOOOOOOOOOOOOO
If someone is already muted, And someone tries to unmute them, Mute them again
Simple
I got this already, but I'm asking what are YOU doing to run this code?
your true and false are backwards
bruh
your statements evaluate now, to if the user was not muted before and now they are, to mute them
Just like I usually do
if before.voice.mute and not after.voice.mute:
await after.mute()
i already said him to change places, ig he did it (I hope)
ok I don't see a mute attribute on member
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute == True and after.voice.mute == False:
await after.mute()
Current code
it should be
await member.edit(mute=True)
changed to ```py
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute and not after.voice.mute:
await after.mute()
yeah agreed
bro...
also I do not see where the .mute() function exists, only the attribute. Have you subclassed the discord.Member class somehow
You know what?
a method is also an attribute
Fuck this, Thanks for the help
callable one
did it work tho
NO!
have you tried what I said
No
try it
oh, sounds so tragic, but... alright i've already been too rude ig
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute and not after.voice.mute:
await member.edit(mute=True)
await edit(*, nick=..., mute=..., deafen=..., suppress=..., roles=..., voice_channel=..., timed_out_until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the memberās data.
Depending on the parameter passed, this requires different permissions listed below...
member is not defined
after š
HE SAID TO USE HIS SHIT
well
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute and not after.voice.mute:
await after.edit(mute=True)
DONT YOU SEE THAT YOU DO NOT GET MEMBER FROM ANYWHERE SO YOU SHOULD USE SOMETHING THAT IS INSTANCE OF IT?
now everyone's shouting
I TRIED USING IS AS AN ARGUMENT, AND YOU SAID IT WOULDN'T WORK
I'm getting a headache
AND THIS GUY WHO HE THINKS HE IS COOL, SAYS TO USE MEMBER.EDIT
Bro how do you get a headache from caps? š
I am cool š
because on_member_update takes arguments before and after
@cold sonnet is not cool then
Okay
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute and not after.voice.mute:
await after.edit(mute=True)```
good?????????????
did we solve your problem though
yes
why he can caps cus he is emotional and I can't?
STOP TALKING jk
This doesn't work
I have a cat hahaha, slaughtered
now you're joking
use viagra then
oh wait he's not here(
is he dead?
error?
No error
you had no error even before
- you have an error handler and it sucks
- code doesn't get past the if statements
how about some else statements
spoonfeed meeeeeeeeee
why does it not send this? but gives me the error again?
!rule 8 ig
8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.
@client.event
async def on_member_update(before, after):
if before.voice != after.voice:
if before.voice != None:
if before.voice.mute and not after.voice.mute:
await after.edit(mute=True)
else:
print("messed up at 2")ā
else:
print("messed up at 1")
Who made this rule again?
like this
can we see the surroundings of this code?
where is this?
nvm
well it does tell you where the problems are occurring so maybe start there @crystal glen
however, I would wish you luck if you keep yelling at everyone trying to offer you assistance š
I know @silk fulcrum And we both were joking, And can you stop defending people with no reason?
And he was the first one who shout at me, Right @silk fulcrum šŖ
before.voice seems to be the same as after.voice
So what do we do?
because you have the @commands.is_owner decorator, it looks like you will be getting that flag first no matter what.
you can try to omit that line and just use your try/except or you could use an error handler
you don't check for the error there, you check for it in an error handler
if your bot is not the owner, the code doesn't start
you shout at me, i responded with the same, im not the best person to ask about holding emotions, im 13
however, because your try would succeed, it means the except would never flag and certainly not for a NotOwner exception
check if before.voice == after.voice
!d discord.Member.voice
property voice```
Returns the memberās current voice state.
STOP BEING 13 AND GIVE ME 100 PUSHUPS RIGHT NOW
please don't, then.
orrrrrr?
i'm a member here too?
im getting muted?
oh, but your name has color
that means you're a special member
like this?
@client.event
async def on_member_update(before, after):
if before.voice == after.voice:
if before.voice != None:
if before.voice.mute and not after.voice.mute:
await after.edit(mute=True)
else:
print("messed up at 2")
else:
print("messed up at 1")
Thanks! This worked
should be it, I'm trying to find how comparisons between VoiceStates work, it's usually in the docs
so u r using me
great...
what
If ctx.guild.get_role(id) in ctx.aothor.roles
Any better option and what's maping ?
Doesn't give any error
normally dataclasses will have the supported operations listed, but VoiceState doesn't... surely it isn't missing a __eq__ method... right?
And it doesn't work either
not in docs so I don't know, I'm gonna look at src code once
in your case maping meant this ig [do_stuff_with(element) for element in list]
Ohh k , What's maping in general
maping = maping
cap = cap
Any link so I can read more about it
a class like VoiceState should have defined operations, people don't know if it's checking if all attributes are the same, or just the channels
Soooo, Should we give up now?
no you should add an else statement for the 3rd if
and then you should tell if you have a horrible error handler
that's mapping in general
@client.event
async def on_member_update(before, after):
if before.voice == after.voice:
if before.voice != None:
if before.voice.mute and not after.voice.mute:
await after.edit(mute=True)
else:
print("No change")
else:
print("messed up at 2")
else:
print("messed up at 1")
```2
yes
good fucking question
before.voice is None
indeed interesting
ur wlc
Can we give up now?
Or there is hope?
(āÆĀ°ā”°ļ¼āÆļøµ ā»āā»
(āÆĀ°ā”°ļ¼āÆļøµ ā»āā»
Custom Help command is complicated
yes
š³
ofc
client = commands.Bot(command_prefix=['?'], intents=discord.Intents.all(), case_insensitive=True, owner_id=982551216196317214)
elif ctx.channel.id != 1005827207815495791 or ctx.channel.id != 1007113905178427482:
await ctx.reply("")``` is this the correct way to check the channel id?
guild.channel probably
yes, if you want to check if the message was not written in those channels
š
if ctx.channel.id not in (id1, id2) would be better ig
stop swear
better?
it looks like you will have to compare individual attributes of VoiceState because the TypedDict operations are a bit tricky sometimes to quote the python docs: ```A TypedDict type A with no key 'x' is not consistent with a TypedDict type with a non-required key 'x', since at runtime the key 'x' could be present and have an incompatible type (which may not be visible through A due to structural subtyping).
yes
Thanks for the help, it doesn't work, im gonna go to sleep, xoxo, love u all, no homo, bye.
one more thing...
BYE
BYE
bye, and please try to be less disruptive next time you participate
Ily too
How do I access the ScheduledEvent ID inside of the scheduled_events list?
[<ScheduledEvent id=123Numbers name= NAME >] ---> It is a list with angled brackets <> so I cant access it with [0] it seems (because [0] gives me the name instead of the ID)
list[0].id?
how can i send a message without dpy but with the actual discord api
Thank you stranger 
Integrate your service with Discord ā whether it's a bot or a game or whatever your wildest imagination can come up with.
check out the official discord api docs
How do I make like a login system that will immediately be able to let the user execute the commands and get his/her htb details without having to execute the same $htbacc command again&again
Like it will give that user, private session with the credentials he provided
How can i change 603 seconds into 10.3 minutes
What do you mean by login in again and again? After x amount of time or when the bot restarts?
divide by 60...
!e
time = timedelta(seconds=603)
print(time.minute)ā```
@novel kelp :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 4, in <module>
003 | AttributeError: 'datetime.timedelta' object has no attribute 'minute'
@bot.command()
async def htbacc(ctx,email,passw):
login = htbfunc.Client(email,passw)
@bot.command()
async def htbsearch(user):
login.search(user)
!e
from datetime import timedelta
time = timedelta(seconds=603)
print(time.minutes)
or perhaps something like this
@novel kelp :white_check_mark: Your 3.11 eval job has completed with return code 0.
0:10:03
!e ```py
from datetime import timedelta
time = timedelta(seconds=603)
print(str(time))
@cloud dawn :white_check_mark: Your 3.11 eval job has completed with return code 0.
0:10:03
Don't want tha hr think
is it possible to use another variable in an asynchronous function?
wdym?
this
No clue as of what this does.
use a variable in a function defined in another function?
How is 603 sec 10.3 minutes?
@somber garnet
!e print(603/60)
@cloud dawn :white_check_mark: Your 3.11 eval job has completed with return code 0.
10.05
. = :

yea
you could use a global var
When adding functions or classes to a program, it can be tempting to reference inaccessible variables by declaring them as global. Doing this can result in code that is harder to read, debug and test. Instead of using globals, pass variables or objects as parameters and receive return values.
Instead of writing
def update_score():
global score, roll
score = score + roll
update_score()
do this instead
def update_score(score, roll):
return score + roll
score = update_score(score, roll)
For in-depth explanations on why global variables are bad news in a variety of situations, see this Stack Overflow answer.
it's not a good practice but i can't think of other ways
yes but he can't call the function in his case
!e
from datetime import timedelta
time = timedelta(seconds=603)
print(time.days)
603 sec is 10.05 minutes.
@novel kelp :white_check_mark: Your 3.11 eval job has completed with return code 0.
0
It's 10:03 second sir
!e
from datetime import timedelta
time = timedelta(seconds=603)
print(time.seconds / 60)
Not if you think of a seconds as 100.
F
@novel kelp :white_check_mark: Your 3.11 eval job has completed with return code 0.
-999999999 days, 0:00:00
!e
from datetime import timedelta
time = timedelta(seconds=603)
print(time.hours)
@novel kelp :white_check_mark: Your 3.11 eval job has completed with return code 0.
10.05
@novel kelp :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 4, in <module>
003 | AttributeError: 'datetime.timedelta' object has no attribute 'hours'
!e ```py
def sec_to_min(seconds) -> str:
return f".".join([f"0{x}" if i == 1 and x < 10 else str(x) for i, x in enumerate(divmod(seconds, 60))])
print(sec_to_min(603))
@cloud dawn :white_check_mark: Your 3.11 eval job has completed with return code 0.
10.03
So they would be able to write their own python inside a command?
Kind of like a saved eval command?
yikes
#bot-commands
hello im using nextcord and i want it that if u click buttons they become disabled
i tried using callback
WHAT DOES THIS MEAN
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: RuntimeError: coroutine raised StopIteration
nvm
Ah
how long does a discord rate limit last?
like as in u cant use the button anymore?
nvm im not really qualified to help anyone
usually less than a day
FYI Already been answered in #python-discussion a while ago
It's specified in the headers
how do i use intents without commands š
how do i specify intents for bot = discord.Client()
read thy documents
I saw people naming commands.Bot as client but .Client as bot 
lmao
homie following the outdated YouTube tutorial
i dont want commands in my bot
ok? read discord py documents
pass_context=True
its a kwarg lol
you would do discord.Client(intents=intents_instance)
thank you
you're welcome!
we all love that option, dont we
:kek:
:XD:
:ot_talks:
:moyai:

:redTick:
i cant find anything that actually changes nickname the changenick checks if a person can change it
!d discord.Member.edit
await edit(*, nick=..., mute=..., deafen=..., suppress=..., roles=..., voice_channel=..., timed_out_until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the memberās data.
Depending on the parameter passed, this requires different permissions listed below...
imagine having a kwarg named as nick instead of nickname 
imagine talking about naming conventions
Probably called just nick instead of nickname because in the discord API the guild member object has a nick field, not a nickname one
it has admin
probably your bot's role is lower than member's top role in hierarchy
theres literally no roles
then your bot doesnt have the perms 
hmm it cant have admin if it has anything else š
omg it was tryna nick me when im owner im stupid
Happens
I keep getting this error when i start up the music bot
It started to happen out of no where. This bot has been up and running for 3 days and just started happening
this is a python server
š i forgot
im sorry š
Its ok, good luck solving your error!
okimi
snip
It's*
instead of fixing my grammar why dont you fix the persons error? dont you know JS?

she's too pythonic to be fluent with JS
skill issue
Yes I asked here before I asked in general sorry for confusion
@slate swan nice pfp 
i can say the same for you
still a nice pfp
no
why not
your cat makes my day better
his mad look makes me less mad
lmao
you have me added and you are my friend dm me it

š³
how do i help with an undefined error š more like what's there to help in an undefined error
^
nice
mental help
mental issue
i got allot
wtf why did this ss appear
didnt my cat fix most of them?
most of them, yes, not my heart, only hunter can, hes still playing with my feelingsš āļø
does someone know why this doesn't show up? I already put it there like 3 days ago
how to make that if user not sent message in 10 seconds, bot will send "time is up"?
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html?highlight=wait_for#discord.ext.commands.Bot.wait_for here there is example of timeout
you just wait_for message
and set timeout to 10 secs
and except TimeoutError: send "time is up"
else: continue

this is perfect, thank you
Probably a client bug?
Is the cog called onlin?
I'm pretty sure you're making a typo.
Read the error
You're trying to start cogs.onlin
[:-4]
onlin|e.py
You're removing the last letter I believe
in code it's -3 which is correct
but errors says -4
lmao
from file name
you're listing all the files in /cogs to load them and to remove .py you somehow use [:-4], which removes .py and one more symbol behind it
yes, as I see in code that's what you do but error says -4
šļø
it prints "bot ready" and then i send message in server with this bot, but it doesnt continue
why would you need check=lambda msg: True
i thonk that check has to be..
also it's wait_for 'message', on_message is an event reference
ty
Hey guys, I'm creating voice functionality for my Discord bot and so far I've managed to get it to play audio in a VC when running the bot locally. However, after deploying to Heroku, it does not play the audio. I am using YoutubeDL to stream audio from YouTube.
I have the following build packs in my Heroku app:
Try :-2 then :p
this is messed up
can you send a screenshot on how your project files are named?
hmmmmmmm
you know what
try doing f'cogs.{fn.replace(".py", "")}' instead
eugh
you made a typo somewhere
try refreshing your replit tab
how to get user and tag ?
kill 1
in shell
o idk
just add try except:pass
You have to enable applications through the portal
You have to add @commands.has_permissions underneath your command
W
Underneath? What do you even mean by that
Let it sync ig
How long have you waited
Also try listing all commands and seeing if the bot has it
!d discord.ext.commands.Bot.commands or smth
property commands```
A unique set of commands without aliases that are registered.
!rule 9
below the @zenith sage.slash_command
"theory" is not the word to describe, typehints
i think what okimmi means is that they are not meant to do anything during runtime
yes
Nice ping
File "C:\Users\Windows\Desktop\Nova pasta\xdxd.py", line 1, in <module>
import discord
File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\__init__.py", line 25, in <module>
from .client import Client
File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 53, in <module>
from .webhook import Webhook
File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\webhook\__init__.py", line 12, in <module>
from .async_ import *
File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\webhook\async_.py", line 52, in <module>
from ..channel import PartialMessageable
ImportError: cannot import name 'PartialMessageable' from 'discord.channel' (C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py)
error, its running another files
my code its just import discord
do you have any third-party libraries installed that add functionality to discord.py?
i can send the pip freeze
I forgot how to make custom command errors? Do I use this:
@ban.error
async def on_command_error(self, ctx, error):
if instance(error, commands.CommandOnCooldown):
await ctx.send("my error message")
Hey @red fiber!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
https://paste.pythondiscord.com/hinupizosi @vocal snow
i see py-cord
ah
if Iām error handling in a cog, do I still need the self parameter?
yes
ty
Is there any event in dpy which triggers when the bot stops?
how will the code trigger when the bot stopped
No but u can subclass it and override close
I mean a event which gets triggered when bot disconnects
Or get rate limited
!d discord.on_disconnect
discord.on_disconnect()```
Called when the client has disconnected from Discord, or a connection attempt to Discord has failed. This could happen either through the internet being disconnected, explicit calls to close, or Discord terminating the connection one way or the other.
This function can be called many times without a corresponding [`on_connect()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_connect "discord.on_connect") call.
This?
Will it be triggered when bot gets disconnected?
Probably
Which argument do this event takes?
from discord.ext import commands
ImportError: cannot import name 'commands' from 'discord.ext' (unknown location)
Nothing
who can help?
- make sure you got no folder locally named as
discord - reinstall dpy if the above step is not true
Btw, how do I make this override my error handler in another cog?
why would you do that?
you can make cog-specific error handlers
Can I not make it command specific?
Both my errors are being sent. The embed is from my error handler (in another cog - events.py) and the normal text is from my @revive.error decorator.
Yeah.
does it need to be global?
It handles all my command errors. I just want to make it so I can override them and send custom errors for different commands instead of always relying on my global command error handler.
if not, I'd suggest making that cog-specific or command specific. If it does, you'll need to add some logic to ignore exceptions coming from commands which have error handlers
!d discord.ext.commands.Command.has_error_handler
has_error_handler()```
[`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.10)"): Checks whether the command has an error handler registered.
New in version 1.7.
ashley typing fcking lord of the rings
you can create error events for specific commands like so
@commands.command()
async def cmd(self, ctx): ...
@cmd.error
async def cmd_error(self, ctx, error): ...
# in the global error handler
if ctx.command.has_error_handler(): pass
I am a slow typer on phone zeffo
Hi how do i start programming discord bots
I already have the discord bot setup but i dont know how to programme it š
Do you know python basics?
kinda (still working on making an objet move š¦
that message needs to be pinned here
'NoneType' object has no attribute 'url' // like user have defult pfp
discord defult
!d discord.User.display_avatar
property display_avatar```
Returns the userās display avatar.
For regular users this is just their default avatar or uploaded avatar.
New in version 2.0.
its a url right ?
i have to use it in embed !!!
the documentation is there for you to read
why
This is more in the context of, "How much Python you need to know until you can ask a question here".
lmao yeah
spamming mentions... in thread named "spam"...
spamming mentions of myself account...
It's called spam because that's their ot not literally a spam channel.
it's cus i didnt read RoboDanny's source code and didnt see mentions autoBAN
Just ask one of the mods to unban you and explain the situation.
Not necessarily
Itās sort of gatekeepy and we all know the culture in the discord.py server isnāt the greatest
The first pinned message in this channel is our stance on it
How is it gatekeepy, learning the stuff you're going to need beforehand just accelerates the process
It's up to the individual whether they want to do it or not
his message plainly says, "certain knowledge is required before you can actively participate in the help channels"
view=View, view=view
think about it
2 views in one message is not possible, especially double using a kwarg
Another example of how much time can be saved by simply understanding of how things work before using them š¤·
:true: + :agreed:
why you even discussing that kind of stuff here
Read the prior messages
I meant something else by that but okay
Oh okay i understand what you meant
well it comes up often, hence why we have 2 pins specifically addressing gatekeeping
MySelect is most probably a ui.Select subclass and is NOT a view but a component, so you have to add the component to the view View.add_item to be able to send the dropdown
You should stop gatekeeping with all those fancy words š
sucuk=View š wth is even that kwarg
custom kwarg?
May I ask why
@vocal snow I edited it a little bit, is it good enough? Because, if I just send this message here I might seem rude to someone
I think just keep the part which lists the recommended prerequisite knowledge
Looking at traceback the send failed and it's not custom
/home/container/main.py:41: DeprecationWarning: The object should be created from async function
self.session = aiohttp.ClientSession()
I have this error always come up on my console when I run my bot. Iāve tried to put self.session = aiohttp.ClientSession() in a setup_hook but that doesnāt work, when I try to use self.session because it would say itās not defined.
well you can only use the session after the bot has been started
because only then will there be an event looop
so you should define it in the setup_hook
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Member' object has no attribute 'avatar_url'``` Why it give me this error
@bot.command() async def user(ctx,member: discord.Member): roles = [role for role in member.roles] embed = discord.Embed(colour=member.color,timestamp=ctx.message.created_at) embed.set_author(name=f'User Info - {member}') embed.set_thumbnail(url=member.avatar_url) embed.set_footer(text=f'Asked by{ctx.author}',icon_url = ctx.author.avatar_url) embed.add_field(name=id,value=member.id) embed.add_field(name='Guild name:',value = member.display_name) embed.add_field(name='Created at:',value = member.created_at.strftime('%a, %#d %B %Y')) embed.add_field(name='Joined at:',value = member.joined_at.strftime('%a, %#d %B %Y')) embed.add_field(name=f'roles ({len(roles)}',value=''.join([role.mention for role in roles])) embed.add_field(name='Top role:',value = member.top_role.mention) embed.add_field(name='Bot?',value = member.bot) await ctx.send(embed=embed)
is now changed from avatar_url to avatar.url
tried that, then when I try to use it later on it says self.session is not defined
LOl
what line
embed.set_footer(text=f'Asked by{ctx.author}',icon_url = ctx.author.avatar_url)
embed.set_footer(text=f'Asked by{ctx.author}',icon_url = ctx.author.avatar.url)
embed.set_thumbnail(url=member.avatar_url)
Ok
yes
await ctx.command.invoke(ctx)
File "C:\Users\Ibrah\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 990, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "C:\Users\Ibrah\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 204, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Member'
object has no attribute 'avatar_url'```
again
@bot.command() async def user(ctx,member: discord.Member): roles = [role for role in member.roles] embed = discord.Embed(colour=member.color,timestamp=ctx.message.created_at) embed.set_author(name=f'User Info - {member}') embed.set_thumbnail(url=member.avatar_url) embed.set_footer(text=f'Asked by{ctx.author}',icon_url = ctx.author.avatar.url) embed.add_field(name=id,value=member.id) embed.add_field(name='Guild name:',value = member.display_name) embed.add_field(name='Created at:',value = member.created_at.strftime('%a, %#d %B %Y')) embed.add_field(name='Joined at:',value = member.joined_at.strftime('%a, %#d %B %Y')) embed.add_field(name=f'roles ({len(roles)}',value=''.join([role.mention for role in roles])) embed.add_field(name='Top role:',value = member.top_role.mention) embed.add_field(name='Bot?',value = member.bot) await ctx.send(embed=embed)
o
Man add py to the start plz
i think i can fix this
wait really, in what branch did it get changed?
@torn sail
master
2.0 master
oh, i must have been living under a rock then
What the heck is this construction
roles = [role for role in members.roles]```
well where r u using it
It's because avatar is an asset now.
Iām definitely it in my bot subclass in my main file and using it in cogs
It's genius
Slowing down the program on purpose to make it realistic.
fixed
!e
a = [1, 2, 3]
print(sorted(list(tuple(set(map(lambda x: x, filter(lambda x: 1, a)))))))```
@vale wing :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3]
š š
Now make this a function that calls itself.
I forgor comprehension tho
but, but, why
r u here??
@commands.command(name="pat", aliases=['pats', 'headpat', 'headpats'])
@commands.cooldown(1, 10, BucketType.user)
async def pat_(self, ctx: commands.Context, user: discord.Member):
"""Pat someone"""
if user.bot:
return await ctx.send(embed=discord.Embed(description="**:error: You can't pat a bot.**"))
if user == ctx.author:
return await ctx.send(embed=discord.Embed(description="**:error: You can't pat yourself!\n--------------------------\nTry patting someone else.**", color=discord.Color.red()))
url = "https://some-random-api.ml/animu/pat"
r = await self.bot.session.get(url)
if 300 > r.status >= 200:
data = await r.json()
else:
return await ctx.send(embed=discord.Embed(description="**:error: An error occured while fetching the GIF**", color=discord.Color.red()))
embed = discord.Embed(description=f"**{ctx.author.mention} patted {user.mention}**", color=discord.Color.embed_background(theme="dark"))
embed.set_image(url=data['link'])
await ctx.send(embed=embed)
and it says that the bot had no attribute session?
could u show ur setup_hook then
async def setup_hook(self):
self.session = aiohttp.ClientSession()
Ignoring exception in on_command_error
Traceback (most recent call last):
File "/home/container/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 181, in wrapped
ret = await coro(*args, **kwargs)
File "/home/container/cogs/fun.py", line 365, in pat_
r = await self.bot.session.get(url)
AttributeError: 'Bot' object has no attribute 'session'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "/home/container/main.py", line 108, in on_command_error
raise error
File "/home/container/.local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 344, in invoke
await ctx.command.invoke(ctx)
File "/home/container/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 927, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/container/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 190, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'session'
can you check ur discord.py version
I have a question related discord.py, Can I get Help?
ofc
Iām using pycord
oh, so what do I do to fix the issue?
I make select menu option from discord components module but from tomorrow the module not work so how I can make select menu option?
jkjk
im not sure the best way to do this in pycord but maybe override start and define it there (make sure to call super().start(...) and close the session when overriding close
this kinda seems like a long winded version? i asked in another server earlier and they told me to go here to find the recommended way to define a aiohttp session but I was confused, do you know how? - https://docs.aiohttp.org/en/stable/client_reference.html
well you are supposed to define it in async context meaning an event loop should be present
this means it should happen after an asyncio.run call
hm, are you able to give a example? sorry if Iām being annoying lmao, I just wanna know how this works
^^
can you explain further for stupid Master32s
class Foo:
def __init__(self):
self.session = aiohttp.ClientSession()
class Bar:
def __init__(self):
self.session = None
async def ainit(self): # doesnt have to be async i think
self.session = aiohttp.ClientSession()
foo = Foo() # warning
bar = Bar() # does not warn
async def main():
foo = Foo() # does not warn
await bar.ainit() # does not warn
asyncio.run(main())
basically if asyncio.get_running_loop errors then you will get that warning
why nhot typehint session in Bar
cause then it will have to be optional and stuff
and im lazy
lmaok
basically if the session is not created inside the asyncio.run call it will cause that warning
Do you mean that after your bot reload your select menu doesn't work?
How would I implement that in here:
Not a lot of people use that library, so might be difficult getting help. You should also not use that library since itās not very good, just a word of advice
oh haven't noticed discord components
Use the setup hook
pycord moment
^
Oh theyāre using pycord?
yes
Make sure to properly close the session as well, otherwise that's another warning
just make it a class var 
Anyone got example code on how they implemented aiosqlite into their discord bots?
Im making database functions in a utils folder but i cant figure out how to use aiosqlite with discord
Any help is greatly appreciated i've been raking my brain
Do you have an example of what you've done so far? People might be able to help if they spot an issue in your code
Yeah ill send some code
And is there an error, it's not working, or you're just not sure how to set it up?
this is some example functions of database functions i have in a utils folder
This just doesnt work, database gets locked when too many people do balance command
This works perfectly fine with normal sqlite3
For your SQL statement I might be wrong but I believe you need to have ' ' around the user ID
Oh the sql statements are fine they work
i just switched from sqlite3 to aiosqlite
for sqlite3 it works without the '' so its gucci for now
but yh usually there should be ' '
Why does my text look fine in first picture (on desktop client) but when it's viewed on mobile it ends up like the second picture. Is it something to do with it being a multiline string? Is there a way I can fix it without neeeding to unindent the string as that would look a bit messy. This is the code https://github.com/SnowyJaguar1034/ModMail-FAQ/blob/master/topics.py#L233-L247
Anyone with example code on how they setup aiosqlite in their discord bots would be greatly appreciated
if you print out the balance to the terminal just before you send it you could double check that it's not empty? Just trying to see where it's actually going wrong š¤
This is another thing, this is bad practice i should implement a .register command but
in sqlite3 this worked absolutely great
but in aiosqltie theres just database locking
The problem is that aiosqlite isnt behaving as it should and theres database locking constantly
Why can't the timeout = None be there?```py
class ticket_creation(discord.ui.Modal):
def init(self, ttype, member):
super().init(
(*[discord.ui.InputText(style = discord.InputTextStyle.long, label = i[0], placeholder = i[1], min_length = 2) for i in questions[ttype]]),
title = "Ticket Creation",
timeout = None)
I believe thatās to prevent concurrent writes
Donāt think SQLite has that because obviously itās not asynchronous
So while it may seem like SQLite worked perfectly before, it really didnāt and was just waiting to corrupt your entire database file
but it was working before, sqlite3 anyways when i wasnt using async
it can?
but aiosqlite is supposed to be async?
Right, just because it was āworkingā doesnāt really mean itās good
any idea on how do i learn to make a bot?
TypeError: __init__() got an unexpected keyword argument 'timeout'
Something working before but not working isnāt really a sign of anything, people say it a lot and itās more or less a misconception
yeah it isnt good hence I want to switch to aiosqlite
that's property you can't set it via init func
do self.timeout = None
can somebody just tell me how do i learn to make a bot from py
Also, how are you telling that the database ālocksā? Does the command just take a long time?
well it would depend but a good way is using context managers
hi, okimii!
Morning masterš
thank you so much!!
UTC+3 = 20:40 moment
How so? im interested
you can use context managers to start db connections or disconnect the connection when the bot disconnects from the gateway and then stop your task
you are welcome
Looks like here youāre creating a new connection pool every time the command is run, which is bad
Any help with this? I would greatly appreciate as I actually have no clue what to do now
you can always use global
whats nextcord
Should be easy, set it up in your setup hook, bind it to your bot instance
fork of discord.py
alright
like start the connection in a coroutine run it so it dets the value to a global variable since you cant await outside of a coroutine
only bad thing is you always need to stop the connection before shutting your file down

kids should go to sleep early
Ah this happens where something else is accessing the database
why arent you alseep?
Not sure if I understand
Itās an SQLite issue as well
Also what do you mean by this? in this?
either way that method isnt really modular so forget it lol
ahh lol, aighty
I'm not 14 like you either omi
im not 14 and whats omi
8 hours per day is enough, I go at 10:30 PM and wake up at 6:30 AM, what's the problemo?
if you set PRAGMA journal_mode=WAL;, sqlite will handle writes in a more concurrent fashion
https://sqlite.org/wal.html
Ill try that, thanks alot
8 hours of sleep oh me oh my
also why are you guys on with databases in discord bots
just know you always need to close your db connections in sqlite before closing the file, ive learned from many errors
haha ill note that
so is there no way I can fix it?
if you dont, say bye bye to your data, the file gets corrupted and everything gets deleted
same thing, not a whole lot difference between 13 and 14 year old kids, and oki*
what's wring?
smh
if were going by your logic im your age
No, in the setup_hook function thatās new in 2.0 (youāre using 1.7.3 from what I can tell from that screenshot)
await setup_hook()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A coroutine to be called to setup the bot, by default this is blank.
To perform asynchronous setup after the bot is logged in but before it has connected to the Websocket, overwrite this coroutine.
This is only called once, in [`login()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.login "discord.ext.commands.Bot.login"), and will be called before any events are dispatched, making it a better solution than doing such setup in the [`on_ready()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_ready "discord.on_ready") event.
Warning
Since this is called *before* the websocket connection is made therefore anything that waits for the websocket will deadlock, this includes things like [`wait_for()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.wait_for "discord.ext.commands.Bot.wait_for") and [`wait_until_ready()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.wait_until_ready "discord.ext.commands.Bot.wait_until_ready")...
yh disnake doesnt have that oof
In the world of Python Discord bot development, those are called "botvars"
!botvars
Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"
@bot.command()
async def get(ctx: commands.Context):
"""A command to get the current value of `test`."""
# Send what the test attribute is currently set to
await ctx.send(ctx.bot.test)
@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
"""A command to set a new value of `test`."""
# Here we change the attribute to what was specified in new_text
bot.test = new_text
This all applies to cogs as well! You can set attributes to self as you wish.
Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!
more like instance variables just attached to your Bot instance lol
might fix my aiosqlite issue
calm down
how
look for your cat
he's so stupid, he said that I have low version of asyncpg. it's said asyncpg>=0.12.0 and my ver is asyncpg 0.26.0
who the hell is it low
ewww he's so cute)
also I looked at him irl
noooo, I can't use thecatapi because of my region:(
live in another area
how
and by the way, I can use alexflipnote api instead
oh, I completely forgot that I did this
How much Python do I need to know?
In short, this is what is highly desirable for you to know before asking for help:
- The difference between instances and class attributes.
- e.g.
guild.namevsdiscord.Guild.nameor any variation of these.
- e.g.
- How to use data structures in the language.
dict/tuple/list/str/...
- How to solve
NameErrororSyntaxErrorexceptions. - How to read and understand tracebacks.
- How to surf the documentation properly.
- using the
Searchutility - basic logical thinking (e.g. "Someone in the help channel said me to use
on_raw_reaction_addto do reaction roles, so this event gives me apayloadwhich isRawReactionActionEvent, I want to give the member who reacted, a certain role,payload.memberwould give me aMemberobject and it has aadd_rolesmethod which is just what I want!")
- using the
This list is not exhaustive
If these concepts are confusing -- please feel free to complete a smaller and simpler project first before making a discord bot.
Why do I need to know this all?
Knowing the above, solving the problems for which you ask for help will take much less of your time and the time of volunteers. In addition, if you know the basics listed above, many problems will be easily fixed by you, without the need for any help. Thanks for understanding!
wrote a whole essay š
ok, take it as hw if u need
I'm fine
I'm not?
OOOasd
you just copied the most recent faq in d.py server
not just copied*
It's highly edited
or not idk
mysql free trial time period ?
Well i figuredo ut how to use aiosqlite in my discord bot
i had to use context managers
But I dont understand why this lead to different results than just the normal procedural way
You're still re-creating a connection object on every command aren't you?
Yeah ig, i saw one thread saying how to fix it i believe
You don't need to use them.
Didnt work otherwise, tried almost everything :(
This is overkill, and outdated. This is why I stay away from SO threads
this was how my code was previosuly
Just create a connection object in your setup_hook, bind it to your bot instance, voila
but i dont have setup_hook
do I bind it to my bot attribiute?
like bot.db.connect?
If you do use aiosqlite how do you implement in your discord bots?
is it possible to record voice chats with a bot? another question, is recording a voice chat against discord tos?
most likely
is it even necessary to use aiosqlite in a discord bot?
No voice recording is allowed.
i mean aiosqlite
preference?
It is possible but you would need to make your own receiver since discord.py doesn't do that.
Well if you want to save data.
that sounds pretty hard isnt it?
I mean compared to sqlite3
Is it necessary to use aiosqlite compared to sqlite3
If you update to 2.0, you will
It's a bit more complicated w/o setup hook but doable
disnake doesnt have setup_hook in its newest update
Some of my older bots before 2.0 are still using that method
Yeah I suppose you're right
Any disnake folks know what's up with that? They have a different name for it or something?
aiosqlite is better for bots, cus dpy (or it forks) use async, and difference between them is async
or is there any third party libary that supports that?
Not that I know of.
I know this might be a stretch but is it possible you can show me example code on how you did it?
Thanks for your help :)
With or without the setup hook?
Without
Sure can, hang on for a sec
Thank you sm
Hey guys, I am using discord.py, and one of the commands requires the user to input some time, for example like this !somecommandname 9:05, where 9:05 is the time the user inputted, however i would like to know what the user's timezone (so that i can properly interpret the time the user inputted) is so how would i do that, i would really appreciate help
bot = commands.Bot(...)
async def main():
""" Entry point into the asynchronous application """
connection = await aiosqlite.connect(...)
bot.connection = connection # you can now access the connection where you can access your bot instance
try:
await bot.start(...)
finally:
await connection.close()
asyncio.run(main())
@whole sparrow, you can also have any other setup stuff here as you need (e.g aiohttp.ClientSession, which needs access to the event loop. You can also sync your commands here, or anything that doesn't require access to the websocket connection can be done here
bot = commands.Bot(...)
async def main():
""" Entry point into the asynchronous application """
connection = await aiosqlite.connect(...)
bot.connection = connection # you can now access the connection where you can access your bot instance
try:
async with bot:
await bot.start(...)
finally:
await connection.close()
asyncio.run(main())
No need to thank
god u are great, Thank you so much I appreciate it alot

you can also use the connection as a context manager !
What's the advantage to using your bot in a context manager here?
aenter
Else just use run
is there any special implementation inside __aenter__ for __aexit__ for the bot class?
aexit calls bot.close
aenter literally calls the setup hook
Disnake doesn't seem to have a setup hook
Oh Disnake ._.
this might be such a stupid question
but how can i access the bot object in other files
from your_file import Bot
yh dont bother with me
Why not suggest cogs?
i wanna access bot object in a database.py file that i have all my database funcs
wym by cogs?
is this not fine?
i just remembered of my launch file where I create Bot instance, so I immediately tpyed taht
why do your database functions need access to the bot instance?
So I can access my aiosqlite database
bro, this has to be in your main file
yh bot instance is in my main
yes, if you have access to bot, you have access to your database connection instance
I see. Consider this design; a class in database.py that handles the connection, queries etc. You import this wherever you're creating your bot obj and use it there
or I'm dumb and i dont know anything about python
Usually abstracting all your database functions is a good idea
Oh, and dataclasses for any returned data
you also might want to look into Prisma to make life easier
Right, they've got a python client don't they?
yes, it's very fun
I love Prisma, one of my favourite technologies to work with, though I've only ever used it with Typescript
Anyone know why I am getting an error for embed and await?
set_footer(text="..")
IDE bug
I just changed it and I'm still getting it
I tab both of these and still get errors.
restart vsc
using vscode? bottom right click spaces:4 and indent entire code to 4 spaces
or smt like that
how do you create an on_message background task
or can you use multiple on_message functions?
nvm
Yes
alr
so do buttons in discord.py not work anymore? Cause replit wont allow me to install discord_components
and so I cant run this
from discord_components import Button, Select, SelectOption, ComponentsBot, interaction
from discord_components.component import ButtonStyle
Those are not discord.py buttons
It's a third party library. There's no point in using them, since discord.py and most other major forks/libraries have their own implementation now
ohhh, well how do i implement buttons with discord.py?
!d discord.ui.Button
class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.
New in version 2.0.
ty
anyone can help me for cogs ?
what help do you need with them?
The cogs work but the controls do not work...
for file in os.listdir("./cogs"):
if file.endswith(".py"):
bot.load_extension(f"cogs.{file[:-3]}")
this is my code
what controls are you referring to?
I don't understand
Ahhh
I will say commands
not controls
Ahh
How do I make {error.retry_after} into milliseconds?
multiply it by 1000
Great, that's your milliseconds
ty
guys
how can i create an help like the one discord automatically adds
i want to make it on embed
Either subclass the original HelpCommand or make your own
!customhelp for subclassing
Custom help commands in discord.py
To learn more about how to create custom help commands in discord.py by subclassing the help command, please see this tutorial by Stella#2000
If you want to make your own just do help_command=None in your bot constructor and make the command
im asking how can i make my own
with that much detailed stuff
without using 50+ if in one command
Use a loop. Loop through all cogs, each cog make a help section or something
<t:{round(error.retry_after*1000)}:D> is returning 52 years ago? Iām quite confused lmao, I just want my command cool down to be in a unix timestamp?
could someone help me with this error?
await cursor.execute("UPDATE levels SET level = ? WHERE user = ? AND guild = ?"(guild.id,author.id,level))
Put a comma between " and the (