#discord-bots
1 messages · Page 786 of 1
how can i store channel id to my variable?
ok lemme try
- ok
- well even if its in the same folder as main.py, I do what the docs say, and it doesnt work
Can someone tell me why the beg command won't work?
how to remove timeout
atm i have this
async def setup(ctx, *, channelID=int()):
i need to get user messsage channel id value and put it to my variable
JSON. Why?
- i honestly forget... i tried it like 2 hours ago... 2) i kinda deleted it after it didnt work...
it's for my personal server, I won't use it on multiple servers
then use that variable to my get_channel(here)
Set duration to None
Why do you give up so easily 😂
It temporarily changes the wallet's amount
Whats the error?
there's none, the amount won't change in the json file
i don't know why
honestly idk lol
is it because of the function?
You didn't save the data in the update_wallet method
mmm I see I see
should I remove it in the command itself or in the method?
try saving it by dumping users into the json file
just edit the method
aight aight
wdym
it won't work
whats wrong now
the amount won't update
try dumping
users, your json/dict object back into the json file
mm I see I see
how do i upload an emoji that is in a different folder? (like a folder in the same folder main.py is in)
it looks like my code has more issues
how do i get the amount of ppl in my server
!d discord.Guild.member_count
property member_count: int```
Returns the true member count regardless of it being loaded fully or not.
Warning
Due to a Discord limitation, in order for this attribute to remain up-to-date and accurate, it requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be specified.
oh okay
await create_custom_emoji(*,name="Check_Mark",image="/emojis/check_mark.png")
yeah it won't work
show code/whats wrong
you don't need the *
that symbolizes that everything after that is a kwarg
i think you need a bytes-like object, not a string
class eco(commands.Cog):
def __init__(self,bot):
self.bot = bot
async def open_data(self):
with open("economy.json","r") as f:
users = json.load(f)
return users
async def close_data(self, users):
with open("economy.json","w") as f:
json.dump(users,f)
async def update_wallet(self,ctx,member,op,am):
users = await self.open_data()
if op == "-":
users[str(ctx.guild.id)][str(member.id)]["wallet"] -= am
elif op == "+":
users[str(ctx.guild.id)][str(member.id)]["wallet"] += am
return users[str(ctx.guild.id)][str(member.id)]["wallet"]
@commands.command()
async def beg(self, ctx):
user = ctx.author
await self.open_account(ctx,user)
users = await self.open_data()
num = random.randrange(0,101)
quote = [f"A stranger gives you {self.num(num)}.", f"A mysteriously man knows that you have money, but he still gives you {self.num(num)}", f"I'm poor, but I still give you {self.num(num)}", f"Stop being a beggar!! {self.num(num)}"]
await ctx.send(random.choice(quote))
await self.update_wallet(ctx,user,"+",num)
await self.close_data(users)
@boreal ravine
what's wrong with the code
you didn't do what I said
try inserting the new data into your json file
example?
What library should I replace discord.py with that has similar syntax?
can you give me an example?
are you trying to create an emoji from a file inside your pc?
My bot is loading twice right now for some reason
use a fork
what d.py version are you using right now?
Are they are forks that are better than some others?
!pypi disnake
Master, but last time I updated was like six months ago
biased
no just open the json file, dump the new data
what do you wanna use if you switch to a fork?
What do you mean?
kinda...
lets say main.py is in a folder called discord bot
there is a file inside discord bot called emojis
the emoji png file is inside the emoji folder
I mean why do you wanna switch to something else other than d.py
Not being updated anymore and it's having a stroke or something
then you can read the file ```py
with open(filepath, "r") as file:
file = file.read()
what stroke?
My one bot keeps loading twice
Other one doesn't and they load cogs the same
Nothing has changed recently
that ain't a d.py issue mate, thats a hosting issue
It isn't
I'm running it, and it's running two instances in one
Everything that prints in on_ready runs once, then anything after that runs twice
reset your bots token, and use the new one
Don't think it'll matter
I've run exit three plus times, and it went offline every time
It will
why wouldn't it
And it hasn't changed anything, every time it starts it does the same thing
do not ask for help if you think you're smarter ¯\_(ツ)_/¯
bruh bruh
how do i do the filepath? like this?
"emojis/check_mark.png"?
Show the dir ss
I know that changing an access token won't change something that's an issue with the library or the bot lol
whats a dir ss?
you have two bot instances running, refresh your bots token and use that one
I don't, I checked that and restarted my computer which both did nothing
Directory screenshot
what is emojis?
Huh?
Damn, show all of it
is your bot sending more messages in a command than its supposed to?
It's doubling everything
make it a string
Woah
why? the folder is what isnt being defined
The only thing that isn't doubled is the things in on_ready
;-; okay then, help yourself
Reset the token
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
i just got this error... wtf does it mean?
Code?
So explain how resetting an API access token is going to change anything
- switch to a fork if you want
- that means you have multiple bot instances running, maybe you didn't close your IDE properly? reset your bots token and the other "instance" will stop since the token is no longer valid
with open("emojis/check_mark", "r") as file:
file = file.read()
await create_custom_emoji(name="check_mark",image=file)
omg
your choice, i'm no one to argue ¯\_(ツ)_/¯
I made a command that ran exit() and the bot went offline, there aren't two instances running
yes
File extension missing
oh i must have copied it over wrong. but in the code it has .png
@thorn leaf do u have an on_message event?
Yes
Mind showing it?
There you go (:
any other ideas?
process commands
Read the images in binary mode
what does that mean?
You can actually make a better system to check if the author exists in the D.A.T.A.B.A.S.E. or not
with open("image", "rb") as image:
. . .
Create*
await create_custom_emoji(*, name, image, roles=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a custom [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji") for the guild.
There is currently a limit of 50 static and animated emojis respectively per guild, unless the guild has the `MORE_EMOJI` feature which extends the limit to 200.
You must have the [`manage_emojis`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_emojis "discord.Permissions.manage_emojis") permission to do this.
ik... 😡
;-;
i changed the directory, "r") as file that you gave me to directory, "rb") as file, and now I get a new error.
'create_custom_emoji' is not defined
yet I import here
import asyncio
sorry 😦
It's fine
any suggestions?
With?
the new error message
i changed the directory, "r") as file that you gave me to directory, "rb") as file, and now I get a new error.
'create_custom_emoji' is not defined
yet I import here
import asyncio
guild.create_custom_emoji
'guild' is not defined
ctx.guild
IT WORKED, THANK YOUI
Cool
.
one more thing... how can I get the total number emojis in a server?
!d discord.Guild.emojis is a thing?
All emojis that the guild owns.
Use the len() function on the returned list
kk
less than is < right?
Huh? len function
nvm
emojiNum = len(discord.Guild.emojis)
ive used len before
discord.Guild is?
Use an instance of the Guild class
Not the class itself
ctx.guild.emojis smh
Lol
kk
What is the Syntax for having Discord play an MP3 in a voice Channel? Additionally, if Discord is already playing a sound, can you tell it to play another sound and it will layer the two or can only one audio file be played at a given moment?
yo
what if I use this for something?
if_________________
else if________________
else________?
I forgot if else if even exist lmao
The else if case in python is just elif
o
but does that mean if the first one is right then it will go to the elif?
and if the else if is right it will go to else?
or u cant use 3 of those at 1 commands hahaha
No, it will try the if first and then go sequentially down each elif and if none return true it will then hit the else block
ah
It will only do one of the contained conditionals
hmm
!d discord.VoiceClient.play
play(source, *, after=None)```
Plays an [`AudioSource`](https://discordpy.readthedocs.io/en/master/api.html#discord.AudioSource "discord.AudioSource").
The finalizer, `after` is called after the source has been exhausted or an error occurred.
If an error happens while the audio player is running, the exception is caught and the audio player is then stopped. If no after callback is passed, any caught exception will be displayed as if it were raised.
So if it hits the if block it will only hit the if statement, if it hits an elif statement it will only hit the elif, and finally if none of the conditions above are not it will hit the else
lemme test it out
Always welcome
!d discord.AudioSource
class discord.AudioSource```
Represents an audio stream.
The audio stream can be Opus encoded or not, however if the audio stream is not Opus encoded then the audio format must be 16-bit 48KHz stereo PCM.
Warning
The audio source reads are done in a separate thread.
Actually there are a few formats it supports. They all are given in the docs of the discord module (not discord.ext but discord)
Excellent. The main thing I see is the Opus encoding, so I will look into converting the audio files we need into Opus encoded files
how do I make if the error like MissingRequiredArgument on a commands?
im trying to make it for each commands
I can do it for all commands but im trying to figure out how to make it saperately
type hint it
hu
You mean create a custom exception or a global error handler
by global u mean if the commands has error it will give the same error text even if its different type of commands right?
Yeah
thats what I already did
sadly im finding a way how to make it custom for each commands
isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.
Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
lemme show ya the code
@client.event
async def on_command_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send(embed=discord.Embed(title='Missing Argument', description='Please include all the requirement!'))
if isinstance(error, commands.MissingPermissions):
await ctx.send(embed=discord.Embed(title='Missing permission', description='You do not have permissions to do this!'))
this one is global (all type of commands)
So basically its usage would be like
response = None
if isinstance(error, commands.CommandNotFound):
response = 'This command doesn't exist'
elif isinstance(error, commands.MissingRequiredArgument):
response = 'This command is missing a required argument'
if response:
await ctx.send(response)```
@primal salmon I don't get what are you trying to make
Also elif is a thing
First
This is not a good error handler
This will eat up all the error that you are not handling
Perhaps you meant local error handler?
You need to either log / raise the error that is raised
!d discord.ext.commands.Command.error
@error```
A decorator that registers a coroutine as a local error handler.
A local error handler is an [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") event limited to a single command. However, the [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") is still invoked afterwards as the catch-all.
@primal salmon this is what you need most likely
sadly ik ;-;
Simple Error Handling for ext.commands - discord.py - error_handler.py
Here, this is a good example on how to make a proper error handler
willl selenium works with chromium ?
How do i get an invite to this channel
hi
I'm new to discord.py
could anyone tell me what is wrong with this code
if message.content.startswith('>channels'):
await message.channel.send('text or voice?')
@client.event
async def on_message(message):
if message.content == 'text':
for i in current_guild.text_channels:
await message.channel.send(i)
return
else:
await message.channel.send('invalid response')
return ```
but but....... how are you getting the message object outside the on_message
which channel?
Nvm but thisone
@silk lynx this is the channel
oh that is in another on_message
apologies, let me send the entire code
yep
@client.event
async def on_message(message):
current_guild = message.author.guild
if message.author == client.user:
return
else:
if 'ssf' in message.content:
await message.add_reaction('🌸')
await message.channel.send('SSF IS COOL')
time.sleep(5)
await message.channel.send('but san is not . -.')
if message.content.startswith('>channels'):
await message.channel.send('text or voice?')
@client.event
async def on_message(message):
if message.content == 'text':
for i in current_guild.text_channels:
await message.channel.send(i)
return
else:
await message.channel.send('invalid response')
return ```
the bot is spamming invalid response
why two events?
making commands inside on_message isnt ideal either
yep
There isn't a method more reliable than on_bulk_delete to get the list of messages that were purged upon a channel.purge right?
dont think so
and the on_bulk_delete would probably be better than the on_raw_bulk_delete something right for that purpose
raw would be good if you just want to detect that the messages are deleted
it wont depend on the messages in cache
that is not how you do it
that is very very inefficient
!d discord.ext.commands.Bot.wait_for Use this. @knotty mason
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**...
Morning
Morning Dekriel
cool, this ot before mina birbo stabs you
shit I’m a run
lol
I'm gonna go make my cursed bot
Anyone need help
yeah me
With
wait
wait_for?
is there a better way to get my bot token?
lol
you don’t really need to hide it in your code
Unless you’re providing code

