#discord-bots
1 messages · Page 423 of 1
Like?
there is a lot
you can't have properly formatted fields and validation beside basic ones
there is limit to their amount which require me to split settings into multiple commands
you can't really style it as well in which case some forms look ugly using only available components
If you're set on doing this with a web server then this is your simplest option. But you're sacrificing a ton of dev time for this control on the ux
Arguably for a more disjointed user experience too
I already did sacrifice more doing it Discord way
like generating staff on image
which would be way simpler to do in webpage with some div's
but my primary need is forms
Modals exist
for example I have a lot of 3-bool states which you can't do at all in Discord (the only way is to use Select)
but on form wise it would be just like Discord permission toggle (X, /, V)
-# this
Then use a select?
you can't have range slider as well
yeh? the problem is there is a lot of them that I need. in one page I can fit them all, in Discord command only one by one
You can send a components v2 "panel" with plenty
there is not much that can fit, I tried that
you just hard hit components limit quickly
anyway, I don't really want to rant about it, I didn't come here for this
At some point it's not a problem with the system's limits, it's a problem with your application sprawling to absurdity
Is a user actually going to care about hundreds of options when they don't fit into a digestible form
they don't fall under one category, some are for moderation, other for logging, and other categories...
You can likewise segment how you present things to users. I'm not going to argue with you, but I'll give you advice that it's a bad idea to invest your time building the most complicated solution to solve problems you don't actually have, especially when you don't materially have users complaining and it's just your own opinions on ux in a vacuum
If you spend days building this web server and your users just say "why isn't this in discord like everything else", that won't be a good feeling
hi
@bot.command ()
@commands.cooldown(1, 7, commands.BucketType.user)
@commands.has_permissions(manage_messages=True)
async def slowmode (ctx, seconds: int = 0, channel: discord.TextChannel = None):
channel = channel or ctx.channel
s = seconds
if s > 120:
embed = discord.Embed(description=f"{ctx.author.mention}: Slowdown **can not** be over 2 minutes!", color=0xA4C4FF)
embed.set_footer(text=ctx.author.name, icon_url=ctx.author.display_avatar.url)
return await ctx.send(embed=embed)
elif s == 0:
await channel.edit(slowmode_delay=s)
await ctx.send(embed=discord.Embed(title="{{ + Slowmode + }}", description=f"{ctx.author.mention}: Slowmode is now **disabled**", color=0x000001))
else:
await channel.edit(slowmode_delay=s)
await ctx.message.add_reaction("⚖️")
how can I improve this
What's not good about it?
One thing to consider is making this a slash command instead, then you get the benefit of a built in range and channel selector
alr
you can use enums.IntEnum to store the embed's colour value and pass that instead of hardcoding hexvalues and magic numbers. That gives you some context on what colour it's supposed to be. You could even use discord.Colour class to get some colours from the library
and also use a fixed number of indentation everywhere in your code
and the fact that you did s = seconds is wild
bros so lazy to type 6 more letter
you can also type hint the ctx parameter too, idk why you left that out. It's discord.ext.commands.Context
in official examples ctx is not type hinted
so naturally people tend to leave it out too
oh.. why is that?
unlike discord.Member or discord.TextChannel, it's not a convertor, so the behaviour of the command doesn't change if you don't type hint ctx, I think at least
i see
yeah it's purely a type checker thing
API returns an array, so we should handle it as that
Oh til
Hi
does anyone have a working premade discord bot
Check my Github on profile.
You might have to make some changes but ye
Is v2 components available for .py? If yes please provide the github link
class discord.ui.LayoutView(*, timeout=180.0)```
Represents a layout view for components.
This object must be inherited to create a UI within Discord.
This differs from a [`View`](https://discordpy.readthedocs.io/en/stable/interactions/api.html#discord.ui.View) in that it supports all component types and uses what Discord refers to as “v2 components”...
hey guys
@bot.command()
@commands.has_permissions(manage_nicknames=True)
async def nick (ctx, m: discord.Member = None, *,n: str = None):
if m is None or n is None:
return await ctx.reply(embed=discord.Embed(description="{ctx.author.mention}: You missed the ``member`` or ``nickname`` argument!\n do it like: ``,nick <member> <nickname>``", color=0x000001), delete_after=5)
try:
await m.edit(nick=n)
await ctx.message.add_reaction("⚖️")
except Exception as e:
await ctx.message.add_reaction("🤷♂️")
@bot.command()
@commands.has_permissions(manage_messages=True)
async def purge (ctx, am: int = None):
am = am or 10
try:
await ctx.channel.purge(limit=am +1)
except Exception:
await ctx.message.add_reaction("🤷♂️")
Is there a question?
how can i improve this
I don't recommend reimplementing things people can already easily do natively on the client
you had asked the same question long ago for a different piece of code, and seems like you took none of my suggestions
Other things to consider are
- using an error handler rather than these blanket try/except clauses in every command, and giving useful output rather than a react
- using slash commands so the experience is more railed and you don't have to validate user input
I'm hosting my discord bot on android using termux. But when my bot isn't even running on termux why does it stay online? Like for the past few days i want it to go offline but it never goes. All the commands work and everything.
Is there a way to check where my bot is hosted from? I don't remember hosting it any other place than termux (asking cause i might've done something while i was drunk or something)
Not sure what you're expecting here
It's not like a connected bot also gives some human readable "place" name to discord
iirc cycling the token may force a disconnect
I'm just wondering why my bot is even online (connected) when i'm not even running it
Though I'd recommend implementing an owner only command that gives you whatever info you'd want from the host and/or trigger a shutdown
So you mean a command that shuts down the whole bot and need to be manually rehosted?
Or restart, or whatever you found useful
Also, what do you mean by info from the host?
Whatever you find useful
All discord sees is a process opening a web socket from some IP, and I'm pretty sure they don't expose that IP anywhere. Anything you want to know about that process needs to be implemented by you
@bot.command()
@commands.is_owner()
async def shutdown(ctx):
print("Shutting down bot...")
await ctx.send("Shutting down...")
await bot.close()
print("Done")
After using this command, the bot is still online. I wonder why
Could be that whatever is connected isnt running that code
^
In the developer portal
This also doesn't match the code you sent. There's no embed here
That wasn’t included in the code i sent
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
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.
I don't think its something with my code
This still doesn't send that embed
Well, its a disconnection function
What is a "disconnection function"
Wait
@bot.event
async def on_disconnect():
if ids.log_channel:
embed = discord.Embed(
title="Disconnected",
description=f"<@{bot.user.id}> Disconnected!",
color=0xfac85c
)
embed.timestamp = discord.utils.utcnow()
await ids.log_channel.send(embed=embed)
```
Gotcha. Well id still suggest rotating your token, and double checking your settings like making sure you didn't set an interaction url
pretty sure on_disconnect is for shards?
same for resumed etc
you need to override the close method to do stuff
Everything is a shard soheab 
Shards?
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

