#discord-bots
1 messages · Page 403 of 1
In my example here I don't even need to use it. because I don't need to pass more than 1 arguments. I just always use it just in case lol
Yeah, but thats the pain of it, you are always using it. But in reality, app cmds or slash cmds do not need them. Which just makes life easier
Meh. It's just 1 single character. I don't see how it makes life hard 🤣
and another thing is, using ctx with interaction for an example, its another painful thing, for views n stuff when you have to pass in ctx. I always hated that.
Cuz I don't have to worry about if I put * and making sure the cmd works
💀

also with hybrid, it makes argument arrangement more important because of the keyword only marker.
I actually remember why I use it
Because the dictionary jisho can query words in 2 ways. For example if you search for same then what happens is, it gives you sa-me the word for shark in Japanese lol. So you gotta search for "same" instead
So yeah if you wanna include quotation then * is the way to go
I never said we were arguing, I would never argue over something like this, I am just having a conversation, but you completely ignored the statement I made earlier, and then bring it back up at the end as if I didnt mention it earlier.
What did I ignore?

You brought up "so yeah if you wanna includ quotation then * is the way to go" meaning me saying its a keyword only marker was completely ignored.
That's a wild assumption
Well you brought it up back at the end almost as if you just figured it out 😭
so assuming that is pretty valid imo
I was simply correcting myself for stating my example doesn't need it
Here I said this
Then correction
I was not ignoring you in anyway
I was more acknowledging your point
Idk, just seems like you ignored that statement and then brought it backup
Hence why I say "so yeah"
miscommunication guys it's okay move on 

@viscid hornet how's the fishing bot going
If I were using my statement as a counter-argument then it would make you win the argument

havent opened the folder in a looooong time
i thought we werent arguing 😭
as expected
an argument and arguing are 2 different concepts
Bro dips all the projects he makes unless his friend asks for it. Smh
Debates are a valid thing.
arguing has the nuance of heated debate. an argument is just one side of a debate


Bros are arguing about what an argument is 💀
idk bro, he replied to my message that was sent like 3 days ago
it was the most random thing 
Smh
Is anything wrong with that tho?

If you scroll up for 10 seconds you can find his message from 3 days ago
this chat is slow
Less than 10
alright, we get it 🙏
all the voices in my head

thats whos WE. Trust
not necessarily
caps
did you ever FINISH the AI?
doubting hard rn
bro def never finished it
what AI?
oh no i never got that working
😭
tried like 8 times and eventually just gave up
bro gave up, sad
cant say i didnt try 
yeah?? cuz its 8 times??
trust me. The voices in my head told me 🙏
HOLY SHIT I HAVE NOT SEEN THE CLIP BOARD IN AGES
im gonna move your clip down
think about it
Nooo pls dont 🙏

