[Attempt 1] Error fetching balance for BTC: 429 Client Error: Too Many Requests for url: https://api.blockcypher.com/v1/btc/main/addrs/1CjUh46GJUYhhL35roN8TuwK8mkH26K9wu/full
[Attempt 2] Error fetching balance for BTC: 429 Client Error: Too Many Requests for url: https://api.blockcypher.com/v1/btc/main/addrs/1CjUh46GJUYhhL35roN8TuwK8mkH26K9wu/full
[Attempt 3] Error fetching balance for BTC: 429 Client Error: Too Many Requests for url: https://api.blockcypher.com/v1/btc/main/addrs/1CjUh46GJUYhhL35roN8TuwK8mkH26K9wu/full
#discord-bots
1 messages · Page 426 of 1
You are hitting the ratelimit for blockcypher, you should look into what the limits are and how they recommend you handle them
Yeah not a discord bot problem at all
Hello, I am attempting to make a discord bot but have 2 things I need help with. I am relatively new to python, with like a week's work of experience. I have watched some video tutorials as well as done a python beginner's course.
-
Sharing variables between files. How do I pull this off? I want my cog to import some variables from the main file so I don't have to type it in over and over for each cog.
-
How can I add new slash commands to my bot without needing to write the decorator every time? (see image)
Thanks in advance
- How do these variables get set or get changed? Are they just constants?
- Why do you not want to use the decorator? That's kinda just how you do it, there's nothing wrong with it
-
Variables are constants.
-
Idk keeps the code shorter less confusing for myself
I figured both out. For the first issue, I just made a config.py file and then imported it into my cog.
The second issue, I wrote some code to make a new decorator that essentially predefined some parameters to ease the addition of new slash commands, like setting the guild ID to restrict it to a certain server only. It eliminates having to write 2 separate decorators for one command
It's a pretty common trap to think fewer lines is necessarily better
You're not paying rent per line. Especially if other people are ever looking at this code, it being explicit and following typical library practices is way more important than minimizing lines
(You also don't need to use the guilds decorator if your bot is only in one guild)
also the class method of making commands is a lot more tedious
i don't believe sharing constants from main to cog file is recommended I ran into a bunch of import issues that way I would recommend using a .env file to store your constants or that data
Importing constants is totally fine so long as you're intentional with your dependency chain
It's when people put constants in a file that has a bunch of other entangled stuff that it gets messy
I guess you are right, but since this is my first project and the only person who will be accessing this code is me, doesn’t matter I guess
I have put the constants in a config.py file. Would there be an advantage to storing it in a .env?
ehhh since you're new imports may be a bit of a hassle, so using a .env file would help
but it depends on your preference
do you already know how imports work between python files?
Relying on envs introduces another dependency and only allows for strings. Personally I really don't see any reason to use them over (well placed) python constants unless you have deployment environment considerations
But there's like 30 ways of doing static configuration and none of them are particularly better than any of the others lol
Yeah. It’s just “import config” or “from config import something” right?
Yeah I’m using only integers so far, no strings.
yeah fair
yaml and toml are other pretty popular formats
Wow bro amazing you are making bot
What would be the best practice for storing embed messages? in the file they appear or in a seperate one then importing them into another?
Like a constant message you want to send? In multiple places?
i guess so yeah
Is it meaningful for the things that send that message to be in different places?
I'm working on a bot I built a few weeks ago, and suddenly I am getting error 4017 every time it tries to connect to voice. I swear that nothing has changed about the code, but I am losing my mind trying to find the source
Discord started enforcing E2E encryption. Check if the library you are using supports it, and update.
you are a lifesaver. Ill give it a go
It worked, holy fuck i'd been googling and asking AI and my friends and couldn't for the life of my find this. you saved my sanity
Hello chat
you can chat in #code-help-voice-text @fallen whale @lone sentinel
def search_iterable(iterable, search_with, ignore_case=True):
result = []
for o in iterable:
if ignore_case:
if str(search_with).lower() in str(o).lower():
result.append(o)
else:
if str(search_with) in str(o):
result.append(o)
return result
Thanks for the random code snippet i guess?
Commands won't sync to the guild on startup Trying to create an app_command group in my cog using GroupCog, can't seem to figure out what's wrong. Here's my code that's giving me issues:
@app_commands.guild_only
class Tickets(commands.GroupCog, group_name="tickets", description="Ticket commands"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@app_commands.command(name='ticket_test', description="Test command for the ticket system")
@app_commands.guilds(discord.Object(id=g_id))
@app_commands.checks.has_permissions(administrator=True)
async def reportmodal(self, interaction: discord.Interaction):
modal = ReportModal()
await interaction.response.send_modal(modal)
async def setup(bot: commands.Bot) -> None:
try:
await bot.add_cog(Tickets(bot))
except Exception as e:
print(f"Failed to load ticketing cog: {e}")
Using discordpy, how do I get a users channel and check if it's a voice channel?
a user object does not contain any information about a server
But if you have a member object, you can access it's voice attribute
!d discord.Member.voice
property voice```
Returns the member’s current voice state.
Hello, Chat!
Whenever I make changes to my Bot’s code, I usually get errors related to the token. I store my token in an .env file, but sometimes it works and other times it doesn’t, even with the same code. How can I prevent this from happening again and again, I’m at the stage of going crazy.
you need to get more details. what does "not means" works? what exceptions are thrown? what specifically is the behaviour?
Sometimes it's reading the token as none type instead of str, and sometimes it doesn't. I have no clue what's wrong with it, at this stage.
Can you show us your code and the exact error?
I’m on my mobile, I will later today.
for future reference it's better to ask for help when you're immediately available to respond and engage in back and forths 🙂
The solution is to put everything that handles the token into a try/except block and print out the error :D
Can you put buttons in embeds?
@unkempt canyon what are the uses of ai in my code because most of the time i get errors and what will be use of humans if they get advanced
session = requests.Session()
session.headers = {
"Authorization": f"Bot {token}",
"Content-Type": "application/json"
}
message = session.post(
f"{API_URL}/channels/1479903690562207796/messages",
json={
"content": "asdasd",
},
files={
"asdasdasdasd": open("test.jpeg", "rb")
}
)
print(message.text)
{"message": "The request body contains invalid JSON.", "code": 50109}
Does anyone know what might be causing the error?
I don’t know the api payload but you aren’t reading your file.
Show me. It wouldn’t make sense to just open a file and pass it to a value to me. I would expect the contents
You'll have a much simpler time if you use one of the popular discord libraries
To add file(s), the standard
application/jsonbody must be replaced by amultipart/form-databody.
https://docs.discord.com/developers/reference#uploading-files
yeah
but not only that, you need to remove normal payload data and send it inside the files parameter under the "json_payload" name
files = {
"file": ("test.jpeg", request.files["snapshot"].stream, "image/jpeg"),
"payload_json": (None, json.dumps(payload), "application/json")
}
message = requests.post(
f"{API_URL}/channels/1479903690562207796/messages",
headers={
"Authorization": f"Bot {token}"
},
files=files
)```
weird af
Yup
I didn't even know you could upload directly like this
There's the way of first doing POST /channels/id/attachments, then PUT to the upload url, then reference when creating message
it makes sense you can upload like this
That's what I knew
but very unintuitive
And that's what the client does
thats why it takes some time to load images
I’m trying to get a Scrapy project setup on my MSI windows … it says Scrapy command can’t be found… I installed it
Guys
What kind of bots are people working on?
I write a moderation bot and I made a few for interacting with AI, managing tags, role colors etc
Oooh cool. Like sapphire?
Its not as polished as sapphire but it helps out the server I do it for a ton
We get about 800 channel bans a month with it
I made a subscription bot that links PayPal to Discord and gives and takes away roles based on if they renew or cancel, etc. I use it to automate access to my animated bot
Dang thats nice. I just installed sapphire. I like it. If yours passes it up in quality lemme know. I have an 800 person server id be happy to have it in
Do you use OAuth?
Does sapphire do channel related bans and mutes?
or just full server
Its not that it doesnt work well polished, its just designed in a way that has a skill curve which could be improved
For the sub bot? I made it custom. Links email and ID and has a database and looks up PayPal webhooks to give or take roles.
Im not sure about sapphire. I just installed it.
This is an example of what my animated bot makes. Renders these and outputs them live. Ill show the view attached too
Sapphire is nice but I like custom bots more so im interested to hear about yours
I used OAuth to have discord users authenticate with their discord account instead of pairing the accounts without it
It lets you use Discord as a login basically
No like when you want them to log in to your site, they use discord to authenticate instead of your own custom login page for instance
How other platforms use apple, google etc to log in
I made a report bot thats a database. Stores all kinds of media and when you review it it sends it to uou
Wait no way
Thats sick
Yeah its super simple, took me one 100 line python file
Yeah i like fallout newv and 3
The bot i made is a ton like a pip boy
4 lost me, didnt like it really
Wanna see?
Sure
Can I dm you?
thats dope
Dang thats sweet
Its pretty cool. Ill show you around the server
Its a marvel rivals server but I ended up coding for it and got reallllll into it
W termux user
Ty ty 💜
does anybody know how i can use the interaction data inside a modal? i want to have the guild ID to pull info from a database to use for making options for a select menu inside the modal
it would just make my life easier instead of maintaining a list of options as the database changes
What is the interaction? And at what point do you want to use it?
the slash command which summons the modal and ill send what ive tried momentarily and im sure you can see what im trying to do
@app_commands.checks.has_permissions(administrator=True)
async def settings(self, interaction:discord.Interaction):
'''Bot settings for your server'''
await interaction.response.send_modal(server_settings(interaction))
class server_settings(interaction, discord.ui.Modal, title='Server Settings'):
cur.execute(f"SELECT * FROM db2.serverinfo WHERE server_id = {interaction.guild.id}")
myserver = cur.fetchone
selectoptions = []
for item in myserver:
selectoptions.append(discord.SelectOption(label=item))
setting = discord.ui.Label(
text='Settings',
description= 'Select Setting',
component = discord.ui.Select(
options = selectoptions,
),
)```
the error that this gives is that interaction is not defined in line 7 above^
You should accept whatever values you need into the modal's __init__
not subclass interaction
class MyModal(ui.Modal, title='whatever'):
def __init__(self, guild_id):
super().__init__()
self.guild_id = guild_id
self.add_item(ui.Label(...)) #something with self.guild_id
(also would be good to not use a synchronous database driver if using an asycnio-based library)
The official mariadb driver is async compatible and I have connection pools set up
Thanks for the help 🙏
Yo people. Im not sure i can post it here. I hope it will be help for a lot. Like to host your discord bot i found a hosting platform where u can get 1 month free hosting with unlimited resources like no limits on disc, ram, memory and with more a lot of features too!!
Dm me if u want it. Im not revealing it in here now. Like it is a hidden gem!
If it wasn't a scam you'd put it here so people can scrutinize it
Nobody's giving out "unlimited" resources as charity
I'm making a random ahh discord bot what commands do yall recommend I should add into utility
I'd personally recommend making a bot that fills a particular need rather than a Frankenstein of random unrelated stuff since there's like 8000 other Frankenstein running around already
i mean it's more like a bot that I'm gonna personally use and it's just for testing or learning purposes
later I'm probably going to make a bot that actually can go for a certain purpose (though i don't know what)
Well if it's for personal use then you can put in things you'd well...personally use. What's good for other people might not be good for you. Really depends what your server does and what the gaps are
i'm creating a new bot right now I have no idea what it's going to be used for what would you suggest
that's kinda new
Kinda hard to make something that solves a problem if you don't know what the problem is lol. If it's just a learning exercise you can reverse engineer an existing bot if you don't have any ideas
😭
I might make a bot for ticket systems that's like full fledged
Yeah that's a pretty popular space, good for learning exercises but not really if you want to make something that stands out
Good to learn about using threads
ahh
I want to make a bot that stands out but I have NO idea what I can do
I do have a really WIP bot that has like a eve online type theme
my main problem with that bot is the fact that it needs image generation and i just CANNOT get that thing working
darn you diffusionpipeline
There's some good libraries out there if you want to procedurally generate images like pillow and stuff
#media-processing would be a good place to ask
thank you
Who knows how to make discord bot???
Lots of folks in here, if you have a question you can ask it
Why do you ask?
Depends what you want the bot to do
my pc is beefing w python
is it just me or have people encountered having to use nested_asyncio as a workaround to a weird problem
What's the problem?
Nested event loops? Why would you need that?
@valid garnet also curious about this, do you mean like multiple event loops in one process?
yea
tasks for some reason caused a problem
Well what is that problem
Although I don't think this is related to Discord bots
Well we'd need to know how you're starting a task and what that problem is
Hello.
guys
whats this?
its not really an error because it works exactly as it should
is there a reason i might want to fix it?
well it expects something that supports write i.e the write method text io is much more broader scope you can just typing.cast it if that line is bothering you
Oo then no need to fix it
Interesting, that never happened to me on strict typechecker
Hi
hi
Hi
Im looking for some information
anywhere to download a opus.dll for discord bots?, im trying to use a bot for playing audio files, and giving me headache
well finding that isn't really related to Discord bots
and how come you need that dll file for just playing audio...
Looks like i cannot download discord[voice] in latest python updates
And PyNa library is not compatible with discord.py 2.6.4
Bot playing the audio like Groovy etc, but with local mp3 audio
2.7.1 is the latest version 
What are you makin
Which library is the problem here?
Idk what PyNa is
Exactly its PyNaCl
So uh yeah I'm 101% sure an "opus.dll" file isn't related to this
Update both libraries anyway
Ok thats the only thing i wanted to know, ill dig on it
You should be using 2.7.1 regardless because of the DAVE requirements
Yuh
i fixed updating to 2.7.1
and this is how it works
Your MP3/WAV file
↓
FFmpeg decodes it
↓
RAW Audio (PCM)
↓
🔴 OPUS ENCODES ← WITHOUT THIS, DISCORD REJECTS THE AUDIO
↓
Sent to Discord
↓
Users hear it
its a cctv system for a game, that send alerts
OPUS ENCODES ← WITHOUT THIS, DISCORD REJECTS THE AUDIO
Are you sure lol
I didn't need to do that manually when I made my bot play voice with dpy
FFMPEG_OPTIONS = {
'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
'options': '-vn'
}
vc.play(FFmpegPCMAudio(stream_url, **FFMPEG_OPTIONS))
is all I ever did. stream_url in my case was an mp3 url
hi guys i am looking for a job
you're in the wrong place
Guys how much python do i have to know to be able to build a discord bot
Python fundamentals like variables, loops, functions, condition statements, etc. And a little of OOP and async programming would be useful
these are good starting scripts https://github.com/Rapptz/discord.py/blob/master/examples/basic_bot.py https://github.com/Rapptz/discord.py/blob/master/examples/advanced_startup.py
making it do what you want is the part you'd have to know the fundamentals of python for, but to create one with no function isnt too bad if you learn from these starting points
Thanks
Is possible to remove rate limit on dc api?
...if you could just remove it at will, what purpose would it serve
No offering of paid work here
!pban 1421100595099734106 scam
:incoming_envelope: :ok_hand: applied ban to @static flume permanently.
@static flume 1421100595099734106 sent me a malicious link
Hi guys who do i need to speak to about advice on creating a bot for my server
You can ask any questions here and folks can help
Thank you Its hard to explain i am wanting to build a bot that I can set up with my d.jing software or like Spotify to be able to play 24/7 music in one of my voice channels
Distributing music you don't have the rights to is against tos. I'd suggest just using Spotify's native listening sessions
(Discord aggressively compresses and reduces the quality anyways)
Sorry so I meant to set it up to my mixxx account
Ive managed to create the bot and invited it to the server. But from there I have no idea on how to actually link it up to my mixxx account 🤣
What does "linking" mean to you?
So like making them both work together ahaha
To do what
So when I go live on my mixxx software I could use the bot ive made to connect to my mixxx account and play live in one of my vc channels 🙂
Why not just stream it through your own audio? What is the bot accomplishing?
We are currently partnered with a discord called vibe radio and there bot is live in our vc 24/7 playing music. So i was ideally hoping to be able to create something simular we have a few discord servers linked in with us also. So to be able to use the bot to be placed in each server if that makes sense
So you play music locally, the bot sits on multiple servers and plays that at the same time?
Yes ideally 🙂
As i can get mixx to auto dj till one off us wants to go live on mixxx and do a set 🙂
That's going to be a bit on the complicated side. Would you be running both the music and the bot on your local machine?
I don't know. I dont know how I could get it to work. I cant find in the bot settings anyway of being able to set it up to work with mixxx
I know its possible as thats how vibe radio do it. But to set up i have no idea. And the guy that set theres up isnt around anymore aha
There isn't a bot setting because it's you making the bot lol. You have to code it
Do you have programming fundamentals? In python?
I dont think so
Not sure how you wound up on a python server specifically 
Ive been using this so far but definitely on the wrong thing all ive managed to get this to do is make the bot live 🤣
Yeah any of those cookie cutter bot creation sites aren't going to do something this complex
You'll either need to invest in learning a language (like python) or pay someone to do it
Brilliant thank you as everything I google doesnt even explain or help me do anything. Ahaha
Or maybe someone's already built this but I doubt it
Do I just download python on my pc?
This is going to be a multi week investment, at minimum, to build up the skill set from zero
I really appreciate all your support and help. 🙂 I can see this is going to be a big task 🤣
Even YouTube videos make no sense or are relevant to what im wanting the bot to do
If you're interested there are loads of resources out there to learn python and programming concepts in general. But you won't learn how to do this specific thing, there are several layers of concepts that build on top of each other
You can't walk into a nuclear engineering class not knowing what a blueprint is and expect to learn
Exactly! I really do appreciate you taking the time in talking to me. 🙂 ive got more answers from you in this messege than I have googling and watching videos the past few days 🤣
No problem. As a quick stopgap you can probably use a virtual audio cable to tunnel output of your program to a mic input on discord
Yeah 100 percent. For what its going to be worth. It was more of a going forward wanting a bot more than anything really ahaha
I didnt release how complicated it was to set a bot up to be able to do that 🙂
There's a reason software engineers make six figures lol
Using existing bots can be pretty easy, but if you want something custom you generally either pay someone or build it from scratch
See this is exactly what im wanting the bot to do ahaha
But ideally I only need it to be able to do the live stream part ahaha
You could ask them 
But they most likely have custom code running that streams audio, and who knows where that audio is coming from or how the bot is getting it
Once you have a good grasp on python, you can find numerous examples of bots that stream audio from youtube. You'd just have to then write the code that takes it from your thing instead
Yeah exactly ill have to do some digging ahaha
I know there audio comes from mixxx when they go live but not sure about when it goes to auto d.j ether so ill do some digging ahaha
hello
do you know a discord server for sell my discord bot?
it´s incomplete but i wanna know a server for sell it
Not the place for it here. You're also trying to squeeze blood from a rock, there's incredibly little money in discord when most of the user base refuses to pay anything
i mean a Creatos of Discords servers
Wut
This is a place for helping people with developing their bots (made in python), not selling things
ok, i am only asking if somebody know a place for do that but well
Does your discord bot do something interesting? Maybe you could talk about it in a relevant community and show it off and if people are interested tell them they can buy it off of you. I don't imagine there's a marketplace server where people are arbitrarily selling discord bots to people though.
Yeah such a place would just be an unreadable cesspit of people plugging their stuff
Especially now that it's so easy to vibecode a bot that at least looks like it works
yea, like "hey chatgpt, give me python code for a discord bot to do x"
I wouldn't make a bot I intend to sell without making sure there's interest beforehand
The last bot I seen sold was actually really bad and it was a telegram bot, very few lines, costed like $200, and all it did was take a list of groups, and add people to other groups. It was the first thing I got paid for (to add to/fix up) and I made significantly less, not to mention the code didn't even go much further than what was available in a guide already. But it did happen to be a piece of software sketchy people wanted. I'm not encouraging that and I'm not proud of this in general, i next got asked if i could help with drop shipping, and sniping instagram usernames 💀
This isn't the first time I see people overpay someone to make a bot
The audience that will buy stuff like that I think is people who have no idea about anything, and will assume anyone who can produce working code is a genius, so they'll just pay whatever. Even then it's more like you gotta know people and they gotta ask you for stuff, rather than advertising so much.
No, its only a Administrator server Bot , with administrator options and save the message on a DB with sqlite
also, is in developing right now
This applies
You will generally have more luck making a custom bot at the request of a server owner.
If you just make things you're guessing people will want, you'll be sorely disappointed when 80000 other vibe coders have the same idea
Not trying to sell a premade bot
ok , thanks for the help
i just open sourced my fluxer bot! yay!
i think its discord bot adjacent enough for it to be in this channel
How I make a bot
The first step is to make sure you have a solid understanding of the basics of Python
then you can pick a discord bot library. There is a list of popular ones here https://libs.advaith.io/#python. You could use the raw api if you want but that is much more difficult
After that you should follow the docs, examples, and guides of the library you choose. Avoid following random youtube or 3rd party tutorials.
Compares Discord libraries and their support of new API features
how I work it
Can you elaborate? What exactly are you stuck on?
A hands-on guide to Discord.py
hello
Thank u
https://github.com/smanav225-hub/AutoClaudeBot Made this discord bot.
GitHub
It is a Discord Bot, which contains free and premium features of Mee6 discord bot. - smanav225-hub/AutoClaudeBot
Anyone wanna check it out or rate it?
Condones vibe coding, instant pass
?
are you talking to me?
OO I sense drama brewing
As the person who just posted a GitHub with a file endorsing vibecoding explicitly, yes
Don't know who else id be talking to given the context
it is not vibe coded, It is coded with AI.
Vibe coding means when you don't know what you are doing or only know a little. and trust AI completly. Where you are just prompting AI and trusting that it works perfectly
whereas I planned it out, I made all teh structure, I designed the GUI, I designed everything, Every script which is there was prompted by me tens to hundreds of times and checked.
All the markdown files are made by me, i wrote like 500-1500 words summaries for each markdown. and then AI just fixied the grammar and converted it to markdown
You're condoning it. I didn't say that's all you used
yeah I made that. that file contains all the instructions on how to vibe code, made that after completing my project.
This discord bot wa built for a competetion for a server of 2500 players. And the owner wanted a easy way to vibe code it, as without any extra work he can simply prompt the AI and add or edit anything in my app.
It was made for the owner of the server, so he can vibe code it easily with claude code.
And all the examples and the code snippets in it, are designed and written by me.
And I think it is irresponsible for you to condone it and encourage people to take that approach
you don't know the context. The owner of the server is a developer of a github repo with 15k stars. He is making a app to help developer vibe code.
https://github.com/AndyMik90/Aperant It was built for this server. I created teh file so anyone can edit it and use it. It contains all the instructions so you can jus type 2-3 prompts and create any new features which you may want for your server
I would say it is helpful, As anyone with 0 coding knowledge can download my github repo, give it to any AI directly and ask it to remove or add any feature.
As a user standpoint it is necessary. I realized it after making the app.
And the AI will shit out code that doesn't work, they will have no idea why and will have wasted that time (and environmental resources) instead of investing in themselves and learning a skill
Just consider someone who made a discord server and has about 1-10K players and dont want to pay for dyno or mee6 in discord.
He will downlaod my app and directly start using it.
Only a couple of million people know how to code. You can't expect everyone to know to code.
I don't. I expect them to pay people who invested their time to learn a skill and do the thing properly
Just like I don't know how to do brain surgery and will gladly pay someone to do that if I need it
For the file "how to vibe code.md" it contains enough instuction that AI will not edit any unessecary file.
the only reason someone would use my discord bot is because they would not want to pay for it and want the paid featuers of mee6 and dyno for free.
So for a free user it is good.
And if someone wants to do it properly and spend money, then they can directly buy any discord bot subscription. Or they can hire someone to do it for them.
Yeah i condone that, even while vibe coding you should atleast know what you are doing, and not completely trust ai for everything.

You don't have a license, BTW
@fast osprey I agree with your point also.
Thats why i added a file called file strucutre, which contains everything you need to know about my project and its working in details, which a person can simply read and understand how it works.
https://github.com/smanav225-hub/AutoClaudeBot/blob/main/File Structure.md
GitHub
It is a Discord Bot, which contains free and premium features of Mee6 discord bot. - smanav225-hub/AutoClaudeBot
Anyways besides condoning vibe coding, this looks like a random Frankenstein of completely unrelated functionality, including several bits that already exist natively in the client
👍
I also don't like vibe coding.
I am still learning.
This was my second github repo.
I just started using github from last 2 months ago.
yeah, but in your setup instructions you say to pip install -r requirements.txt
Should have made a requirement.txt
dont force sync slash commands in on_ready
I was looking in the README
I think, I should probably learn how to make proper github folder structure.
Why do you have httpx and especially requests when aiohttp is already avalible?
Wut
I don't like X
specifically makes a file called "how to X" and publishes it
also watching seven minutes video to get a bot token is very something
also i don't think this is a .db file, this is a .json file
Fair point. There's a difference between encouraging vibe coding as a first approach vs. enabling people who'll do it anyway without completely breaking stuff. The guide was just meant to be practical for that, should've been clearer about that distinction.
it is a database file.
in this app there are 2 database file
1 file to remember the GUI and the last state in the GUI, like which setting you enabled and stuff.
and the other database file stores all the discord messages
DB in alternative reality lol
I stored the data as JSON in a database file because it needs to store your Discord token and settings between sessions.
but you already have token.txt?
like why do you need to store your token at 2 places
also, name a json file .json please
JSON has a reserved file extension .json. And .db by convenient used for SQL databases that using file
uhh where?
forgot to clear the token.txt. it is not used. I used that for testing in the start
Listen
I did it on purpose and stored it in database(.db) file format.
Because it stored your "token" which is private.
If anyone in future want to secure it or add security to the Database then they can easily add it.
While json is just like a text file which you are directly open it.
when you tried the app, did it work?
the file extension does not change how a file works. On linux the file extension is often not even used in processing
i don't run random apps
...but there is no difference how is data represented if you change a file extension
You can protect a .db or database file, by adding password or encryption. It needs security as it stores Your token.
in a .json file you cant add any security or encryption
changing the extension from .json to .db isn't how you make a database
Okay. For example, remove a file extension. Will it change a data inside a file or not? @dry olive
and also to answer your question from where i get "Token.txt" you can search a string inside the project using many tools, on github you can search with the search bar on the repo, in vscode you can search with % prefix to search all the matched string in the whole project, in command line you can use grep -ri tool to search a text inside a directory
granted i only click in the repo and i immediately navigate to data.db and Database.py because sometimes beginners just push all their secrets on to public repo
Okay, I'll try to explain in more details.
A type of data is determined by, if we consider textual data, its syntax. For JSON, it's a JavaScript object (because an abbrevation means JavaScript Object Notation). And there is organizations that register a file extensions to a type of data to determine in the future what is it and how it to handle.
You can, of course, use data.db instead of data.json, but 1) you don't complain to the standard; 2) tools will wrongly consider that it's a DB instead of JSON; 3) devs are used to these file extensions.
And also DB files are binary, not textual
UPD: fixed grammar errors
JSON is a data interchange format, it's not even a good config format (*IMO)
@dry olive And, please, don't assert that you know something if you can't be sure about it. We're here to help you, but when you're trying to prove that it's made for some reasons that can't hold a critique, then it's so hard to keep to help you
i am happy with the critique's.
Will not be doing the same mistakes which you and other mnetioned
do anyone know discord.js?
my music part of my bot keep giving me errors where it wont stream the bot and play it in the call
i even asked ai about it and it dont even work with ai
you're in the wrong server
Wheres the discord.js server
Js is the worst language 😭
why you say that
ayo guys
u think it's possible to build a text based online rpg game w/ a discord bot?
I was just thinking cuz these rps are rlly boring and is normally based on discord but they can't play here
My understanding of text based rpg games makes me feel like discord bots would work decently well.
Especially if you are using the component system. An image and/or text plus some button options would look nice.
cuz python server but on a serious note do use typescript instead its a much needed extension on js and makes it much more pleasant to work with
i use it on my discord voice master folder
not my main bot folder ( with all my commands)
any suggestions in terms of text formatting?
What I'd probably do is find a way to display some of the information in a "flow", not explicitly by categories
Like
-# Created by cookietermed. Waiting for opponent...
Instead of splitting to fields
Programming languages are just tools; for example, I would never use Python for high-performance tasks.
Meanwhile you:
soheab in the djs server smh
blasphemy
thank you bro
dang this man already doing what I thought of
guys btw
I'm rlly stupid with discord bots running on python so... how do you make the /cmds pop up?
It depends on which library you're using
how many diff python discrod bot libraries are there?
I only know the one that's just named discord
discord.py is the oldest and probably most widely used one but there are several
https://about.abstractumbra.dev/dpy is a good resource if you're using discord.py, read all of it carefully, especially the part about syncing
Umbra’s Rantings
My site for random things and stuff. Including a custom pip index and walkthroughs, both for discord.py!
What abt it
Been doing it
Also have integrated Roblox auto deposits without using an external api
Which I don’t think any bot has capability’s of doing
I mean realistically Python is the most reliable language for getting the job done where as js isn’t every optimisable
That’s just my opinion, the stuff I specialise in which is embed views for pvp games etc is much harder to do through js
No doubt on this. You can practically do anything you'd want to and the real question becomes how fast, at which point use optimized libraries for sensitive parts in native code or something, or try pypy. I can't recall the last time I found something I wanted to do that python physically couldn't regardless of how far I've gone in any direction that wasn't related to efficiency in the language it's self.
guys
not a way to directly upload a file to the bot?
to the bot i mean, not from
like i send it as an attachment and the bot saves it?
or do i must use request
You would check the message's attachment and then you can save it
Something like this:
async def receive(ctx):
# Check if the message has attachments
if ctx.message.attachments:
for attachment in ctx.message.attachments:
# Save the file locally
file_name = attachment.filename
file_url = attachment.url
# Download the file
async with aiohttp.ClientSession() as session:
async with session.get(file_url) as resp:
if resp.status == 200:
data = await resp.read()
with open(file_name, "wb") as f:
f.write(data)
await ctx.send(f"File `{file_name}` received and saved!")
else:
await ctx.send("Failed to download the file.")
else:
await ctx.send("No file attached to your message.")
oo tysm ill try
worked first try, tysm x2
Does the same thing as above but yes
Oh also, ctx, image: discord.Attachment would require the user to pass a file
Can be wrapped into a list[] too
https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html#discord-attachment
Why not just take it as an input to a command rather than reading it off a message?
or through a modal
Hi 1 question i have a big dc bot 1 of his many functions is to send messages in DC from a site that I configurated but how can I see some messages before
Pls ping me in case
Can you explain further? You want to see what the message is before it gets posted to discord?
Now the flow is from the site I tipe and the bot tipe it in a channel
I would like to see some previous messages so I ca basically see the last messages of that channel
You can fetch messages in the channel. But overall this seems sketchy. Why cant you just type in the channel normally? Instead of through the website
Sometimes I don’t have access to Discord, not even from my phone (I’m still at school, so sometimes I don’t have access to my phone, and therefore not to Discord). Also, since it’s a moderation bot, there can be some issues, so this way I can still communicate through the bot directly. The server has more than 700 members. If you want, I can send you an invite to the server so you can se the bot.
If you're in school, maybe you should be focusing on school instead of using some hacky website to proxy into discord
That doesn't address at all what I said
I guess that makes sense. You should make absolutely clear that your bot is relaying messages outside of discord though. Probably should limit it to a specific channel
Can I send the code somewhere so you can check it (its only a cog)
you can send it in this channel or #1035199133436354600
I also run a moderation bot. could be cool to see what you're up to
Ok, but its to long my cog 2000+
Upload it to your Github and share a link here. Or use any pastebin service
Pasting large amounts of code
So that everyone can easily read your code, you can paste it in this website:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Any formatting suggestions for this
I feel the price range or emoji is making it look off
I'd use CV2 instead of embed with fields
That's how (imo) you can shift from looking technical to fun
!learn
Go-to beginner resources
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff — an online book (also available to purchase as a physical book)
- Harvard’s CS50P course — video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course — text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
guys
im completely clueless
want to use buttons but have no clue how they work
class Components(discord.ui.LayoutView):
container1 = discord.ui.Container(
discord.ui.TextDisplay(content="\nButtons"),
discord.ui.ActionRow(
discord.ui.Button(
style=discord.ButtonStyle.success,
label="button one",
custom_id="b9a193e3947f4a3fcef563f303fe658d",
),
discord.ui.Button(
style=discord.ButtonStyle.danger,
label="buttone two",
custom_id="90cf71c7c02644fef62b6e0412b7e13d",
),
),
accent_colour=discord.Colour(9225410),
)
@bot.command()
async def send_components(ctx: commands.Context) -> None:
view = Components()
await ctx.send(view=view)```
how do i any functionality?
generated using discord.builders btw
You should subclass Button and implement a callback
add an embed
and go from there
after you add your feilds etc
of wtv the button is bein used for
You can't have embeds in components v2 messages
class ButtonOne(discord.ui.Button):
def __init__(self):
super().__init__(label="a")
async def callback(self, interaction):
await interaction.response.send_message("a")
class ButtonTwo(discord.ui.Button):
def __init__(self):
super().__init__(label="b")
async def callback(self, interaction):
await interaction.response.send_message("b")
class MyView(discord.ui.LayoutView):
container = discord.ui.Container(discord.ui.ActionRow(ButtonOne(), ButtonTwo()))
or subclass ActionRow and use the decorators like you would a normal view
class RowOne(discord.ui.ActionRow):
@discord.ui.button(label="a")
async def button_one(self, interaction, button):
await interaction.response.send_message("a")
@discord.ui.button(label="b")
async def button_two(self, interaction, button):
await interaction.response.send_message("b")
class MyView(discord.ui.LayoutView):
container = discord.ui.Container(RowOne())
okay tysm both, ill see
guys
does text formatting not work in embeds
im trying to set a footer with -# but it displays it as is
embed = discord.Embed(
title='-# title',
description='-# description'
).set_footer(text='-# footer')
ok so as appears, it works in embed but only for description, not footer or title
no work around?
i just want a smaller text
It does in some fields
oo okok
But also, use cv2 / the container component
That's all with TextDisplays which supports full markdown
Footer text is already smaller
from discord import ui
container = ui.Container(
ui.TextDisplay("### Title"),
ui.TextDisplay("Description"),
ui.TextDisplay("-# footer"),
)
stats_view = ui.LayoutView().add_item(container)
await ctx.send(view=stats_view)
Assuming discord.py
yea but
-# its faded aswell so that makes it better for my purpose
oh yes ty this work
!clban 1484660952547983360 scam
:incoming_envelope: :ok_hand: applied ban to @untold whale permanently.
built a geyser grpc benchmark tool, open source — compare providers side by side
wsp I'm learning the basics of Python, and once I've learned the basics, can I jump right into creating my first Discord bot, or not?
Really depends what basics means
but regardless, you'll want to cement those concepts with actual targeted practice of those concepts, not a bot
how do i fix this 😭
depends on how these files plural are structured
assuming you're trying to define token in config
correct
Updates/sec │ 23,819 ████████████████░░░░░░░░░░░░░░░░░░░
Peak │ 47,320
Latency │ 0.1ms
Uptime │ 01:07:46
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Accounts │ 60,330,746
Orca WP │ 2,155,361
Raydium │ 11,764,662
Meteora │ 4,907,414
Vaults │ 41,503,309
Slots │ 61,840
Total │ 79,845,437
https://ghostgeyser.pro/
High-performance Solana Yellowstone gRPC stream. 23,000+ updates/sec, sub-3ms latency, no rate limits. US East Virginia. Free trial available.
i mean they are all in the same folder if thats what you mean
the structure in that file is relevant
you'd get an import error if it couldn't find that file
well me neither because I can't see the file lol
what can i show so you know enough info
token = 'x'
mongoURL = 'x'
phishObserverKey = 'x'
phishReportAPI = 'x'
fishfishKey = 'x'
developers = [x, x]
watcherChannel = x
watcherLogChannel = x
reviewerRole = x
teamRole = x
certstreamFeed = "x"
iokRules=["x", "x", "x"]```
@fast osprey does that help
what happens if you try from config import token? Does it find it?
tried that does not work
so no
for some reason python cannot read anything in that file
have you saved the file?
yes, ive tried. i just got it to work. i looked in the actual file and there was nothing saved to it, it was just blank. not sure why. so then i saved as and then it actually saved
strange, never have had this issue
Does not work how
But yeah possibly just looking at the wrong thing in vsc or saving it elsewhere
Why don't you just store the token in a separate “.env” file?
Wtf is it token grabber?
looks like they are making an app to block phishing urls, not sure where you got token grabber from
my exact thought too
a config.py isnt efficient enough just use env
also your functions.py isnt gonna be able to function
😭
What about a constant file isn't efficient?
wdym
why would you even use that
thats just more and more work
How? It's much easier to import from a Python file than from an .env
Something something pushing .env is harder than config.py something
In reality, they both have equal chance of accidentally being pushed to remote
Many template git ignores include .env by default but that is splitting hairs. Although by convention .env is often understood to be more sensitive than any .py file.
Config formats are essentially interchangeable as long as you know what you're doing
!learn
You're probably trying to run bot.py from a different directory.
Open the bot's folder then right click > open powershell (within that folder) then try python bot2.py.
It was an editor saving issue
^^ as solstice said, vsc wasn’t saving correctly
Uhm there’s not really too much of a risk in my opinion. It would probably be better practice to use an env file although
Yep, it’s a simple app to track phishing and report it.
And why’s that 🤔
There really isn't a benefit IMO, people just like parroting what they were taught. Other formats are better for configuration (ex toml) and other approaches are better for sensitive secrets (ex docker secrets or a secret server)
Importing a library (dotenv) to then emit constants into the environment to then consume it rather than just directly importing it is pretty backwards
I like .env as it gives me the flexibility to use normal environment variables. For example as different run profiles in pycharm
Yeah the advantage of a .env for me is that you can pass stuff in a fairly standard way, like if I'm using docker[-compose] I can easily set env vars, whereas mounting a readonly volume for a config file is more annoying. Not really a major issue, and you can use whatever, but there is a definite benefit there
This^
You can use either but at the end of the day env is just pro
@fringe harbor
Hosting provider suggestions?
Does anybody have a Discord Developer Portal team where the owner is identity verified so that I can verify my bot?
That does not seem like a smart plan. If you add your bot to a team it is like transferring the ownership of your bot to the team owner
oh well
gotta find someone i trust
yk
Or verify it yourself
Someone would be pretty foolish to go through the trouble of verifying and then take responsibility to run a bot some rando made (who refuses to get verified themselves for some reason)
I can think of 2 pretty strong reasons to not get verified yourself
Although the first part still stands
Hello, I am trying to make a bot that takes all the messages from a discord server of mine, prints them, and reads them out loud. They successfully print, but arent said. I am told that i dont have PyNaCl installed, despite installing it earlier.
Error: "WARNING:discord.client:PyNaCl is not installed, voice will NOT be supported"
My code (<API> is my bot api token, but replaced so its not taken) :
import discord
import pyttsx3
engine = pyttsx3.init()
API_TOKEN = '<API>'
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
guild = discord.Guild
@client.event
async def on_ready():
print('ready'.format(client))
await client.change_presence(activity=discord.Game('👀'))
@client.event
async def on_message(message):
message_content = message.content
message_author = message.author
print(message_content)
text = (message_content)
engine.say(text)
engine.runAndWait()
if name == "main":
client.run(API_TOKEN)
How are you installing the library?
I will use a venv, and once it’s downloaded, I’ll move all the files to the directory the code can actually access
pip3 list
Maybe try this
I will in a sec, Im away from my computer rn
put it into a terminal and got
Package Version
pip 23.0.1
setuptools 66.1.1
wheel 0.38.4
List out what's in your venv
Package Version
aiohappyeyeballs 2.6.1
aiohttp 3.13.3
aiosignal 1.4.0
attrs 26.1.0
cffi 2.0.0
davey 0.1.4
discord.py 2.7.1
frozenlist 1.8.0
idna 3.11
multidict 6.7.1
pip 23.0.1
propcache 0.4.1
pycparser 3.0
PyNaCl 1.6.2
pyttsx3 2.99
setuptools 66.1.1
typing_extensions 4.15.0
yarl 1.23.0
Are you using discord.py[voice]?
no, i dont think so
im trying to do tts out of my computers speakers or on a recording
not have the bot in a vc
If it's something else that's outputting the sound, or supposed to be, this doesn't sound like a discord issue at all
ok, sorry
Probably an issue with pyttsx, never heard of it though
@tidal zinc How about you make sure that it's not a discord problem by just running the library.
Hi!
Did any body can give me suggestion that I had learned discord.py on intermediate and I want to go on advanced did any body can tell what I need to do?
A hands-on guide to Discord.py
Thanks! brother.
Really depends on what advanced means to you. Also worth noting the above guide is not officially endorsed by the library
Hard to make recommendations not knowing what you're specifically trying to learn. The library itself isn't all that complicated once you have a firm grasp of the underlying python concepts IMO
how to make some of my hybrid commands work in a gc or a users dm as well?
Umbra’s Rantings
Hello! This post is all about User Installable Applications and how to set them up.
I need some advanced thing to practice on ui things like options,buttons and embeds,etc. brother and want to get a deep dive in them.
The repo has examples of all of those things. I'd suggest copy pasting one of the examples, coming up with an idea and modifying the example to see what happens
Which repo brother!
The discord.py repo. It has an examples folder
Hey guys is there anyway to get around the limit of 5 followup responses for slash commands on user installed app
Why would you need to send so many followups and flood the user's screen?
Also limits wouldn't be limits if people could just opt to not follow them
So that's a no?
You would need another interaction. There is no way to increase the number of allowed followups in a single interaction
!learn
Go-to beginner resources
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff — an online book (also available to purchase as a physical book)
- Harvard’s CS50P course — video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course — text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
thanks! Brother
!learn
Go-to beginner resources
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff — an online book (also available to purchase as a physical book)
- Harvard’s CS50P course — video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course — text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
Which one is easy
They are all for beginners. None of them are "easy" because programming is not easy for beginners.
As newbie how can I start?
i used python crash course 3rd edition. try that better than yt tutorial hell
It's easy, i mean i don't understand much technicall language till i see some real examples too
Just go as your teacher guide ig
It's been a while since I have looked at those examples. But they were made for people with 0 experience with programming so they should explain the technical language
Ok
What are some good commands that MUST be into you discord bot?
None
If every bot copy pasted functionality, why would you even bother inviting one of them? Let bots serve specific purposes
That said, there are some general purpose maintenance things for the bot developer that are generically useful (like evals or system resources), but for user facing stuff I wouldn't suggest it
Some kind of status command I guess would be useful in any bot. So you can check it is running.
In that line, I'd highly recommend jishaku if you're using discord.py, it packages a whole slew of owner-only maintenance commands for you that are implemented quite well. Had to catch myself there not thinking about the dev 😅
/ping
/info
Can't think of anything else that you would need
/sync command is a definite must
Not sure why you'd want that to be a publicly visible command 
or have it at all but I'm pretty sure it was a joke
why am i having such a hard time understanding loops
What's the confusion?
pip install discord.py python-aternos
lol made this to get guild specifc bio
Nothing stopping someone from documenting this on the api docs (so then libraries like dpy will follow that)
But I was also wondering whether it should be a cached property 🤔 or would I need to keep fetching it
If it's in the context of making a discord bot, replit is not suitable in the first place
This is only for the current user, right?
Uh yeah for current bot
Most definitely that field does not exist for users
if u want to use website, i recommend idx.goole.com but codespace is more comfortable
replis is an a** in every aspect as a website
Pretty sure it violates their tos to scrape with a user cookie and bypass their api
!warn 1327450740951613532 I've deleted your message as it violates our rule 5 (by violating twitter's ToS)
:incoming_envelope: :ok_hand: applied warning to @stray sleet.
What would it mean for a bot to be made up?
created
How would it be fake
I assume that this is another bot, that changed their profile picture and name with the member edit endpoint
Thanks for making fun of me , are you happy now
Overjoyed
It's really unclear what you're trying to get at though. We can't really tell anything about the nature of a bot from a screenshot of a message it sent tbh
If that was being said in the beginning I would actually pay attention more , I was just trying to say if that’s an online bot that the owners changed the profile picture and the name or is it a local bot that was made by the owners themselves
You can only modify the server profile pic of a bot if the bot specifically gives you a method to do so
Like premium membership? Right?
That's up to the bot to implement if/how it wants to
where is the general channel in here i cant find it
!offtopic
Off-topic channels
There are three off-topic channels:
Use any of the three, it doesn't matter.
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
Can you set/change a View object's timeout to None after the button is pressed?
Dpy at least doesn't support you manually modifying the timeout, though I'm not sure why you'd want a view to last forever specifically after it's interacted with once
Does it matter what the timeout is, if the view only contains dynamic items? (or non-interactable components)
If there aren't any components then the view timing out doesn't do anything. tbh I'm not even sure if it gets added to the view store at all
I didn't say there aren't any
"component" is a bit of a loaded term
but the view store only exists for routing interactions, so if there aren't any interactions ever happening it doesn't matter if/when that view is in the store
So the view timing out does not affect a Dynamic Item that's in it?
iirc it does deregister, because by setting a timeout you've told the library you don't want that interaction handled
Hmm although dynamic items are added to the bot via a separate function so I wouldn't be sure it's tied to the view
I'll test it
Was also wondering whether I should set timeout of views that only contain components of CV2 that can't be interacted with, to immediate, for optimization
At my scale it doesn't really matter tbh
But maybe it's good practice rather than having many views wait like 3 minutes to timeout when you might as well make it immediate
Alright, but I still dunno what should be done with dynamic items, I'll check later
Presumably if you're making it dynamic then you want to respond to the interactions forever, in which case a timeout isn't really appropriate
Yeah but I see the view here as just the way to send the dynamic item, rather than managing and dispatching it
That's probably not how the maintainers look at it
It would be somewhat unintuitive if an arbitrary subset of components on a message continued to work after a timeout you set expired
Although looking into it, there is a flag for if everything in a view is dynamic but I didn't have the time to drill into how that flag is used
Hmm I couldn't find something like that
Ok just found it
So it looks like it doesn't go in the viewstore:
Which would also mean timeout does not affect it
This tells us nothing.
• What did you expect to happen?
• What actually happened?
• What might have caused the issue?
• What have you already tried?
Help others help you.
Also I suggest you delete it for a reason I don't want to mention before that's done
it gone now
oh mb
Make sure you don't send line 13 next time :p
Anyway uh yeah
yh mb
gimme a sec
ok so on the questions it doesnt solve it it sends to gemini but doesnt look for place holder when it gets it
Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.
i gave it more detailed
This is a long file, where do I look?
try line 241
What happens? Does it keep sleeping or does it hit the exception?
1540 lines of slopmaster 3000 from claude, gemini, venice ai chatgpt
hold up lemme send ss
useless html works
it doesnt click continue reading again
clicks first time
but not the 2nd in bottomright
line 1340
If the issue is with JS I'll have a hard time helping
its in py

its supposed to do my sprx reader hw
Are you serious
😭
In addition to just being a bad idea, you're violating their terms of use
use content from or in the Sparx Product to train, prompt, or interact with large
language models or other artificial intelligence tools or products; or
where u got that from
Their terms of use
i cant find on their web page
anyways thats wat we do
as kids
find ways to bypass hw
And that's why people who know better than you do tell you not to do that
no i made it
delete it
wallahi its mine
Tbh I never caught on to this trend of using LLMs to do school work for me
took u that long to realise
eh neither have i but u make good money
i make it sell it with discord integration and u get hw done
If that's what you like doing ig
Anyway it got to a level where there's teachers encouraging to use it at times...
But only for very specific stuff, and not as school protocol
https://sparx-learning.com/terms-of-use or alternatively click the link literally entitled "terms of use" on the bottom of their home page
can anyone reccomend any youtube videos to start learning the basics with discord bots?
None, as a discord bot library is just a python library, if you know how python works you know how the library would work
There are example codes on the library's github
Copy it, mess with it and see what happens
youtube videos, especially those not made by accredited institutions, are incredibly awful for learning. Videos are just a wasteful medium for these concepts, and random people on youtube farming for views have no quality control or fact checking
IMO your best bet is to read reviewed resources for learning python, then read the documentation and examples for the library you want to use once you know the python concepts
Does anyone have a comprehensive guide for discord py's UI view? I couldn't find a single decent one, and documentation is horrible...
There are examples in the repo
And if you have any questions about what those examples are doing, you can ask here or in dpy's server
https://fallendeity.github.io/discord.py-masterclass/views/ some of the new stuff like checkboxes etc are missing but most of ui related stuff is present between this and components v2
A hands-on guide to Discord.py
How exactly do Cogs works, and why do I need:python @app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True) @app_commands.allowed_installs(guilds=True, users=True) @app_commands.command(name=name, description=desc)
Before every command in the Cogs?
I understand @app_commands.command, but why the other 2?
Isn't it taken care of when you make the bot in the Developer Portal?
They're not required. They're just there to modify from the default contexts and installs
The dev portal only controls the default installation contexts
Aaaahhhh, okay
Makes alotta sense
Thanks!
What should I use if I don't want a user to run a command twice? Like the second command should not run until the current interaction has finished
I vaguely rmb there was a deco for it
There is one for prefix commands
Anyone wanna show me their bot or see mine? Curious what people are working on
I defer callbacks and debounce new inputs
I am not sure what you mean
You can say hey we are working on this right now using a callback. And during that process, reject new commands and inputs
yes but I will need to store some additional states
would using something like a set be potentially unsafe?
I suppose but it isnt as hard as jt sounds. You take the discord input. Defer so it doesnt timeout. And then work on it until its dome
Defer still requires you to followup within 15 mins for slash commands
Hmm im not sure. My syntax is ok but i use AI as a force multiplier so im much better at systems thinking and theory/apolication
Right but 15 minutes is a long time for discord
like I want to prevent a user to invoke another slash command while he is already running one
yes I know but idk about this
I had an implementation that worked similarly to dpy's max concurrency decorator for prefix commands, but I've lost it 😭
Basically stores a count per user on the command and then checks that on invoke
I never reject commands, why try to fight race conditions
If i want to have a chain of interactions like that i would just put the second command as a button for the user to click in the first command response
Hi
Depending on the goal here, it's possible you can design this to be less stateful so you don't actually care if someone runs a command twice
Which might improve the UX and take care of edge cases
Is there a good library out there for HTTP interactions? Would like to hear some recommendations rather than installing something random (or making my own)
Out of curiosity, why decide not to run a gateway bot?
I'm not really planning on a bot right now but rather to experiment with HTTP
But if you don't use any gateway feature and want something a bit faster for just interactions, I guess 
It's probably a pretty narrow use case where you wouldn't want cached info like the gateway provides. There are loads of web server frameworks out there, not one that wraps discord models though too that I know of
Well the web server part isn't quite the issue 😅
I might as well just use uvicorn and do it raw, but that wouldn't be something I'd wanna do for a whole bot, just for experimenting Ig
https://github.com/AlexFlipnote/discord.http probably the only good one for Python
GitHub
Python library that handles interactions from Discord POST requests. - AlexFlipnote/discord.http
Ty 🙏🏻
hello
someone online in the discord api gateway thread? Or not interesting anymore?
you use pydantic for data models? you a pydantic user or contributor?
TBH, this chat is inactive enough that you should just ask the questions here
Yeah you are right
memory usage on startup:
Memory Usage: 475.71 MB
memory usage after running for a while:
Memory Usage: 578.83 MB
Uptime: 1 day, 2 hours, 36 minutes, 34 seconds
after longer:
Memory Usage: 926.86 MB
Uptime: 59 days, 16 hours, 27 minutes, 53 seconds
How do i even scale the bot? RN its just one shard thats eating up so much memory
Start by using a profiler to see what is actually using that memory
Yeah, ive tried it already, used tracemalloc but the overhead of profiler was soo much that the bot never started, it completly maxed out the vCPU for 30 minutes straight but never got running. cant really do that on a prod bot
i do have a lot of data thats cached on startup but that shouldnt exceed 100 MB probs
I'd try a dedicated profiling library. You need to get some actual telemetry or you're just trying shit and hoping it works
thats the issue, profiling libs have wayy too much overhead
which ones have you tried?
It's worth trying others. If profiling at scale was an impossible problem, nobody would be able to fix anything besides firing in the dark
i'm probably being bottlenecked by the 13 year old vCPU i got on the vps
Intel Xeon E3-12xx v2 (Ivy Bridge, IBRS)
does the library cache some stuff on its own?
A quick google gives like a billion profiling libraries. Maybe someone else here has had recent experience doing this at scale, I haven't. That's also a more general problem you can probably get good opinions on, maybe somewhere like #tools-and-devops
There are lots of levers on the discord library side that you can pull to reduce memory usage, but without good profiling we have no idea if it's the library or just a memory leak you introduced yourself
its really hard to test with a prod bot
ill have to check more thanks tho , found a lib scalene, might have to try if it works
Yeah give it a whirl. You may need to scale up at least temporarily while you diagnose. But if you're going into this blind without profiling, that's like your IDE saying there's an error but refusing to give you a line number, it's a non-starter
i have a decent headroom before discord forces sharding, hence want to figure this out quickly before it gets too late, probably will have to first switch the vps provider
Yeah getting good telemetry in early is incredibly important
Hello, you ever used webhook api from discord?
Via a library, yes. Have never needed to implement it raw
Yes recycle if you can do it
i noticed the lib was caching all members since member intents were enabled, disabled that flag and startup mem usage went a little better,
Memory Usage: 324.14 MB
Uptime: 6 minutes, 49 seconds
I would suggest auditing the intents you're requesting and aggressively disable ones you don't need
Members is the most egregious in terms of memory, but others are really bad for cpu
i only have intents.guilds and intents.members enabled along with default intents, for role sync purposes , they are really only used to monitor one single guild so not that heavy for cpu perhaps
Defaults include almost every intent
Including some of the most expensive and least useful ones
ah need to go through them and disable the unnecessary ones
Intents.typing for example is the one that probably fires the most and is something that maybe 0.1% of bots care about
i see
yeah i realised i dont even need the voice channel intents, integration, events and stuff
thanks for pointing it out!
ong just realised i need none of the default intents.
guilds is pretty much required for most things if you're running a gateway bot, otherwise your cache will be empty
yep i need only intents.guilds and intents.members
will probably drop the members too once i switch to webhook based logic, rn it depends on member roles
Yeah it's like a 10 minute exercise to review the intents that a vast majority of devs never bother with and just waste resources on for perpetuity
haha never had a thought about checking them, thanks a lot
down to 300 mb startup mem, pretty good for now
will probably move the mem cached dicts and large files onto redis before sharding and run a local memory profiler on a diff bot token
so i started python with DPY
i dont understand async/await or anything really
i just know how to make things work, what should i learn to like get better at making bots? i can code any bot but it doesnt feel like they are scalable, efficiently written?
do i start with learning python from scratch? or do i read the dpy docs deeply?
dpy assumes you already have knowledge of many concepts like oop, async, decorators, etc. Reading the docs wont do much help.
Start from the very basics of python and build up slowly.
!learn
Go-to beginner resources
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff — an online book (also available to purchase as a physical book)
- Harvard’s CS50P course — video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course — text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
sounds good, thank you
hey, so i setup a local instance to check mem allocation and stripped out some stuff to avoid it interefering with the main bot, and well the mem usage is fairly normal, Memory Trace Status
Current Memory
160.81 MB
Peak Memory
191.11 MB
on prod its around 300 MB,
The largest sources in the cache are mainly the 370k word list and other large obj cached on startup along with python libraries taking up most of it, will move some large lists ' to redis hopefull that will save a bit more, cant really check for mem leaks here tho
That word list already sounds quite heavy lol
its just 20 Mb + additional 16 mb for python set internals
I wonder how much would chunking members add if you're in lots of servers
I used to use a local background remover thingy that added 200mb on import
apparently when chunking members was enabled, the bot used ~475 startup memory, disabling it dropped it down to ~320
Well good thing to turn it off if you don't need it
thats a lot, what was it importing
yeah basically only need it for one guild but it cached every member in every server
a function that removes background from image in memory, so it was most likely the model itself that was heavy
makes sense
can you do selective chunking?
no idea
Hmm
i didnt bother much i just make a fetch call instead
Anyway it's usually modules that take a bunch of memory
yeah
You can disable auto chunking and then chunk individual guilds if/when you want to
Maybe the 3.15 lazy imports will help
baiscally heres the breakdown for top 30 alloc:
Python Import System
#1, #4, #11, #15, #18, #24
≈ 63 MB
LastLetter Dictionary
#2, #3, #7, #9
≈ 39 MB
Python Runtime Caches
#5, #6, #8, #21, #22, #23, #27, #28, #30
≈ 9 MB
Typing / Pydantic
#10, #13, #16, #29
≈ 2.5 MB
Word Royale Dictionary
#14, #20
≈ 1.2 MB
External Libraries
#17, #19, #25, #26
≈ 1.5–2 MB
Async Networking
#12
≈ 0.8 MB
Total Tracked
≈ 117 MB
Will keeping track eventually tell you more?
Cuz u initially said more memory usage than this
i only listed the top 30
oops
there are over 500 xd
!eval print("hi everyone")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
hi everyone
!eval def sifre_olusturucu():
uzunluk = int(input(“Şifre uzunluğunu girin: “))
karakterler = string.ascii_letters + string.digits + string.punctuation
sifre = ”.join(random.choice(karakterler) for _ in range(uzunluk))
print(f”Oluşturulan Şifre: {sifre}”)
sifre_olusturucu()
:x: Your 3.14 eval job has completed with return code 1.
001 | File [35m"/home/main.py"[0m, line [35m2[0m
002 | uzunluk = int(input([1;31m“[0mŞifre uzunluğunu girin: “))
003 | [1;31m^[0m
004 | [1;35mSyntaxError[0m: [35minvalid character '“' (U+201C)[0m
!eval def sifre_olusturucu():
uzunluk = int(input(“Şifre uzunluğunu girin: “))
karakterler = string.ascii_letters + string.digits + string.punctuation
sifre = ”.join(random.choice(karakterler) for _ in range(uzunluk))
print(f”Oluşturulan Şifre: {sifre}”)
:x: Your 3.14 eval job has completed with return code 1.
001 | File [35m"/home/main.py"[0m, line [35m2[0m
002 | uzunluk = int(input([1;31m“[0mŞifre uzunluğunu girin: “))
003 | [1;31m^[0m
004 | [1;35mSyntaxError[0m: [35minvalid character '“' (U+201C)[0m
def sifre_olusturucu():
uzunluk = int(input("Şifre uzunluğunu girin: "))
karakterler = string.ascii_letters + string.digits + string.punctuation
sifre = ”.join(random.choice(karakterler) for _ in range(uzunluk))
print(f”Oluşturulan Şifre: {sifre}”)
sifre_olusturucu()
oow sorry ty
what's the best python version for discord bots?
Presumably whatever the most recent one is that's supported by your library of choice for optimizations and security. Bots can do anything, that's kind of like "what's the best Python version for programs"
can someone teach me python
What learning have you tried so far?
!learn from one of the recommended resource below 👇
Go-to beginner resources
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff — an online book (also available to purchase as a physical book)
- Harvard’s CS50P course — video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course — text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
hihi im using visual studio code for this (even if that matters). it keeps giving me errors on certain lines and i am unsure of how to fix them. can someone help me figure out whats wrong?
Click here to see this code in our pastebin.

by the way if u don't understand what the bot is for here is an explanation to what this is supposed to do
- i want this bot to be a queue bot, it needs to have 3 buttons that when you click one it changes the original message.
- i want the buttons to say in this order: noted, processing, done. i want each to have a custom emoji and the label to be grey.
- i need to be able to have 3 options within the slash command, those being: customer (let me mention someone), order (fill with text), payment (fill with text).
- when a button is clicked it becomes unusable and the only person who should be able to use these buttons is the one using the command.
What's the error?
Just eyeballing it, there seems to be some indent issues
i made a forum, and yes its indent issues

i didnt know bc someone told me theres versions better than in making discord bots
thx for helping!
Just not old ones, as like any software it becomes unsupported
i disabled guild chunk on startup and now im not receiving on_member_update events ....
Makes sense, that relies on cache
How would you otherwise have the previous information
Gateway event?
Unless no intent covers member updates
Oh but I guess maybe the member's previous state is lost then so no before
Ideally in that case there would be a raw event or something that more directly forwards member update events from the gateway
Can someone explain why my
import discord
from discord.ext import commands
Doesn't work and then when I try
@bot.command()
It doesn't work
Any error messages?
Yeah
What do they say
when I did a indent for it it said smth like
"unindent line 3"
Use pastebin to send the complete program and exception traceback
!astebin
!pastebin
Pasting large amounts of code
So that everyone can easily read your code, you can paste it in this website:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
As far as I can see there's no indentation and it is not a problem
Yeah
is discord bot developement profitable
might be I dont know, you have a unique idea in your mind?
has anyone here it this channel a discord bot which has some premium features and you are selling this?
its just cos i want to learn python, and i want to expand my understanding on what profits and capabilities i can accpomplish with it
and i was thinking discord bot dev
but i wanted to know if it is acc in demand
It is a very saturated market where the vast majority of the user base refuses to pay anything
Is it possible? Yes. Is it likely? Absolutely not, except if someone commits to paying you that money before you start
ahh i see thank you! do you know of any other oppurtunuties learning pythin brings?
There are tons of industry jobs that use python. Also lots of jobs that don't need python directly but just want you to come in with solid software engineering skills. Picking up other languages is relatively trivial (except for deep niche specialist jobs)
Lots of freelancing opportunities too I'm sure
there are so many discord bots, so many you are right kinda full
I'd really suggest an internship, but probably a better convo for #career-advice
do you have a discord bot up right now?
you selling some premium features?
I just do bot dev for fun lol
very nice love that!
I have a question what is the difference between the discord ban and kick command provided by discord itself and the endpoints to do it?
A bot can use those endpoints in more complex and novel workflows
but if someone is literally just recreating "I want to ban someone right now", that's just a strictly worse version of what they already have
The built in command applies 2FA checks and properly logs into the audit log
(Also as a rule of thumb, bots having fewer permissions is always a good thing)
Dm me if u can help me make a Roblox bot follower plz! I NEED THIS BS NICE
Why not just ask your question here
"Fuck Life and Fuck me wallahi am going to kill my self soon when its time…." what do you mean by that?
are you mentally instable?
just hate life
ok but therefore talkking is essential
always talk about your problems and I am sure you will find a solution to it
many people are in big problems or had big problems, you are not alone. stay strong and search for good people to talk and support you
Thx ig
yes, i got like 600 robux out of it
From where should i begin reading discord.py
Perhaps from here
A learning guide for the discord.py bot framework written by members of our community.
You can try a Hello response
Do like this
@bot.command()
async def hello(ctx):
await ctx.send("hello")
Is there any experienced discord bot developer who has experience with Components V2 in python
If there is an experienced discord bot dev who has experience with Components V2 in python, what would you ask of them?
I wanna know how to transcript components v2 container based embeds as when I use chat exporter then they appear as blank spaces
Channel transcripts
Like ticket bots
Whole channel logs before deleting saved
You want to extract text from them?
1:1 html transcript
I can help you with getting the text/whatever from them, dunno what it gotta do with html

you got?
?
did you make the bot
help please
You need to add Python to PATH, by editing User Environment Variables if you're on Windows
This is assuming you really installed Python correctly
idk its really glitchy i dont know how to add it to path ik when you installed there use to be a option but there isnt anymore it just downlaods
You can add it to PATH manually in the way I specified 
I'd show you but I'm on mobile, for now I guess you can just Google it
have you tried py?
ive tried multiple times i never see the python folder
no, py instead of python
so do i delete python and install py
whats the link
no, try running that in your cmd
oh yea i already tried that i get the same thing
wait actually i did it and its installing python
just pip install colarama right, but i already have it installed.