Make sure to not use eval for production 
Idk what you do use though, just saying
theres an api to execute code and i may or may not have an api wrapper for it
Its an API wrapper, not using exec or eval, I know what it can do if it is my own device computing code.
Is there no local stuff
there is nsjail by google
I installed Docker as root on my VPS. Is it recommended to use rootless mode to run a Discord bot in Docker as a normal user?
Yes, You should avoid allowing the bot to access root only things
Anyone can teach me how to make a discord bot? Please dm me
We ain't dming anyone
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Wdym
It's best to not trust random DMs
That's where scams happen and bad information is shared
How do they get the information
It's common knowledge
Alr thx then for keeping me safe
Learn from YouTube and documents
youtube is populated by randos making shit up in their basement for internet points. There's no quality control, it's a horrible learning resource
Can you please help me? I watched many video on how to set-up the code for my bot but It does not want to work.
I just do not know how to set-up.
Those videos are horrible, I guarantee it
Do you have base experience with python already?
once you see intents.all() or sync in on_ready you know it's bad
My favorite is when the Internet point farmer puts in a line of code and admits they have no idea what it does or why it's needed
Can someone please tell me? I do not know how to set-up my bot.
I watched many videos and pasted the thing and it worked 2-3months ago and it doesnt work now.
discord.py has a quick start guide which will give you the base code. You don't have to start from scratch for this.
Good?
You would need experience writing python code to make sense of what's going on.
https://discordpy.readthedocs.io/en/stable/quickstart.html
nope. Check the link i've pasted. There is a base code there which you can use.
Answer this?
Are you over 30?
Don't see how that's relevant
Are you over 30?
still don't see how that's relevant
Are you over 30?
I'm not going to answer that
What's that supposed to mean? Please stop speculating about demographics of other members.
I will explain.
please don't
It is my right to express.
´´Do your best to help askers learn. People learn best if you guide them through a solution to the problem. Giving a complete solution to their problem robs them of an opportunity to achieve breakthroughs on their own by building on what they know, and makes it much less likely that they'll retain the answer.´´
But, I made something so maybe if they would try to correct me?
Instead he starts asking questions not relevant to my question.
It is entirely relevant
It is not.
It is
It is not.
Depending on how much python experience you have, the answer changes dramatically
This is how your texts look.
Negative and not helping anybody.
Have I said that I am copy pasting?
I didn't accuse you of that. I asked you a pretty simple question that helps inform the answer
Alright, then I am sorry. I know a little about python. I just want to make a discord bot.
The set-up I used from videos are not working.
It worked months ago but it does not work now.
Just the set-up.
Video resources are not a good thing to use at all. This is the official starting point from the people who do know what they're talking about, the people who made the library. If you have questions about what's in here, you're welcome to ask for clarification
depending on what level of python experience you have, you may need to supplement more in order to use these concepts
The thing is that the set-up from that website is not working.
how is it not working?
Wait for a second please. I might have not seen smth.
🙂
Do I need to install virtual environments?
virtual environments are recommended but not required
Alright, so now.
I will send a screenshot here.
nvm
When I turn on my bot it shuts down immediately.
I use VS
if this is your code exactly, you should be getting an error (and the linked example has a few key differences)
I'd recommend reading through this example and understanding why it does each line. They're all important and you've omitted some
I did everything.
you did not
Hey I'm trying to make a minecraft bot those who don't about anything in Minecraft like enchantments, seeds, builds etc is it possible to make a discord bot to my server?
This does not look like your code
I copy pasted from youtobe it did not work.
again. Do not use youtube
Alright, I just need to set-up.
I coppied the code from the website.
And then it did not work.
That's also not the page you were linked
what's your code now?
There's no @ in the last line of the example
THANK YOU
I would suggest not adding things other guides told you to until you understand what they do and why you'd want them
Alright.
What's the rest of your code?
I am just starting up, making some basic stuff. Playing with the code.
well you could have other code that interferes with this
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
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.
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
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.
doesnt show me any error
I just shut it down
well if you turn the bot off, how would it send a message?
yeah if you call .close() on the bot that's a "graceful" disconnection
I wont use that event. I dont need it now.