What's happening
wow you must really like cats
quick question. how do i make a command that is something like
.help <other info thing>
i have the prefix set up its just the command needed and i dont know how to
You may want to consider migrating to app commands, where documentation is embedded into when the user runs the command
and how do i do that?
depends on the library you're using
if you're using discord.py you could create a slash command group which would be exactly what you're looking for
or do you want to specifically use a prefix command?
In d.py call @bot.command(name="name") assuming you using discord.ext to import commands
Or you can use @bot.commands() with async def <command name> (cxt):
For slash commands that I highly recommend you can use @bot.tree.commands() with a similar way to @bot.commands but also make sure to bot.tree.sync()
@anyone can someone help me creating a discord bot
i am almost complete
but due to various issues i cant complete it
for example everything was going well until my openai ran out
im currently using replit
i want my bot to send specific replies
how do i do all of this
can someone suggest an ai which is freee
you won't get an ai suggestion here so that you can code a bot with pure ai and having zero knowledge of what you're doing. this channel (server) is not made for that.
it's made for people who want to actually learn the language and build something with their knowledge, and not copy paste whatever random words an LLM throws at you.
Hello everyone ! does anyone knows how to send a message to the user when it add my app to there account?
don't do that
if they add the bot to their account, they know what they are doing, you don't need to send an instruction on how to use the bot
worth mentioning that it may lead to your bot getting into quarantine for spam/suspicious behavior
fair
You can subscribe to the webhook event for it tho
https://discord.com/developers/docs/events/webhook-events#event-types
okkayy thanks you
how to make the bot say thanks you for inviting me or something like that when it join a discord server
!d discord.on_guild_join
discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild) is either created by the [`Client`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Client) or when the [`Client`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Client) joins a guild.
This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Intents.guilds) to be enabled.
is there any way to get the channel id?
what channel id?
a bot joins a server not a channel
not that I'm aware of
aww, ig i'm just gunna check for system_channel
You can use that or for example search for a general name channel, or just any channel where the bot has permissions to send messages in
i'll just do
try system_channel
if no
check all channel until works
No need to try to send the message, check if the bot has permissions
Or just don't send random messages people haven't asked for
How to use custom bot emoji (like the one uploaded to the bot?
Had to use
discord.PartialEmoji(name='', id=)
what?
just write it literally?
discord issue with discord-rpc
-# yes i know it's a JS library, but the main focus isnt JS
what the hell is this: ```ts
{
code: 5000,
message: 'OAuth2 Authorization Error: Unknown Error'
}
i've genuinely never seen a more uninformative error message
A standard OAuth2 error occurred; check the data object for the OAuth2 error details.
You have that data object?
yeah that's the entire data object
Error: [object Object]
at RPCClient._onRpcMessage (C:\Users\james.griggs\Desktop\i hate programming pt 2\typescript projects\testing-purposes\node_modules\discord-rpc\src\client.js:178:19)
at IPCTransport.emit (node:events:519:28)
at C:\Users\james.griggs\Desktop\i hate programming pt 2\typescript projects\testing-purposes\node_modules\discord-rpc\src\transports\ipc.js:138:18
at decode (C:\Users\james.griggs\Desktop\i hate programming pt 2\typescript projects\testing-purposes\node_modules\discord-rpc\src\transports\ipc.js:92:5)
at Socket.<anonymous> (C:\Users\james.griggs\Desktop\i hate programming pt 2\typescript projects\testing-purposes\node_modules\discord-rpc\src\transports\ipc.js:120:7)
at Socket.emit (node:events:519:28)
at emitReadable_ (node:internal/streams/readable:832:12)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
code: 5000,
data: { code: 5000, message: 'OAuth2 Authorization Error: Unknown Error' }
}
there should be a body with the details
otherwise show the code, even though it's js
or you can go in https://discord.gg/djs
thats all it gives me 
import { Client } from 'discord-rpc';
import { CLIENT_ID, CLIENT_SECRET } from './vars.js';
const client = new Client({
transport: 'ipc'
});
client.on('ready', () => {
// console.log(`Logged in as ${client.application!.name}`);
console.log(`Authed for user ${client.user!.username!}`);
});
async function main() {
await client.login({
clientId: CLIENT_ID,
// clientSecret: CLIENT_SECRET,
// scopes: ['rpc', 'rpc.activities.write']
});
}
main();
for the login i was tryna copy discord-vscode since that seems to work
14k online HAS to be a lie. i haven't had a reply in over an hour
no
nearly two hours
the .login() part you shouldn't use that require thing but rather your current way of doing it
same for the imports, keep your currents
also make sure the client id is a string
is there anyway to get all the user that added my discord bot to there APPs?
Nope
Aww, sad
hello
Yes?
Oh you're asking here
Rules
Do not offer or ask for paid work of any kind.
Use something like fiverr
!rule paid work
Or on any marketplace
go to fiverr or upwork
oh
Or any discord that accept this
ok
Like disboard and search for marketplace or idk
This interaction failed - when i press 1 button
Click here to see this code in our pastebin.
wheres the code from
also why are you adding buttons manually
you dont even set a callback on any of them
How to explain a command
@app_commands.command(name="set_verification", description="Set verification role, challenge level, and optional verification channel.")
to explain which is what
founded
@app_commands.describe(
first_value='The first value you want to add something to',
second_value='The value you want to add to the first value',
)
Can also use docstrings
yeah docstrings are the easiest way
Hello, everyone?
Anyone knows how to get user's bio information using discord bot?
Bots are not given access to that
So, you mean we can't get that information?
Not with a bot, no
Automod can access it if you are looking to do some simple moderation of it
If you use discord Prívate API you can, but is it allowed I do not know at all but the V10/User something does work
"Private api" here means impersonating a user, which is against tos
How to detect when someone reply to your bot??
on_message and check if the sender of message.reference is your bot
!d discord.Message.reference
The message that this message references. This is only applicable to message replies (MessageType.reply), crossposted messages created by a followed channel integration, forwarded messages, and messages of type...
Thanks!
whats the best way to integrate music functionality to your discord bot? i've tried ydtl with ffmpeg and doesnt seem to be working
!ytdl
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
what about any free music api's?
It's not about being paid or free
Music is copyrighted, we won't help you breach copyright laws
Will also likely lead to your bot getting terminated, eventually discord account as well, so don't do it
If not, then you'll likely get a C&D letter from the service you're breaching the ToS, e.g. Google
There is unlikely to be an api that hosts things for you for free that consists entirely of music that artists have signed away their copyrights to. They get absolutely nothing from doing that, and even then it's not going to be music you or users will want.
There are already music sharing services that properly compensate their artists. Do something else with your time
how to make so my commands does not show on other discord server (app)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
@app_commands.user_install()
i use this
but even when i remove them they stiull shows up
Wdym "other discord server"
Do you want it to only show up in...
- certain servers?
- thr bot's dm?
- anyone's dm?
- dm group?
- any combinations of the 4?
found
@app_commands.guild_only()
okay no it does not work
just want to make app command to only works on guild
because like it is installed on account and dont want them to show up there
Make sure you've synced
@bot.event
async def on_ready():
try:
await load_cogs()
except Exception as e:
print(e)
await bot.tree.sync()
I got this but my bot use app_commands
so feel like bot.tree.sync
like it updates the commands but not the status
maybe they should be synced in the cogs too?
Try reloading your app
What
@app_commands.guild_only()
@discord.app_commands.command(name="", description="")
@app_commands.choices(action=[
app_commands.Choice(name="enable", value="enable"),
app_commands.Choice(name="disable", value="disable"),
app_commands.Choice(name="status", value="status")
])
@app_commands.default_permissions(administrator=True)
like this
@bot.tree.command() is the same as @app_commands.command(), with the addition that it also adds the command to the tree.
Else you need to add the command to tree manually if not inside a cog
there all inside a cog
Ah
Make sure they're all intended correctly and that the extension is actually loaded
yep there all loaded
And manually sync them
how?
Did sync return the command that you're trying to sync
@bot.command(description="sync all global commands")
@commands.is_owner()
async def syncslash(ctx: commands.Context):
if ctx.author.id == 1219523120919220225:
try:
await bot.tree.sync()
print("Synced")
except discord.Forbidden:
await ctx.send("Unexpected forbidden from application scope.")
else:
await ctx.send("You must be the owner to use this commands
it printed out Synced
wait
now, nothing shows up
my bad i removed the on ready
@discord.app_commands.allowed_installs(guilds=True)
@app_commands.allowed_contexts(guilds=True, dms=False, private_channels=False)
you don't need to set everything to False explicitly
just like you didn't for installs
dont do that, dont put ur bot.tree.sync() in the on_ready event
@discord.app_commands.allowed_installs(guilds=True) is fine
u dont have to add @app_commands.allowed_contexts(guilds=True, dms=False, private_channels=False)
i dont see the bad thing
like only if you have a lot of things to sync
Do you understand how on_ready works?
Only discord py devs have a problem with this
Every other lib does it fine
Not really, that's just people misunderstanding the event
It doesn't matter which library, the events are sent by Discord the same way for everyone
Other libs have some on_connect or whatever event where they also auto-sync in the background, which does what people think the ready event does. It doesn't mean discord.py is the issue, it's just devs not reading the docs and assuming what an event does
Maybe other libs do some checking in the background to see if it effectively needs to sync the command(s) again, but I guess that would involve other requests or something to get the current commands.
If they don't, which I doubt when they implement an auto-sync, then it's a great way to get rate limited for the day
Ya afaik the dpy forks check the current commands against those in the code on startup and reloading etc requires manual syncing
Then it's definitely some convenience and personal choice, I'd prefer the bot to sync its commands when I want it to sync
someone in dpy is looking into a reliable way to optionally auto sync using hashes: https://discord.com/channels/336642139381301249/1326219331050147940

I did something like that a year-ish ago
It's for an argument if I remember correctly
hey yall, its my first time trying to make a discord bot, im following this tut on youtube and I wrote all code the same way he did but for some reason there is a bunch of errors in the terminal that dont make sense to me... Could anyone be able to help me?
People on YouTube make shit up or just flat out lie. I strongly suggest you don't use that as a foundation
It's a bunch of kids in their basement guessing at stuff for internet points. You're much better off following the official documentation and examples from the library you're using
alright thanks,
https://github.com/FallenDeity/discord.py-masterclass/blob/master/examples%2Fsmart-sync%2Futils%2Ftree.py I was experimenting with something similar for smart sync, via building a diff object between the current commands and the global synced commands, not sure how sound the current impl is but last i checked it was working for most stuff
A tutorial/guide explaining all features in discord.py and how to make a discord bot from scratch. - FallenDeity/discord.py-masterclass
!e print('hello')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
hello
Could this type of comparation issue? using a boolean comparasion and a XOR check?
What's your question?
Also discord already grants a role when someone boosts that you can customize and/or grant permissions to. There shouldn't be a need for you to track this
If that could potentially issue.
I do know that, we're allowing users to customize they're own award roles (multiple)
honestly props to you because we barely see code like that in this channel
most of the time it's code thrown by an llm or copy pasted off 5 years old tutorials
There's not a functional reason to make more roles, when you're already given one role that does what you want and can be customized. But you do you
bahahahah, we've spoken in the past, i dont know if you remember, check dms 🤣
Welp, some people like to grant additional roles while someone boosts... so why not making it... costs me nothing...
Your call what to do with your time. People want all sorts of trivial useless junk that doesnt actually mean anything
If i remember correctly you also said making antinukes is useless
and i remember we've argued about that
but sadly discord cannot do this, and neither limit actions, i do love the threshold logical system into limiting the actions, since discord does not provide and actual limitations towards that
counting bot
What does this do differently/better than Xenon?
Anywho you shouldn't be looping and calling add_roles or remove_roles multiple times with one role each time. Just send them all at once
Automated recovery too, that happens in the security protections, and because xenon has a cooldown of how long? 24 hours?
- if you wanna see, you can read here: https://spookybot.net/docs/security/antinuke-premium
What are the recovery percentages based upon? and how are you estimating it?
It's an estimation made base of myself, in between the things we can / don't / can't do
That we do mention in tier differences, as in free we mention channel protection may work in limited scenarios
if a category gets deleted, we do not re-edit childs to parent
For level 2, we use the bulk restore method of the saved snapshot into our database, to ensure everything gets back as it was previously saved
- we use signoz for more infrastructure monitoring
and we actually manage to recover big servers, as you can see in home page, our bot may not be in a lot of servers, but it is in lots if big servers used as main bot
you seem fun at parties :Dd
ayo that's sick
Does it give the members back their roles
he has a point. it's not really about being a killjoy, it's more about investing in something practical as opposed to reinventing the wheel
I do agree tbh. If you already have an automatic role that a booster receives, just edit that same role to fulfil the purpose of a reward role. It just feels right.
But the antinuke I gotta give you credit for lol. It looks satisfying
I mean, if anti role remove protection is enabled, of course, we've also made the authorization possible in case of mass bans / kicks the bot can re-add members abck to the server
but that's members choice, if they want to authoritize the bot.
Wym "re-add"? Don't you have to invite first?
- we're also trying to create custom profiles
If authorization is allowed members will be automatically be re-added
Interesting
This is work in progress still, might take some time, since im currently doing a re-polish over the files
Messages will be forever lost tho right
there is no point to restore messages
- it would be very very bad
So, the only problem i see doing that it's
- Affecting user's privacy
- Lots of data stored (if big servers, multiple channels, storing even 100 messsages per channel its already a big nono)
really easy to get done back, and most people to embeds... so...
i might finish up the embed creator feature by today, since i've already globalized the ui
This type of editor, 1 developer that sadly is not in the team anymore, done this for us, but he done it just for welcomer, i've already revamped it and globalized it, so for our booster message we use the same builder
ay wsg spooky
it's a big server that supported me a lot 🙏
Yeh, it's very nice ppl
really supported me a lot, and they mostly main bot for features, including our security
famous
na bro, i really dont act holywood
most ppl on this app act hollywood
like they selena gomez or sum shit

im jus fuckin around on bandlab cs im way too bored
i been spending the last hours refactoring some docstrings and im still not done
not fun
the amount of files 
seems exciting
multi purpose... what can i do....
we globalized everything we could of had
there's no such as repetitive code
the first bot i made i put everything in main.py cs i didnt know how cogs work 🗣️ 🗣️
yeh it's just overwhelming
neither do i now 🗣️
This is all globalized used in multiple files 😭
i tend to split projects in various repos to prevent that
bahahhaa
i mean... that's personal preferences
yeah definitely
im used to this file tree, if you would spend 30-40 mins reading it, im 100% sure you'll understand it
oh yeah that's not the issue, i just find it like too much - not a personal fan of monorepos
though if i'd make a project in a monorepo pretty sure i'd get used to it fast
i mean, ofc website is on a different repo bahahahhaa
what do you think of coolify?
ah, the bot folder at the top probably confused me
never heard of
Ohhh, it helps us to have 0 downtime
whenever a new commit is done, it gets queued, then deployed
mmkay, looks nice
old instance will run till the new one is ready
yeah i use k8s etc.
bot will dispatch once on_ready is fired
it probably uses k8s in the background tbh
also easy to manage databases, for testing
since the production bot is connected to an actual database cluster
we're using disnake
ofc we do have cogs bahahahhaha
they load inside of the init files
would be one hell of a mess otherwise
oh
i agree LMFAO
i also need to make these docstrings omfgggg
and i need to find out how to delay dispath method by 10 seconds
last time i tried, it never dispatched

are docstrings the things that popup when youre using a function
the luh description
docstrings is whatever you see inside of the """
it helps to understand the purpose of that specific thing
i hate how it's in python tbh
BAHAHAHAHAHAH
the fact that it's below the function definition and not above
when you have a long function definition, pain
i'll have lots of fun
Is there any on_webhook_create?
that one means whenever a webhook gets created, bot will punish and delete webhook
ah shi i thought u meant on my file tree
what you are looking for is on_webhook_update, thats what keeps track of created webhooks
no problem 😉
good luck!
Haha yes
its not easy😭😭
yeah, these are basic rulers, can easily keep track
i ll get into anti raid soon
but the antinuke is really master done
It would work
we have threshold system
Yes logiv
to adapt to the users needs
Logic
we also have this
being sent rn
we reduced api calls, all existing checks for params to only update, if not existing it creates
I will work on this too
but ofc we have a priority list, so we can sort channels and categories
good luck, i spent 50 hours doing a refactor on it
and base was started by another in the development team and took like a week
can raise so many issues
Oh lol
its easier if you make a safe execute and u pass the coro in it
and dont do try except pass, use contextlib instead
you save up some lines
how do i keep my bot on replit running for 24/7?
Pay up
Don't use replit
Or rent an actual host
No point paying for replit just to be able to host properly, buy a cheap vps at that point
there is no way around? there is no public url for uptime
The way around is to use an environment designed for what you're trying to do
They changed how the projects stay online. Uptime robots no longer work
what other alternatives are there except railway?
.
Like said above, a VPS or hosting it yourself on your own hardware
!discord-bot-hosting
Using free hosting options like repl.it for continuous 24/7 bot hosting is strongly discouraged.
Instead, opt for a virtual private server (VPS) or use your own spare hardware if you'd rather not pay for hosting.
See our Discord Bot Hosting Guide on our website that compares many hosting providers, both free and paid.
You may also use #965291480992321536 to discuss different discord bot hosting options.
some popular ones are AWS, Azure, Digital Ocean and Hostinger
personally I prefer AWS but it's a bit pricey
I'm learning AWS specifically to host my bot and it's dashboard
I used replit before but the downtime was atrocious
nice. aws downtime should be minimal
I suggest you using hetzner
it's very cheap, and very good and safe
personally we run our application on ipv6, thru firewall you can allow connections that you only want to connect
and a pro top, for max security if you have a website, use clouflare 20$ tier
very safe
@slate swan
GalaxyGate is also very good, I've been using their service for a year
don't ask about vape feature...
86k commands usage in 4 days 🤣
What does the vape command do 💀
so only 1 person can claim the vape
then they can steal from each other
while vaping, with default vape u have a chanhe to earn spukies
u can buy better vapes, earn more money
we also post unique limited vapes
there is also achievements
💀
Oh god
were there no better options for an item than a vape
That's amazing
its honestly a feature that got lots of people addicted
and these achicements will be badges on our custom profiles
vape its like a branch of economy system
So can you prevent it from being stolen?
items coming out soon, with different abilities
its overall a nice feature
Nice
and we dont display limited vapes in store
just people inventory
@timber dragon as u can see thats how limited vapes get displayer
displayed
Ooh
thats embed of user inventory
Good stuff
i made it in less than a day tbh
and to keep a easy track, all vapes are inside of an enum, they're marked with 1,2 etc. to keep an easy track of user inventory
and if i change the enum with the attributes, it will change very easily
i just need to add the docstrings... but it's what im currently working on
i just finished doing it on economy
been doing it for a long time and im just half done...
Nice nice
Is there a channel where I can sort of advertise a need for a dev for a bot? If so is this it?
I don't know that aspect, but if you'd like, you could dm me.
is there any way to set guild image from url
because
because url under /icons are blocked to be seen
I think i know what your problem is
you're trying to reverse the action as anti icon and anti banner?
restore
cdns of discord now expire, once image is changed, the old image cannot be retrieved anymore
well it seem to still
its not possible
reason why we've set it to premium security to level 1, and we store the assets bytes
oooh okay
Nope... once image of guild changed
it's not possible to retrieve it anymore
You can get current one, that's set, but if that's changed, old one is unfindable
I may didn't understand your point, but if your point, is to get an old icon, that got changed, you cannot retrieve it
welp, u need to convert it to image bytes
ah
and to convert u could do a variable, as image_bytes = response.content response being the response from aiohttp
like you can't get it from only the url it goes to image-1 cdn
what do you mean?
like when you try to get the response from the website
you can't because it only shows if you go on a sub domain with some kind of token behind
yeah but u need the actual url of the image
not this
or i may just not understand what you're trying to do, since im so fucking tired
and im still doing docstrings... ill dream of docstrings tonight
me on google it is not able to scrap it
i mean you can make this much easier if it's an actual cdn that never expired
by reading it
or if they have the actual url to the asset they just need to make a GET request to it
Is discords API down?
Welcome to Discord's home for real-time and historical data on system performance.
everything looks operational
it has issues
Things are returning a 503.
that status page is not up to date.
oauth2 and interactions have issues
Alr, thank you
Interactions were the issue on my end
Love the API issues sometimes lmao
it's weekend + middle of night at discord, probably will get updated in some time
yeah
sounds like a friday deploy :^)
like next year
i see
the only things at discord that they try super hard to get to 100% uptime
This is funny asf actually
I love this dude 😭
points out something ive never noticied and I fucking love that its THOSE 2 things out of EVERYTHING lmao
gotta be realistic right :^)
just business things lmao
obv
discord store is very lame
can't even access it from a phone, only thru link is accesible
is there a way to edit just a single part of an embed from a different command?
server subscription stuff payment is also locked to US only lol
you mean only people from us buy?
I don't think that's true, since we use that on our bot
not on bots but on the server itself
ohhh
dont suppose you know the answer to this, just so it doesnt get lost @dry kelp
You don't edit embeds. You edit messages. You can pass whatever embeds you want to be on the message after the edit
nevermind i figured it out, had to use the . to change rather than overwrite
that's not true
my issue was more so i was i didnt know how to edit a specific field and instead setting the embed to just be the new field
well they were talking Discord Store, not Server Subscription
But yes, Server Subscription is only locked to the US, but Discord Store is not.
yea, i was adding onto what was said, hence why i used the word also
ah alr, mb
My bad, didn't see
Yes, you can edit the embed message
just certain parts
yea i got it working, ty though
my apologies for late reply 🙏
i mean im quite sure u had to check old content then update to the desidered content
yea i had that i was just rewriting over it
i see i see, im happy u got it working, not something i've personally done..,
its easier to make an embed builder, and then an embed editor
i agree, i should do that, but i would find it easier to do it this way
it doesnt seem like most people have since info on it is somewhat scarce
unless im missing something i couldnt add that into my code though ?
im making a trade command and id want the embed to reflect changes when a user adds or removes stuff, how would the embed builder enhance that ?
all good i can be bad at explaining things, i appreciate the help always
Yeah ofc
I just love that embed builder a lot though, so I thought thats what you meant tbh
im hoping i can get someone else to design my embeds for me after im done with everything, since design is not my speciality at all
it should be easy
my first thought of embed builder was a function that takes all the arguments youd want in an embed and then spits it back out without typing all the embed syntax every time lol
this is what I do for that:
https://paste.pythondiscord.com/XSQA
Why are author etc supposed to be in **kwargs instead of being part of the signature?
i saw some discord bot that are able to read discord message to detect keywords is there any way (it worked on javascript) (discord apps)
Sure it is possible. It depends what you're trying to do
It should just be a simple on_message event that checks if "keyword" in message.content
Because I'm not adding an author in majority of the embeds. The only arguments which are a part of the signature are the ones I will be using 99% of the time
no
because when i do on_message and send any message in dm it does not print at all
DM with the bot or some random user?
random user
well... how would a bot see your DMs with a different user
discord apps
I still don't see why it can't just be part of the signature, when the function always checks if the key exists in the dict.
i saw a bot do this
Bots cant read your DMs with other users
and apps can? or not
Personal preference, it looks cleaner that way 
This is supposed to be a private project so it's not like, adding all those in the signature for the IDE autocomplete to detect, is useful either
technically there is a way but you need to be a partner with discord. I think only xbox or something is allowed to use that feature
hmm okay ! by checking it back it seems to not work, or maytbe i'm just crazy haha
You can use app commands in DMs but you cant view random messages
Yea, fair
is it allowed to make a discord app join a discord server on add?
just a 1 time join no spam or those goofy backup bot
I mean like when you add the bot to your personal app with the join server for you permission
If you are talking about a bot that adds a user to a server:
You need to get the users permission.
yes, with the "join server for you" permission, but any idea how to make so when they accept, it makes them join the server? using discord.py or requests idk
That's an oauth operation, not a gateway bot operation
I think that is out of scope for most discord bot libraries but I dont use discord.py. You can look to see if there is a python OAUTH library
client = discordoauth2.Client(849930878276993044, secret="very-secret-code",
redirect="https://findingfakeurlsisprettyhard.tv/oauth2", bot_token="bot-token-only-required-for-guild-joining-or-updating-linked-roles-metadata")
app = Flask(__name__)
client.update_linked_roles_metadata([
{
"type": 2,
"key": "level",
"name": "Level",
"description": "The level the user is on"
},
{
"type": 7,
"key": "supporter",
"name": "Supporter",
"description": "Spent money to help the game"
}
])
@app.route('/')
def main():
return redirect(client.generate_uri(scope=["identify", "connections", "guilds", "role_connections.write"]))
@app.route("/oauth2")
def oauth2():
code = request.args.get("code")
access = client.exchange_code(code)
access.update_metadata("Platform Name", "Username", level=69, supporter=True)
identify = access.fetch_identify()
connections = access.fetch_connections()
guilds = access.fetch_guilds()
return f"""{identify}<br><br>{connections}<br><br>{guilds}"""
app.run("0.0.0.0", 8080)```
like this lib?
But you don't need a website domain?
I have never worked with OAUTH ¯_(ツ)_/¯
like it run on 0.0.0.0 but this https://findingfakeurlsisprettyhard.tv/oauth2
XDD, sad
Oauth flows require you to host a site for the callback redirect so that discord can send you the token
ye that what i think
What's the actual goal you're trying to accomplish here?
Typically you really only need this oauth scope if you're actively gating a sensitive server behind custom verification
Otherwise people can just join on their own or be given a link
looks fine to me, you might want to include the ID of users as well. Also the timestamp in the embed is not needed if the time that the message was sent is the same
Last field looks unnecessary
last field can be a link something like "click here to view chat log" or a jump link, where it jumps to the chat
also make use of the author part
I would put everything in the description instead to make it smaller
Reporter: mention (ID)
Reported by: mention (ID)
Reason: repr()
Thread: ... (ID: )
But I am also bad at designing lol
we delete the threads because this bot will be implemented in a server with 700k members so it might flood the archives
oooh
you can have unlimited archived threads
Yeah you don't need to delete it all haha
why don't you guys make use of chennel threads instead? they can be private and hidden from members and mods so they don't flood as you say. also a dm to the user to be able to access it anytime (assuming mods would have a logs channel)
i didnt want to delete them either, but the owner of the server was insistent
fair enough
yeah i wouldve preferred that
but archived threads delete after 7 days, and i suppose he wants a permanent transcript
archived threads delete after 7 days
this is not true
There are threads that are 3-4 years old in a server I am in and have been inactive for that long as well
I think you're confusing auto archiving with auto deleting

can you help me?
Sure
see
do you bot.tree.sync() at some point?
also if it's a new command make sure to ctrl r
if you've synced it like Cyn said
anbd yes restart discord too
yes
i restart bot so many times
and discord toobut not working
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} command(s)")
except Exception as e:
print(e)
await bot.load_extension("commands.owner")
print("Owner commands Loaded!!!")
did it print the amount of commanda synced?
yes
did it match with the amount of commands you have, you might wanna print that resulting list and check
yes
!paste the code here then
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.
in termimal command succesfuly syced
but in discord not
ok
wait i will send full cog
are u sure ur checking the correct server and the bot was added with application.commands scope
have you done a ctrl+r
you still haven't replied to that
yes when i make otner comannd that synced succesfuly on discord and on terminal
alt+f4 discord and start it again
then one of the questions above was answered wrongly
which one
which command is not syncing?
Seems like you using discord.py, i am quite sure they handle them and they will sync, always... You could either force sync them, but from the looks of it, you either didn't load cog, or didn't refresh discord, since you need to restart you discord for the interaction commands to update
discord.py dosent auto aync
u always need to sync manually
but yeah prolly something wrt to the latter is true
arez the cogs loaded?
from in that cog
other command working fine
see
and i already restart discord and bot
nope
How have you restarted the discord app?
How
oh that's very bad then
@vale bough since you seem to be a begginer using ai to code, i recommend swapping to disnake library
how would ai help in either case?
if you want to focus on interaction commands
from the code they've sent, it seems like they use AI to code, so it wouldn't be a big deal to swap to disnake
since disnake it's much better for interaction commands, and the library i personally use for my bot
but how would that help with coding using ai? wouldn't it better to recommend resources to learn how to develop?
Dude, the code they've sent, it appears that AI coded that
this is the code they've sent
Why would u put an comment saying "# Optionally include more info if available"
bro i gave that to ai to fix that error
as a developer if you do something, and dont even knwo the data you have, it's already a bad start
i am not saying its not ai generated code
@vale bough Yeah, i am not blaming you, i am suggesting you, to swap to disnake, if your bot it's not an prefixable bot
but how would disnake resolve the issue of a beginner attempting to code using ai
since you seem to be a begginer using ai to code, i recommend swapping to disnake library
Just recommending to use disnake as it's easier (won't comment on that) and they won't need AI to use it, unlike what they're doing now.
Not recommending to use AI whatsoever in that message
disnake it's much better for interaction
fair enough that i agree with
Disnake is friendly for interactions, MUCH more friendly
and you don't need all that sync logic, force sync or whatsoever
i like the interaction client concept
Yeah, overall d.py is good, especially for prefixable bots.
But since i am planning to stand on interaction commands, i would rather use disnake
and not a big deal creating custom methods in case i really want an extra
cause d.py is not so good for interaction, but i cannot give you an logically explanation, besides you surely done something wrong.
But since you use AI promts, i recommend swapping to disnake the whole bot, shouldn't be a big change overall, just the way you use interactions
No need for that @app route, with all tree logic, i personally didn't look into and can't understand
now i need to change 50+ files
this is how easy you can create interaction comamnds using disnake
You sent this image, are you using 50 files for 33 commands?
that's very bad practice and definitely not recommended
most imports are very similiar
ok i will change to this
It's just an recommandation tho, but you do you.
Have you tried a reset by doing ctrl + r?
Yeah, but discord.py doesn't auto sync commands.
apparently, don't have information on that, but that's what it seems, and what they've mentioned in above messages.
@vale bough btw automod exists, so you dont need antilinks
Ummm, i am quite positive discord limits regexes allowed...
Maybe, I didn't read all of his messages but some of his commands have to be synced?
it seems they do. i take it back 
From the looks, and i am not blaming him for using AI, but that code looks mroe likely AI, so for a beginner it may be a challenge to fix that.
Also based on his print counting the commands he has, I wouldn't be surprised if his code is the same as mine that I got from a tutorial some time ago
I mean 50 files for 30 commands, it's a big no no 😭
i mean we have this massive tree, but shit, 300 commands 
Yea that's a separate issue and one that he's only really going to learn from by doing and making the mistakes
very important how cogs managed... especially for public applications, if they are planning to create a public application
1 more thing i've noticed is that they use mongodb, mongo is fine, for a private bot, but not when it comes to a public application...
Personally for a public application, i would recommend PostgreSQL database cluster (or locally thru psql) since they're made perfectly for long term storing data.
I use mongodb too, even for a public app it should be fine. Poketwo is a huge public app and it uses mongo
That's prefereces, if it satisfy they're needs, most bots should work on long/large storing data.
So an option is definetely PostgreSQL
Sure, but I don't think mongo is a bad choice at all
Especially since it means he won't have to learn SQL alongside learning python
There are ORMs, that automatically migrate / upgrade / downgrade database for you
It may slow down a bit the process, but don't think it's a 10 minutes delay, it's a few miliseconds
So no, you don't need to learn "SQL" (would be helpful for query for hand modifications if needed all these can be found online) but what you would need is to read another library that handle this.
Mongo is a horrid choice, especially if your data is relational
- agreed, i wanted to say this but i didnt want to sound like a dick, i didn't know how to formulate 🤣
Takes about 5 min of googling to find legions of posts regretting they chose mongo. It's absolutely not a decision someone should make without knowing what relational data even means. But that's very much a #databases subject
^^
What even is there bot
?
Like, what's it's goal
Which bot are you talking about?
Pikachu's, that's the bot we were talking about, no?
@commands.Cog.listener()
async def on_message(self, msg):
print("message received")
Anyone got an Idea why msg is always empty?
do u have message content intent
good call, will check now
Your code doesnt even check the content
@commands.Cog.listener()
async def on_message(self, msg):
print("message received")
# Ignore messages from bots, DMs, empty messages, or very short messages
if msg.author.bot:
print("Message is from a bot")
return
if not msg.guild:
print("Message is a DM")
return
if not msg.content:
print("Message content is empty")
return
if len(msg.content) < 3:
print(f"Message too short: '{msg.content}'")
return
🤨
Do I need to add them in every class or only the main one? Cuz if only in main I got that
?
What is this code trying to accomplish, this just does some prints
Yeah, dont wanna post the whole code... My question is about the content being empty nothing else, so I dont see a reason to flood this channel with unnecessary code
Fixed the problem tho
If you're unwilling to even describe what you're trying to do with peoples' messages, that's not a good look
Yeah... But my problem was that the content was empty and nothing else...
I dont get that point tbh
!intents
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.
There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.
Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.
The point is that if you're asking a question for the purpose of building something you're not even willing to talk about, that's problematic
And people might want to be aware of that before helping
please... dont do this.... 😭
let's not mention of all the early returns ....
please annotate your codes!