but if you need help with wait
If I wanted to make an eval command, although not using snekbox, for reasons, anyone mind giving references please?
wdym
!d discord.ext.commands.Bot.wait_for /j
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**...
I don’t know sorry
no, thats too hard
what kind of references?
just use envs
everyone took that too seriously lmfao
Cool functions, right?
useless*
I'm pretty sure returning Context, would return the class since you can only get context from messages/commands
just like a website maybe or github
lmfao
I just wnated useless functions ;-;
@spring flax
Piston bot wtf
it runs code using an API
Kayle are you ok
minecraft?
you could also use https://tio.run to run code I suppose
?
oof
what exactly is wrong?
i'm trying to make a command
a command that evaluates python right
yes
well like I said earlier, you can
- use the
exec(built-in function) - use an api
- use snekbox
between one and two, which is more recomended?
Two is more recommmended. Open eval/exec functions are dangerous I heard
do you know any APi's?
Also I'm not that worried about others using my eval, it's a private bot
hi, i've got a problem with my code, they say that the "()" is not closed, someone know how to fix it ? thanks
ure making dice 0-0
wdym ? i'm a beginner xD sorrt
hello. I have this command with a sql and get this error ```python
mycursor.execute(f"SELECT gen FROM customers WHERE name = {user.name}")
myresult = mycursor.fetchall()
for x in myresult:
print(x)
emb=nextcord.Embed(title="Ainta Gen", description=f"{acc}, left: {x}", color=color, timestamp=datetime.now())
await channel.send(embed=emb)
Command raised an exception: ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''J1mk0lakos' at line 1
your commands literally said dice there ;-;
what type of bot are u making?
wdym?
whats that commands do
it gives a random string from a txt file
tbh idk bout that type of stuff
yeah, these are the one that I use/know of. There are probably more though
https://github.com/engineer-man/piston
https://emkc.org/api/v1/piston/execute
Hey, i have this, but instead of printing 5, it prints ('5',) ```python
for x in myresult:
print(x)
probably because its a tuple
fetchall returns list of tuples
Do print(x[0])
Hi, I'am a complete beginner, and I would like help with cooldown.
Here is my problem:
@client.command
async def command1(ctx, arg):
if arg == "arg1":
await ctx.send("hello1")
# add a cooldown of 60 seconds here
if arg == "arg2":
await ctx.send("hello2")
#add a second cooldown of 60 seconds here
if arg == "arg3":
await ctx.send("hello3")
# add a third cooldown of v60 seconds here
I would like to have a cooldown so that I can do '!command1 arg1' every minutes, but during this minute, I can still do '!command1 arg2'
can someone help me
okay thanks. But i also want to remove 1 from x. Do I do something like y = x - 1?
U mean dubtract?
Subtract*
yes
result = x[0] - 1
You need to store when command with arg1 was last used for each user, then if arg == arg1 and last_used + 1 minute <= current_time: do_something()
Ok thanks, I will try
ok
okay it works. I made it also update it in my sql. But if i run the command twice without closing the program, it gives this result: Command raised an exception: InternalError: Unread result found raise errors.InternalError("Unread result found") mysql.connector.errors.InternalError: Unread result found
What are you trying to do
everytime someone uses the command, it will remove 1 from x (which is 5) till it reaches 0
i cant figure out how to add my bot to my server for testing
discord changed their dev portal since last time i used it and i cant seem to find a link to copy into my browser to add it
haha its fine
He kept sending random GitHub repos and deleting the message
Hello I need help
I wanna make a bot command that edits a message and it does loading…
And the dots edit
how to use on_message event to like:
on_ready, it posts hi on a specific channel. then everytime a message is sent into that channel, it deletes the hi message and resend it to be the latest message on the channel (how to do this)
s = await ctx.send('hello!')
s
await s.edit(content='loading.....')
await asyncio.sleep(3)
await s.edit(content='done!')```
Ok I’ll try that
Does discord have guild invites rate limiter? (return's all active invites in current guild)
Every API/ws call has a rate limit
how to use on_message event to like:
on_ready, it posts hi on a specific channel. then everytime a message is sent into that channel, it deletes the hi message and resend it to be the latest message on the channel (how to do this)
Mhm, but thought maybe that function had some different sort of limit, because after 30 minutes of running it stopped giving me results
how?
Well, there are buckets. It works like send message and edit message have the same bucket. So if u do it, it will be counted in one group. fetching invites is another bucket and so on
Please don't ask repeatedly. Someone will answer if they know how to
Hmm, but can you bypass it by using some sort of proxy?
No
what are u trying to even do
.
everything has ratelimit
Tried to create invite tracker system, and in order to get all active invites i need to use guild.invites(), but after some time it returns nothing
then it has no active invites ?
discord.on_invite_create(invite)```
Called when an [`Invite`](https://discordpy.readthedocs.io/en/master/api.html#discord.Invite "discord.Invite") is created. You must have the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to receive this.
New in version 1.3.
Note
There is a rare possibility that the [`Invite.guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Invite.guild "discord.Invite.guild") and [`Invite.channel`](https://discordpy.readthedocs.io/en/master/api.html#discord.Invite.channel "discord.Invite.channel") attributes will be of [`Object`](https://discordpy.readthedocs.io/en/master/api.html#discord.Object "discord.Object") rather than the respective models.
This requires [`Intents.invites`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.invites "discord.Intents.invites") to be enabled.
Nope, had like 100 invites and suddenly 0
!d discord.on_invite_delete
discord.on_invite_delete(invite)```
Called when an [`Invite`](https://discordpy.readthedocs.io/en/master/api.html#discord.Invite "discord.Invite") is deleted. You must have the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to receive this.
New in version 1.3.
Note
There is a rare possibility that the [`Invite.guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Invite.guild "discord.Invite.guild") and [`Invite.channel`](https://discordpy.readthedocs.io/en/master/api.html#discord.Invite.channel "discord.Invite.channel") attributes will be of [`Object`](https://discordpy.readthedocs.io/en/master/api.html#discord.Object "discord.Object") rather than the respective models.
Outside of those two attributes, the only other attribute guaranteed to be filled by the Discord gateway for this event is [`Invite.code`](https://discordpy.readthedocs.io/en/master/api.html#discord.Invite.code "discord.Invite.code").
This requires [`Intents.invites`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.invites "discord.Intents.invites") to be enabled.
Use these (:
Uuu
just use those events
These are good
how to use on_message event to like:
on_ready, it posts hi on a specific channel. then everytime a message is sent into that channel, it deletes the hi message and resend it to be the latest message on the channel (how to do this)
does anyone know
Don't change_presence (or make API calls) in on_ready within your Bot or Client.
Discord has a high chance to completely disconnect you during the READY or GUILD_CREATE events (1006 close code) and there is nothing you can do to prevent it.
Instead set the activity and status kwargs in the constructor of these Classes.
bot = commands.Bot(command_prefix="!", activity=..., status=...)
As noted in the docs, on_ready is also triggered multiple times, not just once.
Basically: don't 👏 do 👏 shit 👏 in 👏 on_ready.
sending message returns Message object, use that for deleting
message object has channel attribute, so use that for sending aswell
im so dumb that i dont know how to make it send stuff in specific channel
How do I send message content from command
So that I don’t include command and prefix
channel = bot.get_channel(ID here)
ohhh
get_role get_channel get_member all the same?
get_user too?
i dont know about get_role*, but other than that yes. (note that get_member is only usable if u have guild object)
yes for the brackets thing i know dont worry
someone explained to me a long time ago
get_role works dont worry too
then ur all fine 👍
i havent tried get_user
just dont do shit in on_ready
async def on_message(message):
c = bot.get_channel(ID HERE)
s = await c.send('hello')
s
else:
await s.delete()
s```
will this solve the problem
dont do this everytime user sends message, other than that, it works ye
except where is if statement ?
Hello i want to send message content for example = !hello say car
And bot sends say car
Would that be message.content?
use commands for that
await s.delete()
s```
Yes but I want the content for message so would I use message.content
start if statement 
end if statement 
just get message object then ?
So message.object?
yeah, just dont do it everytime user says :kek:
no lmao
no, you use command arguments
I’m dumb sorry
so what that should do is when everytime someone sends something in that channel, it will delete "hello" and resend it right?
you have message, use message.content
but again, use commands
let me give you example
@bot.command()
async def hi(context):
await context.send("hi")
do (prefix)hi and bot will say "hi"
you can pass in a parameter after context
^
ctx is shorter bro!1!!
which would save everything that's after the command
i dont care bro!11111
and send that
use ctx or i come to hosue!!!!!1
ok bro dont murder me!111
rather than doing stuff like
@client.event
async def on_message(message):
content = message.content
if content.startswith("!hi"):
splt = content.split(" ")
# ....
``` just to do parameters bruh
(discord.js moment)
stop using vairable lazy bro!!1!!1!
For example I want it so if you do !send alexlol is cool.
That bot will respond alexlol is cool but message may vary depending on command use
no bro!111!!
ay stop
Whenever I come here, why is there always RPing happening?
yeah just use commands for that, don't get yourself to feel the pain of parsing everything urself
hunter or huney
Ok thx
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
@oblique cobalt ty
np
heres example as always @slate swan
you can add *, text after context and you can use await context.send(text) to do that easily
Ok
I want it to send the message that the user sent but without command and prefix just after text
oh then do on_message
Ok
So:
@bot.command()
async def hi(on_message):
await context.send("hi")
I’m new to discord.py so sorry
no bruh
Ok
that is for command, and always will be (prefix)(function name) arguments..
O yes I forgot that mb
async def on_message(message):
c = bot.get_channel(936850185462644739)
s = await c.send('hello')
if message.author == bot.user:
return
if message.content == 'yes':
await s.delete()
s
return
else:
await s.delete()
s
return```
the bot keeps spamming hello how fix
because u made it send it everytime user sends message
LOL
i told u to dont do it in on_message :kek:
I mean it’s good for nuking
yeah so i sent "s" and the bot legit spammed hello forever
because
It’s a good raid bot 💀😭
bro just
I’m joking
you send message
bot sends it
bot gets on_message dispatched
because there is no proper check to not respond to bots, bot responds to itself over and over
no bro look my code
i typed if message.author == bot.user return
idk that isn't how u do it
how then
ClientUser and Member is different thing
compare them with ids, but again, please dont do on_message for this
it is comparable
if message.author.id == (bot id)
u mean this? ^^^
since when
if message.author.bot: return
Member and ClientUser are subclass of User
do that instead
trying
yeah but, idk how to explain it
it still spamming
did u restart bot first ?
yeah im smart
seems like not
discord/user.py lines 99 to 100
def __eq__(self, other: Any) -> bool:
return isinstance(other, _UserTag) and other.id == self.id```
oh
they compared it with id
@clever pivot please use commands for that instead lmao
i used messgae.author.id == (bot id) return
but i want the bot to resend its message every message is sent
but why u wanna do that
?
async def on_message(message):
if message.author.id == 777052626449596437:
return
c = bot.get_channel(936850185462644739)
s = await c.send('hello')
if message.content == 'yes':
await s.delete()
await c.send('hello')
else:
await s.delete()
await c.send('hello')``` this code kind of worked
but the thing is it sent one mesage, deleted that own message, resent the message, and it didnt delete the last message before the human's message
for example |
me: sls
bot: hello
me: slsls
bot: hello
it didnt delete the first message it sent
this is supposed to delete it's own message everytime it sends
how do i make the first message delete and resend another everytime it detects a message in the channel except for its OWN message
use bot variables for that, im too lazy to explain
brb gonna copy paste
Need to keep track of a variable between functions? No problem!
⚠️ Careful what you name it though, else you might overwrite something ⚠️
Just add it to your commands.Bot or discord.Client instance like so:
bot = commands.Bot(...)
bot.my_variable = 0
async def foo():
bot.my_variable += 1
# In a cog
@commands.command()
async def counter(self,ctx):
await ctx.send("Current Counter is at {}".format(ctx.bot.my_variable))
This also allows you to access this from other cogs/extensions/functions. Anywhere you have access to the bot instance
!bot-var btw
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!
thanks, i didn't know existance of that
no worries
i still sucking at this
hi
hi
how do i make a time stamp in 24 hour clock?
how?!?!?!?
idk, thats why i am asking lol
how!!
!discord webhooks
just use ctx.author.name?
ctx.author*
huh
ctx.author returns both discrim and name
oh yea lol ignore the upper part 
I got command that you do .Tt user
And then I want it to send back user
so a member object converted to a str is the name?
and that description doesn't need an f-string
Why add a fstring for description
lol
from discord.ext import commands
import os
import time
from discord_webhook import DiscordWebhook, DiscordEmbed
from keep_alive import keep_alive
keep_alive()
bot = commands.Bot(command_prefix= "!")
@bot.event
async def on_connect():
print('online')
@bot.command(name="tt")
async def tt(ctx):
await ctx.message.delete()
message = await ctx.send("**loading.**")
time.sleep(0.3)
await message.edit(content="**loading..**")
time.sleep(0.3)
await message.edit(content="**loading...**")
time.sleep(0.3)
await message.edit(content="**loading.**")
time.sleep(0.3)
await message.edit(content="**loading..**")
time.sleep(0.3)
await message.edit(content="**loading...**")
time.sleep(0.3)
await message.edit(content="**loading.**")
time.sleep(0.3)
await message.edit(content="**alexlol**")
time.sleep(0.5)
os.system("python3 web.py")
await message.edit(content=f"**webhook request sent!!**");
bot.run(os.getenv('TOKEN'))```
I want it to take the word after .tt and turn it into variable
Use asyncio.sleep 
Time sleep works just fine
don't
Don't
Wdym
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!
Fine
Pymongo is async right ?
no
motor is, but it is made by combining pymongo and asyncio, so ig just use run_in_executor
Whats the attribute for server regions? i tried using ctx.guild.region, but that returns deprecated.
!d discord.Guild.region
The region the guild belongs on. There is a chance that the region will be a str if the value is not recognised by the enumerator.
!d discord.VoiceChannel.region
No documentation found for the requested symbol.
yeah
!d discord.VoiceChannel.rtc_region this?
The region for the voice channel’s voice communication. A value of None indicates automatic voice region detection.
New in version 1.7.
thanks
Since each VC can now have separate regions
thank you
@cold sonnet :white_check_mark: Your eval job has completed with return code 0.
yes
iterate through the roles
and check for each of them if they are in ctx.guild.roles
no
if any of the roles in ctx.guild.roles has that name
for role in ctx.guild.roles:
if role.name in list:
yo. I have this command, but when i use it 2 times i get this error ```python
mycursor.execute(f"SELECT gen FROM customers WHERE name = '{user.name}'")
myresult = mycursor.fetchall()
for x in myresult:
print(x[0])
result = int(x[0]) - 1
print(result)
sql = f"UPDATE customers SET gen = '{result}' WHERE name = '{user.name}'"
mycursor.execute(sql)
mydb.commit()
mycursor.execute(f"SELECT gen FROM customers WHERE name = '{user.name}'")
emb=nextcord.Embed(title="Ainta Gen", description=f"Your account is: {acc}\n**Gens left:** {result}", color=color, timestamp=datetime.now())
await channel.send(embed=emb)
File "C:\Users\Δημήτρης Κολιόπουλος\Desktop\ainta\main.py", line 158, in gen
cursor = mydb.cursor()
File "D:\coding_things\pythonV2\lib\site-packages\mysql\connector\connection_cext.py", line 569, in cursor
self.handle_unread_result(prepared)
File "D:\coding_things\pythonV2\lib\site-packages\mysql\connector\connection_cext.py", line 785, in handle_unread_result
raise errors.InternalError("Unread result found")
mysql.connector.errors.InternalError: Unread result found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\coding_things\pythonV2\lib\site-packages\nextcord\ext\commands\bot.py", line 1055, in invoke
await ctx.command.invoke(ctx)
File "D:\coding_things\pythonV2\lib\site-packages\nextcord\ext\commands\core.py", line 933, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "D:\coding_things\pythonV2\lib\site-packages\nextcord\ext\commands\core.py", line 177, in wrapped
raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: InternalError: Unread result found
but that doesn't work, I'm being dumb
yeah just this
no
this is the exact same thing as before
what have you tried?
how to make a bot send "hi" in a channel, then if someone sends a message in that channel the bot deletes its hi message and resends it to make it the newest message in the channel, how do that everytime someone sends message in channel?
yo. I have this command, but when i use it 2 times i get this error ```python
mycursor.execute(f"SELECT gen FROM customers WHERE name = '{user.name}'")
myresult = mycursor.fetchall()
for x in myresult:
print(x[0])
result = int(x[0]) - 1
print(result)
sql = f"UPDATE customers SET gen = '{result}' WHERE name = '{user.name}'"
mycursor.execute(sql)
mydb.commit()
mycursor.execute(f"SELECT gen FROM customers WHERE name = '{user.name}'")
emb=nextcord.Embed(title="Ainta Gen", description=f"Your account is: {acc}\n**Gens left:** {result}", color=color, timestamp=datetime.now())
await channel.send(embed=emb)
File "C:\Users\Δημήτρης Κολιόπουλος\Desktop\ainta\main.py", line 158, in gen
cursor = mydb.cursor()
File "D:\coding_things\pythonV2\lib\site-packages\mysql\connector\connection_cext.py", line 569, in cursor
self.handle_unread_result(prepared)
File "D:\coding_things\pythonV2\lib\site-packages\mysql\connector\connection_cext.py", line 785, in handle_unread_result
raise errors.InternalError("Unread result found")
mysql.connector.errors.InternalError: Unread result found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\coding_things\pythonV2\lib\site-packages\nextcord\ext\commands\bot.py", line 1055, in invoke
await ctx.command.invoke(ctx)
File "D:\coding_things\pythonV2\lib\site-packages\nextcord\ext\commands\core.py", line 933, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "D:\coding_things\pythonV2\lib\site-packages\nextcord\ext\commands\core.py", line 177, in wrapped
raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: InternalError: Unread result found
Hey does anyone have any good working code for a invite tracker? I coded one but it's buggy and doesn't always work so would be nice to refer to someone else's code
The question is better suited in #databases tbh
How do use python make self bot
how to make a bot send "hi" in a channel, then if someone sends a message in that channel the bot deletes its hi message and resends it to make it the newest message in the channel, how do that everytime someone sends message in channel?
on_message event
and check the channels ids
my on_message event didnt work
can you show what you did?
async def on_message(message):
if message.author.id == 777052626449596437:
return
c = bot.get_channel(936850185462644739)
s = await c.send('hello')
if message.content == 'yes':
await s.delete()
await c.send('hello')
else:
await s.delete()
await c.send('hello')``` this was my code but it obv just sent a msg when i send something and then it deletes the message and resent it, i wanted it to delete the message BEFORE and resend a new one so its the latest one in channel
your if else is useless, you're doing the same thing
yeah, how do i make it get the last message and delete it?
you already have it, it's stored as s
is there something like
s = await ctx.send('hi') s msg = bot.get_message(s) msg.delete()
This is not a Modmail thread.
Huh
that's just terrible in general
skip the bot
just import a loading animated emoji instead
editing a message to make it look like it's loading is bad
Na I like if
Best discord python library and why?
Nextcord
dpy, rest are forks
Well obviously
But if your gonna go with forked version what’s best @potent spear
Personally I like Nextcord
I don't use forks, can't say
Nextcord is updated regularly and /commands are really responsive
Personally I dont use them but I heard lava is good
Pycord vs nextcord?
Yes
ah lavalink?
Yes
I don’t want to rewrite my discord.py code that much
welp I wish I can make button in pydroid
Nextcord is better for update coming up aka /commands
However I need to
Wait your mobile?
But like what are the advantages and disadvantages
Why nextcord? Why not pycord or any other fork
We can’t really say as discord are making them anyway
Next cord is one of best optimised for / commands
Wht about buttons?
I’m not sure about that I don’t really use buttons
But most likely the same
buttons are same for all of them.
That’s so bad when you have a lot of new options and you don’t want to use the wrong one. You don’t know if the library collapses the next day you choose it
but libraries like disnake lets you have more functionalities
its not in discord
!d disnake.ui.ActionRow
class disnake.ui.ActionRow(*items)```
Represents a UI action row. Useful for lower level component manipulation.
New in version 2.4.
but here it is
Ok thx
np
@primal salmon they are all the same spaces out
ma goal ;-;
show code? TwT
@primal salmon
message = await ctx.send("Loading.. ")
time.sleep(0.3)
await message.edit(content="Loading..")
time.sleep(0.3)
await message.edit(content="Loading...")
time.sleep(0.3)
await message.edit(content="Loading.")
time.sleep(0.3)
await message.edit(content="Loading..")
time.sleep(0.3)
await message.edit(content="Loading...")
time.sleep(0.3)
await message.edit(content="Loading.")
time.sleep(0.3)
await message.edit(content="Alexlol")
time.sleep(0.5)
await message.edit(content=f"webhook request sent!!");
webhook = DiscordWebhook(url= os.environ['TOKEN'])
embed = DiscordEmbed(title='alexlol2fast', description=f'{user} was too fast for you and claimed [{usernameclaimed} (https://tiktok.com/@{usernameclaimed})', color='264dd9')
webhook.add_embed(embed)
response = webhook.execute()
bot.run(os.getenv('TOKEN'))
Do the message sending thingy in a loop
Wdym
Have a list with .. and … and on 1st iteration use list[0] etc…
That takes patience I don’t have XD
Await is outside function
dont use time.sleep , its blocking
Ok
What will I use
and your error means you used await outside an async function
asyncio.sleep
don't sleep and edit to "simulate" loading, use an animated loading emoji instead
^^
Ok
Do you have all the await message.sends in async function?
Or u can make “bot 123 is typing” appear @slate swan
Ok
async def tt(ctx, *, reason=None):
userc, user = reason.split(':')
message = await ctx.send("Loading.. ")
asyncio.sleep(0.3)
await message.edit(content="Loading..")
time.sleep(0.3)
await message.edit(content="Loading...")
asyncio.sleep(0.3)
await message.edit(content="Loading.")
asyncio.sleep(0.3)
await message.edit(content="Loading..")
asyncio.sleep(0.3)
await message.edit(content="Loading...")
asyncio.sleep(0.3)
await message.edit(content="Loading.")
asyncio.sleep(0.3)
await message.edit(content="Alexlol")
asyncio.sleep(0.5)
await message.edit(content=f"webhook request sent!!");```
See message send
That’s problem
Wdym
your indentation isn't correct
Did u indent it correctly
if you don't know what that means, you're definitely new
Yes I’m kinda new
!indent
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
this ^^
that's irrelevant
Ok
=> it has nothing to do with intents
read what the bot says, it isn't there for show
@bot.command()
async def tt(ctx, *, reason=None):
userc, user = reason.split(':')
message = await ctx.send("Loading.. ")
Kk
@slate swan you should probably learn a bit of python first
Ok
sometimes will error
if user doesnt give it anything. youll get error since you cant .split on NoneType
Ok
help plz
awit...
ooo im stupid
you're on dpy 2.0+ right?
That changed in 2.0+
uh
the dpy version
Yeah ok so you're probably 2.0+
Check the docs, it changed but i forgor it
!d disnake.Asset.with_format
with_format(format, /)```
Returns a new asset with the specified format.
@slate swan
is there a way to change a webhook channel?
Someone who can help?
also calling a Member object a user is monkey brain
but what to search, im from denmark and not the best for english
nothing to search, just read from the link
but can you pls help me
i am getting this very weird error NoneType' object has no attribute 'bot' i use disnake
and i am using cogs and yes i have self.bot defined
Maybe "from discord.ext.commands import bot"
if member.id == self.bot.user.id: this part for the code giving error
no thats just dumb commands already has bot
ok
from discord.ext.commands import Bot
@potent spear can you pls help me with my code problem
it's an indentation error, the link explains you perfectly what indentation is
nvm i found out
user = await client.fetch_user(id).send(embed=embed)
This doesnt work and nor does it print any errors ;-;
whats the whole command
Just an embed constructor up there and this send method
and could the users dmchannel possibly be closed? I'd imagine it would throw an error if it was closed
Yeah i added an error handler for that
ok so the channel is open
Yes
hmm
is there a user/member param in the function? it seems like there isn't as you said user = ...
Huh?
there is just, ctx, id and message
Yeah welp ;-;
probably have to await both
Tried that too
she had await ctx.send before but that still didn'yt work
Yep
as in equivalent to
user = await client.fetch_user(id)
await user.send(...)
```?
Yea
hm, that's odd then
What is wrong?
check the lines above @devout iris
i fixed it 👍
nope like bones said these types of errors get flagged in the wrong place i.e a missing colon
yeah ofc lol
🙃
!indents
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
you can make it a one liner and have you tried to get the user from cache first?
😳 how to indent easy 2022 (for beginners)
😭
not my code
you can atleast make it a one liner
how do I construct a blackjack command?
meh
One liners are pretty convenient
clarity over brevity imo
agree
the indent of the function is a bit off.
make sure to click on tab when you want to indent
One liners can be clear as well
await (await client.fetch_user(id).send(...) )
since youre getting a user obj just send it from there
they sure can

but await (await ...) ... is ugly as all heck
not really
can’t you also do await ctx.send(client.fetch_user(id))?
making a useless var is garbo
just….wondering
oh
ahhh
the performance impact of binding an extra variable is in the microseconds, the memory impact of binding a variable to something that's already in memory is near nihil as well
if that little optimization is truly relevant to you, you probably should be using rust lmao
list comps ❤️
still why make a var if you arent even gonna use it i see no real reason
they’re my wife
it's just personal preference
it literally doesn't matter
and yes ik making a useless var doesnt impact much but if you can make it
hello 
hi
Greetings
do any of u gentlemen know how to help me with discord py?
I now have awake paralysis
isnt getting better learning how to make everything compact
starting a bot?
yes!
well started it already
hard disagree on that
dek drop the tutorial
Which one
just couple of problems with a game im creating
if you don't know python basics, learn that first
there are lots
how.
no lol i know how to code. im just new to discord py
THIS SERIES IS USING THE DISCORD.PY LIBRARY WHICH IS DISCONTINUED.
CLICK HERE TO GO TO THE FIRST VIDEO IN MY NEW SERIES ON MAKING A DISCORD BOT IN PYTHON: https://www.youtube.com/watch?v=xc1VpbRd4is
In this video, we go over how to setup a discord bot in python using discord.py v1.0.1 (rewrite).
If you have any suggestions for future videos,...
maybe 😳
thought id get help to make it easier cause people here are probably familiar with it
?
ahh ok you made it seem like you were new to pygthon in general my fault
dont follow that
you said to drop a tutorial
that tutorial is rlly old
You didn’t pass all the necessary arguments
nah all good m8 
A tutorial on how to use discord.py to create your own Discord bot in Python, written to fix the flaws of many other popular tutorials.
a good updated tutorial
you need to know oop btw
btw they arent continuing to update discord.py are they?
also i would prolly use a dpy fork tbh
correct
just change the name lol
Oh that one
yeah, dpy is no longer maintained
I thought it was a video
?
!pypi disnake is my wife
there's a couple good forks though, and hikari is a great alternative
other than list comps
!pypi nextcord
A Python wrapper for the Discord API forked from discord.py
Wait hold it
hikari is better than dpy imo (i use disnake)
Fuck no
h…hikari?
watch out for pincer too
yes sir
yeah hikari is probably the best choice for python atm
no nextcord 😳
imo, that is
i'
Ok I’ll get started on hikari then
ill be using pincer and hikari prolly
pincer hikari are both good competitors but hikari gets the dub for the documentation
it's more difficult to use and get into than dpy forks, but yeah
100% cuz pincer is newer
🚶♂️h
personally still chugging along with disnake
Is there any way to switch off of dpy without rewriting hella code tho?
everything in hikari is mostly raw endpoint
yes
!pypi disnake
but may rewrite to hikari when exams are over ig
!pypi hikari
!pypi pincer
!pypi shutup
lmao
lmao
dpy 2.0 to any dpy fork should be mostly drop-in replacement
is dekky mad
1.7 to a fork is gonna be a bit more rough
but can generally be done in a couple hours
🗿
“Dek”
1.7 vs a fork isnt really that hard
How fucked am I
lol
2.0 is the main branch
ok so basically what im creating is a Russian roullute game. im trying to send a ctx send message with embed file which the bot reacts to first with an emoji. It requires 7 members to react to the emoji to start the game unless after perhaps 60 seconds it times out and therefore the game ends there. but if 7 people reacetd (meaning 8 reactions in total including the bot) the game continues. my goal is to put everyone who reacted with the emoji in a list, give 6 people (1) and one person (2). Whoever gets 2 gets punished possibly banned for a day then will be unbanned. the part im having problems with is the reaction part. Im trying to register whoever is reacting and put them in a list but i dont know how to get their username or @ put into that list. dont know the specific commands or methods used for it so plz gib help 
depending on the size of your bot
pretty easy
somewhere between a little fucked and many hours of fucked
Maybe.. 20k lines?
mostly depends on whether you were using slash commands from something like discord-interactions
there's been a couple other breaking changes, but most of the old text command schmuck should still work
discord components smh i hate them
I mean I already have my own slash commands wrapper that works w/ d.py on the side, I just cant use any of the new shit when my bot is responding to a message command.
anyone know what hosting and dtbase provider this servers bots use? bc i wanted to have an idea of where i should start for hosting

Lovely
purely for slash command implementation I'd recommend disnake, probably
as dpy fork
gg has good pricing
pebble host
but go with digital ocean
for hosting my bot, i use vultr
Same
xyz is the classic domain
i don't even host my bots
does require some setup and linux knowledge though
probably wont work tho if u are trying for ur bot to go big scale
Meh
so any one of u fellas can help me out with this?

ok finally found the channel
allows you to quite literally do
@commands.slash_command()
async def command_name(self, inter: disnake.CommandInteraction, strarg: str, intarg: int, memberarg: disnake.Member, ...):
"""command description
Parameters
----------
strarg:
arg that takes a str
intarg:
arg that takes an int
memberarg:
arg that takes a Member
"""
...
```and it'll do all the heavy lifting for you
okay can anyone tell me why clonechannel thing dont move channel to the place where it was before?
@solid crypt there are docs yk
it's pretty neat
I use entirely events on dpy
i cant find any. ive been like searching for a day. maybe i got a shitty luck
there's examples on everything in disnakea git
docs for what
wait actually I JUST FOUND IT
are there message/reaction collectors in disnake?
LMAOOOOOOOOOOOO 💀
im dont think so im not sure
i havent checked src
@arctic wraith my current system: ```py
prefix_cmd = slash_int.BotClient.add_slash_command(
'prefix',
'Check your server prefix.'
)
@prefix_cmd.on_run
async def interact(i):
...
oh
check ig
which api is that
how would i implement a command that waits for a message?
My own
Why are you writting your own
!d discord.ext.commands.Bot.wait_for
it took a long time
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**...
same as dpy, bot.wait_for("message", check=check)
just rename discord to disnake
I made it as a drop in thing to add to any of my bots that uses d.py
don't even have to, afaik
you can install disnake with a discord shim
so you can quite literally just import discord
lol, every fork of dpy
the bsd practice
Or import disnake as discord
“Just replace discord with ____”