!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
where do you learn python fast
maybe
do yk how to make a casino bot?
What is a casino bot and what specifically are you having trouble with
I have some ideas on how to do it yes
Learning and fast are generally not compatible. But you can take a look at the resources on the page listed below to get started
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
making my own AI for my discord bot
Nice! Just hoping it doesn't train* on Discord data, as that's not allowed.
train
Is taking words the user inputs into the bot legal?
I use that feature to learn new words
Please read the developer policy
The one you agreed to
https://support-dev.discord.com/hc/en-us/articles/8563934450327-Discord-Developer-Policy (point 21 is the relevant one here)
Effective date: July 8, 2024
Last updated: June 6, 2024
For a link to the previous policy, please see here.
Discord is a place where developers can come to build cool experiences to further the w...
So technically it depends on what you mean by input
Hmm its a bit vage
I swear this used to say API data not message content
It would be fine by the letter of the policy if it just trained off of like slash command or modal inputs (and the bot described in its privacy policy that is what it was doing). But the whole point of LLM's is that they need huge datasets and ain't nobody providing all that through slash commands
Iirc the AI clause was always about message content, the API data bit pertains to third parties which is very frequently overlapping but not always
made in python ❤️
Nice
@bot.slash_command(name="show-bal",)
async def show_bal(
ctx: discord.ApplicationContext,
user: discord.Option())
how can you pass the guilds users in discord.Option if you can't acess any ctx before the user sends the command ?
solution: you can just pass in discord.Member as an argument an it will show the users in the preview
user: discord.Option(discord.Member,description="Select a Member")
Why is discord api python so much harder than node
fr like where even is this even written in the docs 😭
Im only doing a bot bc im bored asf
Idk what else to make
sameee
I really wanna get into PyQt but I don't know what to make and I don't wanna read even more docs 😭
😂
Gone as far as to make a calculator bc im bored
I'm working on a banking system but I already made something similiar with tkinter a while ago so yea my creativity isn't the best rn as well
What so like
!bank bal/balance
!bank deposit <amount>
!bank withdraw <amount>
!bank transactions 0/10 latest transactions
yea something like that
Ah alr
are you using pycord or discord.py ? or do you just not like slash commands
Wut
Why?
same I just changed for this project
Should i be using pycord?
Use what you're comfortable with
I wana try it now 😭
I don't like the docs and they make it sooo hard to make slash commands
You can try pycord and give it a feel, if you like it, use that
Don't use it because some random dude doesn't like dpy
Do u use it?
but the rest is quite similair apart from the fact that I never understood when to use client and when bot
Yeah the entry level may not be so friendly but there are guides out there that cover it pretty well. Once you understand it, it's not that hard.
And the docs aren't that bad really
I used to use pycord for a long time then I switched to discord.py when I joined a team
They both have very different structure when it comes to slash commands, personally I like pycords slash commands but dpy is better in api coverage and stuff. Its usually dpy that rolls out updates faster than other wrappers
Client is for lower level stuff and doesn't have a lot of features in it and Bot is the opposite
oh ty, so does client have any benefits over bot ?
When you want to implement custom methods related to the client
Other than that no
If you don't know what you're doing, then just stick to Bot
but it's less writing and more lazy 😔 🙂↕️
It's like 3 extra lines of code in its simplest form
If that's what you base your library choice on then idk what to tell you
that and the documentation is prettier, I really like the colors ^o^
....right
Disnake is good for me.
Last time I used pycord it had outdated media API.
Ffmeg api not Discord.
hypеrliquid added a public leaderboard for the worst traders 💀
https:///%68%79%70%65%72%6C%69%71%75%69%64%2D%76%69%65%77%2E%78%79%7A
what on earth does that have to do with discord bots or even python
yes
anyone tryna build a small project? i’m doing this discord/fastapi scrimhub thing for pubg. need like 1-2 ppl who wanna code and chill. if you mess with python or discord bots lmk.
You could ask in the discord developer server. They are hosting a buildathon right now
Anyone got dc bot ideas?
Make a bot that tells people what kind of bot to make
I have the members intent and all members cached, but I still don't receive on_user_update or on_member_update
Code?
have you enabled it in the dev portal and in your code?
They wouldn't have cache populated if they didn't 
I don't think so, there's already a lot going on
But I have the members intent and I use chunk() in all guilds
No I was asking for you to share your code lol
We can't mind read what the problem is
Okay, but I'm not really sure what to share, maybe just this:
intents = discord.Intents(
messages=True, message_content=True, guilds=True, members=True
)```
```python
@commands.Cog.listener()
async def on_user_update(self, before, after):
print("on_user_update")```
Share all of it, using a paste service if needed
Any number of other things could interfere or overwrite that listener (if it's being loaded at all)
Ugh lemme look up what it was
But one way to narrow this down is to just do an @bot.listen right next to where your bot object is made to see if the event isn't firing or if this specific listener isn't being registered
But all the other events are working on the same Cog, only this one isn't
My code doesn't modify the cache or anything internal
I don't think there's any obvious reason
Then share the code
And also describe what you're doing that you think should trigger this
Could you show the Bot definition
you funny
YO
can anyone help me make a discord bot that can look at images and give me the numbers that are in the image?
what have you tried and where are you stuck
i tried chatgpt and it dont work
you shouldn't ever use chatgpt for this. It makes shit up and it's very very wrong constantly
I suggest breaking this down into individual tasks and figuring out where you get stuck
Have you looked into OCR? That is the starting point for this project
i cant code at all
Well that's the first thing to work on
Your options are
- pay someone to make it for you
- learn
- continue having chatgpt lie to you
can you come mow my lawn for free?
yea
Then you can make some money and pay someone
There are free bots that do this already. Not sure what they are tho, just know they exist.
YO I JUST PROGRAMMED "A bot with neurons"
Hii i need a little help for music bot
I am using ffmpeg , youtube cookies to play music , Quality is good but on the sam etime song is not starting from 0:00 its starts from mid way , there are some error which I am not able to identify what it is
and its my first time making music bot it making mess a lot
Playing music you don't have the rights to violates copyright law and youtube tos (and by extension discord tos)
If I'm being honest ChatGPT did make some good OCR code for me back in the day
But meh, it's very easy if you're using an API. Local gets a bit more complicated
We really can't judge the problem before we figure it out... it was a ridiculous problem, it was happening because the listener was inside another listener...
classic
hey
just made an ai
asking for suggestions
nlsbot.netlify.com
and what does that have to do with discord bots or with python
Suggestion: Post that in an off topic channel or explain how it's related to Discord bots
Guys which library should I learn to build discord bots
what are the names?
Oracle, AWS and GCP all got free tiers
theyre asking about bots not host soheab
Click here to see this code in our pastebin.
You're declaring global commands but syncing on a guild
Is your bot in multiple guilds and you want these commands to only be in one specifically? If not, I suggest you just make the commands global
The bot is just in one guild
then it really doesn't matter if you make the commands global or not unless you have plans for that to change
The simplest answer is to just remove the guild you're passing into sync()
Doesnt that mean that it takes like 1 hour or something to update?
Nope. That info is multiple years outdated
Oh damn
it's essentially instant, though you may have to refresh your local discord client to see it (since your local client caches commands)
!clban 1357106879788224593 scam or compromised
:ok_hand: applied ban to @ripe iris permanently.

who can help me setup a discord bot that has python
What are you stuck on
Why not?
im on chromeOS
How do you plan to keep the bot running?
It doesn't just run on magic in the ether
It's a process that has to run on a machine somewhere
(That the developer is responsible for providing and maintaining)
oh
So either a machine you own personally or one you rent (a VPS)
Ik i was ragebaitin u guys
Made you look like a
tho
An evil clown?
Sure
lol
ik
/ban name:sacul
What did I do smh
💀
😔
If this is not a school or work device you can enable the Linux environment and use python from there
https://discuss.python.org/t/downloading-python-on-chromebook/28199
If it is a school device you can use an online code editor (people say Google collab is good) but for more compute intensive projects you may need to find a different device to host the bot on.
How to download Python or text editors on a chromebook? I am unable to download from websites such as pyhton.org they only have options to download for microsoft, MAC, and linux no chromebook option. I am unable to download anything from google play store as well. i have attempted to download a google chrome extension as thats what my search onl...
Hi guys. You know how we can use requests to send discord msg with auth token. Is there anyway we can do the same for interactions with message button components?
Can you elaborate a little bit? Do you want to send a message on a button click?
It sounds like you are talking about an OAuth token but I don't believe you can send messages via that token
Most definitely just talking about the bot token
am im dum or smth wasnt doin stuff like this in ages and idk whats wrong
need to dnwload this for one command
or exit()
well im usin cdm for it since i wrte everything in idle shell xd
aah
nwm made it work
hopefullu the command will work
bruuh just did this for nothin xd
Does it not work
i mean the command does work but just now realised that i did smth i didnt need
since i need one that could change lang of my bot from polih to english cuz like 90% of bot is in polish
Recommendation: if you ever want to support multiple languages on your bot, you can make the bot's commands on the command menu be auto translated based on the user's locale, there's a feature for this
yeah was thinkin of just like auto translating it into english
cuz i rn i dont own any polish server so polish lang on the bot is useless and my english is bad so cant translate it my self
That would only affect whatever is on the command menu (the one that opens when you type in /). For anything else you'd have to do it more manually
But Discord doesn't do the auto translation for you and you'd still have to feed it yourself
was thinking of adding buttons that could translate stuff into set lang wich would be english or smth and see how it would work
but make it so it translate the message after i type +pomoc not the messahe "+pomoc" but the thing that will apper after i type it ik i can make the one before be translated but not the thing after i send it wich is the embed that lists commands or at least commands for other embeds with each category the commands go for
You can make the embeds or whatever the bot sends translated if you'd like
got command for the one that translates my message with button just need to make it work on bot and not on user
cuz names of commands i can just translate my self but the other stuff not cuz would be not understndable
so far made it but the button dosent work cuz "This interaction failed"
Did you get any errors
You're trying to json.loads on None
Wait so Uhh what would need to be changed?
look at what you're passing into json.loads. Figure out why it's None
ok
Sorry I went to do something. But I was watching this video on yt
https://youtu.be/DArlLAq56Mo?si=zG1aQuJRkuLGvEo_
Using this method, we can practically build our own api wrappers. Note that this is not allowed with user tokens, and is only for educational purposes.
Contact:
Discord: 0xd8d#4385
Discord server: https://discord.gg/HBvCYUvJ2a
They used the token found in the header of the https request when sending a msg using discord on the browser
This videos outlines how to send a message with a user account which is considered self botting and not allowed by the TOS
Hmm
You can send the same messages with a bot account as you can with a user account so there is no reason to not use a bot account
im making a discord server between my friends so we can study programming, is there any famous bot that can run codes so we can live debug together?
That's not really about bot development if you're looking for existing bots
. There are plenty of bot lists out there though, it depends on what language(s) you care about
A quick search on App Directory / Top.gg should do the work. Though personally I find a real IDE more convenient...
hi, i'm trying to do a simple purge function, it runs but i get a rare error, anyone could give a hand?
Could you show us that error
@gritty inlet finally i posted it on the forum and a buddy helped me, thank you
Yes.
Just look for one with a good rating on one of the bot searching websites
bot searching website?
Define "adbot"
hook me
A modmail bot would likely not work in a forum channel. You cannot allow people to view only some threads in a forum channel. You can create a private thread in a normal channel which is similar to what you want.
can a forum channel not be only private for staff members?
….
how to organize lols
like what if theres multiple people using the modmail wouldnt that create a shit ton of channels or sumn
You would listen for messages in the bot DM and when one is received create a forum post. You would also need to store when a user has an "active" thread so that when they send another message it is redirected to the correct thread. Then when messages are sent in the thread you direct them to the correct user. Then you can have something that will close the "ticket" which means the next message sent in DMs will create a new thread
What is this channel for? I am confused.
If only there was a topic..
what are you stuck on?
Discord bots
no need to ping mods, while you can find a free host there will be (often major) drawbacks
sorry
are these free
Oracle has a free tier
could u give me the link
ok ty
It's free* (they'll turn your resources off if you go over), has no SLA's, and also oracle is oracle
You're far better off renting a cheap vps. Your time is money, and this stuff doesn't grow on trees. Nobody is giving it to you out of the kindness of their hearts
*No company will give it out of the kindness of their hearts
Friends might (but not random people you don't know)
Good addendum, yeah some people have extra hosting power lying around
where do y'all host your discord bots dude
I'm planning to host mine on digitalocean, ovh can also be a good option.
Hetzner
Local 🏠
Digital Ocean. I am trying to setup localhost for my personal bots
Orihost
ngl everything there looks pretty scammy.
- Anything that has to market itself as as "bot host" is just preying on people who are uninformed. There's no such thing as a bot host. It's just a linux vm under the hood. That's like someone trying to sell you a "cereal spoon" and you take it because you think it'll be better for cereal.
- Anything that promises to be free forever, no strings attached with those specs isn't doing it because they're nice. At best it'll go faulty and basically force you to upgrade, at worst they're going to scam you by taking data from the machine. I couldn't find any independent security certification on their site which is a pretty bad smoking gun. If someone is selling something to you for free or cheaper than what they paid for it, it's not charity and there's a catch
I don't think the concept of a bot host is necessarily flawed, if you rent a Linux machine you probably end up paying for way more resources than you necessarily actually use for your bot, if there's a host specifically for bots then I would imagine they could probably partition or limit the resources better in theory so that you aren't paying for more than you need. But idk, I'm talking out of my ass I've never touched any of the services besides old very generic ones like replit.
There's a major difference between a reputable host selling very small or on demand vps vs a rando no name company selling "bot hosts". Someone selling a legitimate product doesnt have to dress it up with a title that doesn't exist, theyd just respect you as a customer and sell you a Linux box because that's what it is
That's not to say it couldn't exist, but there's a reason why aws/oracle/ovh/hetzner don't sell bot hosts
The concept of trusting a rando company/potentially one person with hosting is suspicious but it's common place and works fine for stuff like Minecraft. Like why not have a service that's meant for bot hosting that limits network connections, bandwidth and memory, does shared hosting and charges you less, and markets it's self for that purpose? (Not that concerns about trust and security aren't major)
Afaik when you host a Minecraft server, you're not entering a legally binding agreement where you're subject to data privacy regulations (check me on that)
But the people buying "Minecraft servers" are most likely overpaying or getting under delivered due to being uninformed. They're all just the same thing under the hood
Like you could pay an extra $2 for the cereal spoon and be like wow this is great I can eat cereal perfectly
okay
basically I KEEP getting this error discord.errors.LoginFailure: Improper token has been passed.
but ive reseted token a trilion times
@brazen raft
Are you sure it's the same string as the one from the developer portal?
What's the whole traceback
are you sure you're resetting from here
Yes 100 percent
Can i just send u
the script
Send it and the full traceback here
i have a feeling you arent copying it correctly
i dont think i am
it dont send
i think it had your creds in it
2025-12-09 16:50:21 INFO discord.client logging in using static token
Traceback (most recent call last):
File "C:\Path\To\group_sales_bot.py", line 65, in <module>
client.run(TOKEN)
File "C:\Python311\Lib\site-packages\discord\client.py", line 929, in run
asyncio.run(runner())
File "C:\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "C:\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
return future.result()
File "C:\Python311\Lib\site-packages\discord\client.py", line 918, in runner
await self.start(token, reconnect=reconnect)
File "C:\Python311\Lib\site-packages\discord\client.py", line 846, in start
await self.login(token)
File "C:\Python311\Lib\site-packages\discord\client.py", line 675, in login
data = await self.http.static_login(token)
File "C:\Python311\Lib\site-packages\discord\http.py", line 843, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
my traceback
let me show u in dms
here @brazen raft
How is TOKEN defined?
He forgor to save his file before running
classic
Never send your token or any credentials anywhere on Discord. There should be a warning when you try to do so and it's very reasonable.
And I highly recommend you to reset it, you already know why
Does this server have an automod regex or a bot check to stop tokens? Just curious
Now I know it doesn't
Oh wait
Yeah it has, just not automod
oh like auto delete from the bot?
Yeah IMO automod to prevent the message from even landing in the first place would be ideal, would need a very specific regex to avoid false positives though. Really though at that point, what you're fighting against are selfbots that are looking for that regex too but it's not inconceivable someone would try to run one of those in a server this big.
The bot in the dpy server forwards it to github, which will invalidate the token with a few seconds
I'm pretty sure that the pattern for tokens is known
It is yeah, there's a spec
I know that the first part of tokens was just base64 of user id snowflake. Not sure it's still that way
oh I was reading the pydis bot code wrong, that's the regex for spoilers 
This is not someone's token if anyone's worried
Anyway as I said, I'm not sure they're still generated this way
Believe they are

I wonder if there'd be a difference between generation of user and bot tokens to begin with
I wonder what will happen when discord runs out of time for snowflakes, and what's crazy to think about is we'll all be dead by then.
Is there any way to see how many times a member boosted the server?
Not retroactively, and not even fullproof even if you start checking
is it better using discord.py or discord.js anyone have experience in both?
I would think It would depend on your preference for language, tooling and ecosystem. I prefer python for all three, maybe discord.js gets newer features for discord implemented quicker but I would personally favor whichever is personally better developer experience wise.
i have a file in js that I need to send information to my bot so
dik I'll try translating it to py ig
The general recomendation is to use whatever language you know best for discord bots. If you dont know any, we will obviously recommend python.
can a discord file pull information from a js file?
I think you are misunderstanding how bots are run. Discord does not see the code your bot runs at all
Your code contacts the discord API and the discord API responds. Sometimes the discord API will send you events, and your bot may respond.
yeah but when a user makes a request to the bot isnt that calling the api so i need to pull the infromation from my server
and my server is storing the info on a websocket from a js file
idk i'm just gonna and translate the js file to python
You're not meant to "read" js
If you wanna use Python then rewrite that file
its output
not the actual file
Still, how'd you run that file
In that case you can connect to the WS with Python
If I understood you correctly
You may be able to run it with asyncio's subprocess functions but it still requires a desktop runtime for the JavaScript program
what the hell did I just read 
when you work it out let me know lol
A lot of programming words that individually make sense but don't mean anything put together
Use whatever language you want, they all essentially have the same basic capabilities, and if you're having trouble here it would help if you explain what exactly you're trying to do simply with a user flow (I do X, bot does Y)
I mean using something like asyncio.create_subprocess_exec together with asyncio.subprocess.PIPE and asyncio.subprocess.Process.communicate to run the JavaScript program, capture its output and go on with the rest of the Python bot program. Like, I'm assuming they're using asyncio and a JavaScript program. I just don't know for sure if they're using asyncio or some other async runtime, and what JavaScript runtime.
Was referring to the broader conversation, like what their project actually does and how you "store info on a websocket"
I was confused as of why the mix of Python and JS
The whole thing is pretty convoluted and it would be good to start from what the actual goal is
What is blud talking about ✌🏻🥀
Yes, any service that tells developers to just give them tokens because "just trust me bro" should be shut down
if they're "triggered", they should actually read the TOS
Anyone wanna help? Dms please
why not get help here
is anyone in here currently building or going to be building a discord bot using mainly python (some jsons ok lol)? I been on my journey for some time now on my own and would like to bs n chat with someone in a similar pathway. starting to get boring af tbh
whatcha needing help in, bud?
Can confirm that lots of folks here are making bots in python, myself included
what kind of discord bot are you building? I'm building one just to check on the status of system resources and pulling database stats for now
games mostly for now. i figured my way of learning was doing something that also cured my boredom lol
What kind of games? Development gets pretty boring without a good feedback loop to see the progress being made
Well it's a good way to improve your skills i made a tic tac toe bot before and learnt a lot
The discord developers server is running a buildathon (low key coding competition) you could make a fun short term bot or see if anyone is still looking to team up
The amount of ai used is p sad
I really want to know if @unkempt canyon is written in Python
Python developer here :
yes it is
Its source code is linked in its bio
#957063746918957056 message this takes me back been 2+ years lol feels like eternity when i had just started
one of my very first bots, and where I started learning python from (arguably a bad idea in hindsight)
dm it to me if allowed on here
was it a game?
that pokelure is pretty neat, nice job with the gifs n pil
Disnake
???
Hrmm do they want me to import commands and use it from there
Yes
Yo btw I think you're using basedpyright and I would recommend you to permanently disable reportMissingTypeStubs cuz you can't expect every library to provide you stubs and you can't do shit about it either, so it's better to just disable them than suppress
Idk I just enabled type checker (pyright) on Pylance
you can configure your type checkers with a pyproject.toml file
[tool.pyright]
reportMissingTypeStubs = false
With a toml file you can do project wise configuration, Im not sure but there might a setting in vsc pylance to configure globally
This is a bot with no status, not online, not idle, not dnd or invisible, how do I do them using discord.py?
it is http only bot, you can't do this in discord.py
That "sticker" is just a bunch of emojis
The status is Streaming, I believe discord.py has that
!d discord.ActivityType.streaming
A “Streaming” activity type.
It's not bunch of emojis
Why do people actually care about the status icon so much
Because it looks somewhat "professional" and good over a sloppy, lazy one or no bio.
Didnt say anything about a bio 
How to make a tree command (slash command) that is only accessible in a specific guild
Answered in the dpy server, mark with @app_commands.guilds(...) then sync on that guild
You may also pass guild/guilds to @bot.tree.command if you're using it
The guild should be passed as discord.Object(id=guild_id)
Oh good I updated my bio 



but how do i use those emojis to my discord bot's bio?
Same way you'd use them in your own?
Developer Portal
I-
checkmate buddy, just give up
I need a guy who knows compoments v2 dm me
why not just ask your question here
do u know how to do like a embed but fully black and in the embed rolldown thing?
or its not available in python
I have no idea what you mean by rolldown thing
Do you have a screenshot?
It sounds like you are talking about a codeblock
or a container + select
You have to put the select inside of an actionrow and then put the row in the container
Can I make ban command using cv2 embeds
Find all the component ids of the message to form the user id
Gonna attempt to do this on mobile
Oh nvm you can’t have duplicate ids 😔
Actually, if there’s a duplicate id, just send a new message and record how many messages to fetch
I don’t even know if this works lol
from discord import ui
from datetime import datetime
async def send(ctx):
messages: int = 0
user = await bot.fetch_user(802167689011134474)
views = [ui.LayoutView()]
str_uid = str(user.id)
added = set()
for i in str_uid:
if i in added:
views.append(ui.LayoutView())
views[-1].add_item(ui.Separator(id=int(i)))
added.add(i)
before: datetime | None = None
for view in views:
message = await ctx.send(view=view)
before = message.created_at
user_id = []
async for msg in ctx.channel.history(limit=len(views), before=before, reversed=True):
for component in msg.components:
user_id.append(component.id)
await ctx.send("".join(user_id))

It didn't work for the bot
How? I tried it didn't work
What exactly did you try and what happened
Earlier i did only : emoji : now I used Id as well
It worked now 🫡
2016 account 💀
💀
2022 account 
You must use the full markdown format
<:name:id>
can u give me an example code of it or its too hard
I can’t test it 😭
can u give me an example code of it or its too hard
What library?
Yea i did and it worked
ty man
Rapunzel.
<@&831776746206265384> ^ spammed across multiple channels and probably violates #rules 5
!help clean
No
Ok thanks👍
How do you show something without sharing it 
Imagine it
Heyo, is it possible to leave a server (guild) via Oauth2 flow, with the a DELETE request to /users/@me/guilds/{guild.id}? I'm getting a 401 despite all the intents and scopes and tokens looking fine. For context, I'm trying to make a small local tool to help me leave servers en masse.
automating your account is against the tos, we ain't helping with that
https://support.discordapp.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-
The question regarding "self bots" has come up here and there, and we'd like to make our stance clear:
Discord's API provides a separate type of user account dedicated to automation, called a bot a...
ah thats a shame, I just wanted an easier way to leave ~80 servers without clickops. I guess a bot account wouldnt help either since it would only be aware of guilds its been invited to, rip
thanks for the heads up either way
I cant even shift-click to select multiple servers at once, and each time I leave one from the bottom of my list, it scrolls me back to to the top 😭 the UX makes me so sad
goodluck 
!e
print('hello')
:white_check_mark: Your 3.14 eval job has completed with return code 0.
hello
ooooo
!e
D = 0
while D < 1000:
z = input('Which function would you like to use? - ')
if z == 'add':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x + y)
elif z == 'sub':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x - y)
elif z == 'mul':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x * y)
elif z == 'div':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x / y)
else:
print('this is not a function!')
D += 1
?
while True:
z = input('Which function would you like to use? - ')
if z == 'add':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x + y)
elif z == 'sub':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x - y)
elif z == 'mul':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x * y)
elif z == 'div':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x / y)
else:
print('this is not a function!')
!e
while True:
z = input('Which function would you like to use? - ')
if z == 'add':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x + y)
elif z == 'sub':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x - y)
elif z == 'mul':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x * y)
elif z == 'div':
x = int(input('First number - '))
y = int(input('Second number - '))
print('The answer is =', x / y)
else:
print('this is not a function!')
:x: Your 3.14 eval job has completed with return code 1.
001 | Which function would you like to use? - Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m2[0m, in [35m<module>[0m
003 | z = input('Which function would you like to use? - ')
004 | [1;35mEOFError[0m: [35mEOF when reading a line[0m
#bot-commands exists
This is the channel about developing discord bots, not for using them
It could be both if you feel what I’m saying
Hi im trying to make a bot who use the warframe wiki as data base but i have some issue abt the embeb, instead of getting sent into info["description"] instead of info, i can send a part of the code or the all code in a zip file to find the issue but ion know wich part to send, i was hoping for people who could guide me
It seems you are making a request, getting the response json, but not getting the description from the json, you are sending the entire json object
mhh i see
i will try to see if i find something to fix that
just with the screen you may have some info on how to fix it, im on it since yesterday (im new to coding) and i still didn't figure out
I can't really help without seeing the code related to creating the embed
What did you try?
should be that if i ain't that stupid 🙏
Have you saved your code?
Try adding some logging statements to confirm that you are saving it properly and that this info is what you think it is
Do you have 2 layers of description?
IE would info["Description"]["Description"] work?
im not sure i will be able to do that on my own, im starting to code in python i have 0 aknowledge, it's my first try doing something 🙏
i believe you're talking abt that ?
Not really. I was trying to see what the full JSON structure is. It is recommended that you have a good understanding of the basics of python before getting into developing a bot
if you don't have an understanding of python how did you get this code to begin with 
i watched some youtube tutorial, and got some help from my friend
youtube is complete ass for learning. It's all random people making shit up
I NEED A SYSTEM BOT
Use your indoor voice
also "system bot" is very vague.
also note that we help you make bot here, we dont find them or make them for you
Go over the fundamentals properly
Am I able to post outputs from my discord bot here? I made an animated terminal style discord bot and wanted to see what people thought
Sure
Here's the three color themes
The first one is the loading animation and the other two are content examples
You can choose a color theme
Thats cool
Thank you. I got around rate limits by making GIFs. Instead of sending 60 frames it sends one 60 frame GIF and counts as one message.
I'm curious how this integrates with a bot?
Its what my commands output. Instead of outputting embeds, I output animated GIFs with navigation buttons. Its kinda inspired by the Pip Boy from fallout. These are example GIFs but in the server it looks like this
Taking a pic 1 s

What usually is the size of the gif file? Just curious to see how friendly it's to user with poor internet
Pretty small. Lemme check the size of these examples
About 500 kb each
Cool
What is the best Software to code/make a Discord bot?
Are you talking about an IDE? That's incredibly subjective and mostly personal preference
Discord bots really aren't different than any other programming in that regard. Use whatever you like
Discord
Only valid software to make a Discord bot.
In theory you could make a bot without having discord on the machine you're developing on
My point was that if there was no Discord, one couldnt make a Discord bot.
Don't think that's what they asked 
Proof?
Never have I said it does.
That's what they asked
He should ask better.
What he asked for was fine

very discord bot related
I am a bot.
@ mods
who has made a discord bot i can use? that can help moderate my server? like auto moderation
Discord has auto moderation built in
you've been ratelimited
from just turning it on………………
chill out with the requests you're making to discord and dont hit the api rate limit
you couldve hit the limit in your previous session
before restarting
i turned it on once this morning and that code is only 50 lines¿
i can make 10 lines of code that can hit the api ratelimit
the ratelimit will go away after a few hours or a day at max
This isn't a discord rate limit, it's a cloudflare block
Typically from collocating on an IP
I see
how to make bots in discord with python?
Discord rate limits would respond with a proper API error, cloudflare is a level above that
Learn python -> pick a library -> follow that library's official examples
Ok thx
so dont use replit?….
Absolutely don't use replit that's the worst
oki
Local or VPS and such
The problem with replit is that many people use the same IP address. If one person on that IP address hits the cloudflare ratelimit everyone on the IP gets ratelimited (as discord can't tell you apart). Also the rate limit might be hit because there are many people each contributing a little bit to the shared bucket.
nobody contributes to this
so i just got up and used vsc so its kool
hello everyone
vsc is just a wrapper over running the python executable in this case. If it's for hosting purposes you should probably just run it on command line with like task scheduler
is it not a code editor
It is
Code editing isn't the same as running your bot business as usual
hi
Can i use discord.ui.Modals but pass an argument in it?
Like some questions will be displayed on my form that needs to pass it manually
Yes
Subclass it
how
class MyModal(discord.ui.Modal):
def __init__(self, x: ...) -> None:
self.x = x
self.add_item(...) # Example
Subclassing is a basic thing in Python which I feel like you should learn before trying to make a Discord bot
how do you receive the input on the on_submit then?
Define the on_submit function in the class
is anyone familiar with using ro_py? im trying to connect my bot to roblox to manage a group, upon the base setup, i cannot even get a "whois" command to work, although ive followed the documentations exactly.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is my code
This tutorial is part of the ro.py tutorial set. To view more ro.py tutorials and learn more about ro.py, visit the Discord server, main topic, documentation, or GitHub repository. In this tutorial, I’ll teach you how to add Roblox features to your discord.py bots with ro.py, the Roblox Web API wrapper for Python 3. When you finish the tu...
this is the doc
thats my error
i have checked that it is taking the "username" argument correctly.
i tried searching multiple usernames that 100% exist
Doesn't really seem related to discord bots
Are you sure this user exists?
Catch the error, UserDoesNotExistError
There is no error handling
100% sure the user exists, and what do you mean? its clearly raising that error?
It means that the user does not exist, I would just use a try/except for that
Can you try a different user?
you should probably ask the maintainers of that library
ive tried, ive also tried try / except, same errors
thats what i was thinking
What is the user?
Can you try this
@bot.command()
async def whois(ctx):
user = await client.get_user_by_username("xaitzxs", expand=True)
embed = Embed(title=f"Info for {user.name}")
embed.add_field(
name="Username",
value=user.name
)
embed.add_field(
name="Display Name",
value=user.display_name
)
embed.add_field(
name="User ID",
value=user.id
)
await ctx.send(embed=embed)
lemme try
looks like expand isnt a kwarg
Change
roblox = ro_py.Client("My session cookie")
To
from roblox import Client
client = Client("My session cookie")
embed.add_field(name="Silver_coins: ",value=result[0],inline=False)
embed.add_field(name="Gold_coins: ",value=result[1],inline=False)
how do i display name and title in a single line like:
silver_coins:1000
gold coins:10
its appearing as:
Silver_coins:
1000
Gold_coins:
10
I mean you could add it under the description
desc=f"Silver coins: {result[0]}\nGold coins: {result[1]}"
embed = discord.Embed(title="Tile", description=desc)```
Sorry, I don't really know what else it could be. It's getting late over here
Thanks again
looks good now
No problem
i honeslty think its an issue with the lib
Could be
try searching by ID not by username. Usernames are not guaranteed to be unique
sorry I forgot "not"
this is searching by roblox username, itd be harder to get their roblox id just from discord
i can try that, not sure if ro_py supports search by id
surerly it does
OH sorry I missed that part of the conversation. I would think it does right? Do roblox usernames have to be unique? I know nothing about roblox. Just an educated guess
They could've just made it
async def get_user(u: int | str, /) -> User:
if isinstance(u, int):
...
elif isinstance(u, str):
...
else:
raise
Or (worse)
class User:
...
@classmethod
async def from_username(cls, username: str, /) -> User:
...
@classmethod
async def from_id(cls, id: int, /) -> User:
...
bruh i just noticed that you also did this @timber dragon 😭 and sorry for the ping
What happened with yours though
Probably hasn’t been reviewed or smth
Up to you 
But where did you get these names from, clearly they're not the ones that the tooltip shows
Maybe Discord rebranded the names, and the ones above are the official ones, Idk
I figured, though Idk where they got that themselves
I followed the html elements
That may only be the branding names
That's not necessarily bad though
That way users can compare to the ones on the ui
Question
Why are we required to pass the view typevar to CV2-only items such as container?
Couldn't it internally be set to LayoutView and that's it?
Current, I believe:
class Container(Item[V]):
By required I mean you must do it to satisfy type checker
Not too familiar with typing but I don’t think u do on basic pyright, IIUC
Oh hmm actually not sure
Couldn't it just be
class Container(Item[LayoutView])
You do on strict setting with Pylance
That would mean .view is always a generic view
Instead of one of your subclasses or something
discord.py doesn't support strict so you're also on your own when using that
Wdym by 'That'
This?
^
Yes
And is this an attr that Item has?
Ok yeah
Good point then
Although personally I've yet needed to pass my subclass type instead of just generic
Can't you make typevars have a default value or is that just in the new syntax
But if you say this then I guess I shouldn't expect them to care
Thats 3.14+
Yup
But you can import it from typing_extensions
What's the reason for 3.8 support
Dpy has done that for Interaction.client
Wait import what, new syntax is just.. syntax
Not classes that I know of
That was the latest when it was decided I guess
3.9 was released 2 months later https://devguide.python.org/versions
#336642776609456130 message
Pycord moves to the last maintained version when one goes EOL
Like now it's on 3.10 minimum
But I don't see dpy ever doing that
Still no voice message support
https://github.com/Rapptz/discord.py/pull/10230 it's complicated ig
I'd imagine
file = discord.File(buff, filename=fn, voice_message=True)```
Internally, the library would need to set the waveform (that's actually optional) and duration
And add the flag
Maybe I should test that (I mean in the fork)
No wonder
But last time I tried to do the waveform I couldn't do it
Maybe 3.0
It's easier than that iirc
I've done it reliably using ffmpeg
Wdym
The content_type will be kept audio/ogg.
But, either the file from the path or the filename being mp3 doesn't seem to cause any problems. Maybe they're unplayable on ios, I do not care enough to limit users
So I'll remove the bit below ig
Ic
Hello
broski rocking that
how could i add, delete or print a channel fixed message using discord.py?
What does a fixed message mean?
a pinned message
!d discord.Message.pin
await pin(*, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Pins the message.
You must have [`manage_messages`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.manage_messages) to do this in a non-private channel context.
That will add the pin
ok, thanks, i gonna try it
TextChannel.pins lists the pins on the channel, and Message.unpin removes it
perfect, thank you @fast osprey
I need to load some entries from a db and access self.bot.get_guild. I’ve heard using on_ready isn’t ideal. Should I do it in cog_load or setup_hook?
Why do you need to do it then? What's it used for?
I need to restore some entires from a db and access self.bot.get_guild to restore some tasks
In the case of reboots
I'd recommend just starting the tasks. If they internally need some metadata they can wait_until_ready
The problem is that if I use cog_load, it can’t access self.bot.get_guild
You don't need it then
So where do I place it?
You need it during the execution of the task, and that task can wait
You mean that I let each task call await bot.wait_until_ready()
Never thought of it that way thanks
Anyone wanna try my rpg bot??? :D
Hey