First of all, in that code you're doing LOTS of early returns, this could be simplified much more just by doing a if elif minigame yk? Besides, you're expecting the msg from on_message, PLEASE add the annotation to msg, as Message from your library, and since you're expecting to get the content, right, print(msg.content) should do the job, it's either you never loaded the Cog with this event, or you never Enabled the message_content intent on the bot, discord dev portal, and using it to wherever you define your bot in the baseclass, ALSO consider if you verified your bot, which can be quite easily done now, you need approval from discord to receive that intent with a valid reason + demonstration.
they already fixed the problem 
how to determine if a user has a banner set and if they bave a custom emoji in there status and bio
user = await bot.fetch_user(user.id)
banner_url = user.banner.url
and for the bio you can't without acting liek a real user, and using user api
Which is against tos
Yes forgot to add this xD
Still dont know why they allow bot token to do request like this, and same for discord account doing bot stuff
they don't allow it
Because otherwise you wouldn't be able to use discord? And there would be only bots?
@stone dust selfbot
Just vlocking bot token on user request, and blocking user token on bot request wont be that hard
Bots and users share the same endpoints
There's not a separate API for that
There are restrictions where bots can't use endpoints like users, hence why the bio of users is not retrievable as a bot, the other way around wouldn't be possible, otherwise you, as a user, wouldn't be able to use discord at all
i've done a code that checks the user's status
it's such a pain in the ass, i aint even gonna lie
Some ways of checking are if a user has a custom server pic, if they have a banner, if they’re boosting the server (these r the ones i used)
discord won't tell this to you by design. Anything else mentioned is a guess
people can see if someone has nitro anyways already
Guild avatar with member.guild_avatar
https://discordpy.readthedocs.io/en/stable/api.html?highlight=member guild_avatar#discord.Member.guild_avatar
You need to fetch user for the banner
https://discordpy.readthedocs.io/en/stable/api.html?highlight=user banner#discord.User.banner
Nitro boosting with premium_since
https://discordpy.readthedocs.io/en/stable/api.html?highlight=member premium_since#discord.Member.premium_since
You can buy standalone boosts tho
You can also just not set a banner/pfp even if you have nitro
can you say that in clearer matter?
I can buy a boost and apply it to a server without having nitro
If I have nitro I can also choose not to set a custom banner or set a per server profile picture
ah okay
Looking for people doing nitro things gives false positives and false negatives on whether or not they actually have nitro. It's not a particularly meaningful thing to worry about anyways
You can't buy boosts without nitro?
Ah it says "Nitro + xxx" when you have nitro
Couple of reliable ways:
- animated avatar
- custom emoji in status
- has sent animated emoji or an emoji outside guild this month
- has sent sticker from outside guild this month
Its not reliable if it's not guaranteed to not give false negatives/positives
Plus it's really not worth all that work to actually code something like that when
- It can give false negatives
- I can just open your profile to see if you have nitro
You can only get false negatives with that, not false positives, and you'll get more accurate results
The last 2 will result in false positives because you don't know if they sent it on the first day or last day of nitro
Also for number 2, does discord clear your status when nitro runs out?
They should all be checked together
I still don't see how that's gonna get you accurate results
People don't always have an animated profile picture or have an emoji in their bio even if they have nitro
You're only making guesses
It's a bit of a moot point, people really don't need to know this at all in the first place. They'll probably accept whatever guesses they need to because it makes their carbon copy user info command look cooler
It never got said it'll be 100% accurate, you'll get some positives but as mentioned multiple times; you cannot be sure a user has nitro, these are ways to know if a user may have nitro.
Not sure what the use case is for "this user might have nitro, we just guessed" when someone can literally get a 100% answer in one click
yeah, just like most commands in bots are useless; e.g. userinfo, ban, mute, kick, timeout/mute, etc.
People like to have them, we offer ways to deliver
Yeah, if someone wants to put in that effort just to make a guessing system then I guess that's their choice 🤷
Uhh
I have been learning python for the last two weeks and would like to learn to do discord bots using discord-y, would y’all recommend it and how could I start learning?
I usually pair those commands up with other actions, is why I have them
Also it's great to force people to put a reason
Wolfy Was Banned Reason:sijgisuch to bad that this probably happens
Whatever you do please do not follow YouTube or online tutorials that are not specially recommended by the library you use. I went through the top 10 Google results for discord bots and not a single one was up to date. I personally do not recommend discord.py but I am biased. You can find a list of all of the major libraries here https://libs.advaith.io/#python
Compares Discord libraries and their support of new API features
first tip, is decide what you want your bot to be, so you can properly choose libraries you want to use
first of all, if you wwnt a prefixable bot, use d.py, if you want an interaction bot having / commands, definitely choose disnake
You can have slash commands in discord.py
you clearly dont know the differences between those 2, inform yourself, google is not too far
you don’t have to be rude about it
sowwy, had same subject yesterday, without considering he is a different person
A few of these are kinda just there for legacy reasons when they werent in discord natively. But having a ban/kick/mute command allow you to save logs is super useful when in a years time someone wants to dispute it, you don't have to go purely on a reason like "troll"
but it wasnt said in any rude ways
disagree with choosing disnake for app commands though, discordpy will be fine for the most part
But also ban command allows additional functionality like being able to ban someone not in the server
Then you clearly have no idea of the differences between those 2, and disnake is clearly much friendly with new users
why would someone waste time learning to do all that stupid tree as @app.tree groups and whatever they have
again, I don’t know why you’re trying to be rude
Everything can be solved by saying "Google it". But that's not the point of online forums like this. These promote discussion, feedback. perhaps people dont know what to google. Offer a guiding hand. Offer examples. Explain why.
had same subject yesterday, explaining why
It's a high visible difference between how d.py and disnake manage interaction commands.
That's not a good explanation for why disnake is better for application commands?
and yes, I am aware that the interface is simpler
But if your goal is to learn, you shouldn't go for the simple things imo
On d.py you need to follow a logic tree as @app. etc. using disnake, has much easier ways to handle commands, in the attached screenshot is a code of mine, showing HOW SIMPLE the interaction commands can be used and managed
With a MUCH more friendly interface faced to d.py
If your goal is to make a discord bot while learning I would choose the simpler way if it accomplished the same thing
when does disnake sync with discord?
Instant + automatic, no need to sync commands on your own.
^ by default, you can change it if you want
Sorry, can I not prefer manual sync? I don't like the argument of one interface is better than another than another when it's personal preference
There are varius option, where you can also sync commands just for a certain guild.
So they basically are life savers, and you expect to make an interaction bot, without syncing the commands you do, why even making a bot?
If you don't want your commands to be on discord, then don't code it 🤷♂️
Well, I don't like how you say one thing is better than another, and insult the other who disagree
yeah personally i prefer explicit by default but i guess for someone new making a discord bot they don’t really care about it
Insult? Please reply to the message where i've insulted anyone, thank you.
You can prefer all you want, but the user was asking for recommendations and likely has no preferences as of now. If they have strong preferences they can choose the library they want
it’s better according to you, subjectively. It depends on what the user is looking for in a framework
Clearly preferences, but don't say stuff as this:
disagree with choosing disnake for app commands though, discordpy will be fine for the most part
Because it can affect a beginner choice
literally all of your messages come off as hostile
Ig it's my way of talking, they've mentioned insult, i have never insulted anyone.
I recommend being far more cognizant of how your messages come off to people then
hostile != insult
I came on pc to explain differences, i was on phone.
mans using big words ;-;
And this is basis sense, why wouldn't u want ur commands to auto sync??? That makes no sense for me.
because some people want control and some people don’t care
Why wasting lines to sync them yourself 🤣
it’s situational
You can control using disnake so easier...
various options
you can just disable auto sync ¯_(ツ)_/¯
Yeah sure, you can configure it with discordpy too
most of these libraries have the same feature parity so it just comes down to preference
