#development
1 messages · Page 263 of 1
uh, .catch(() => {}) 🤓☝️
process.exit(1)
oh yeah, catch the error. because it's people that will be using your bot, not you. we don't know how people will invite the bot. thus topgg invite the bot with no permissions
not really
some people are picky with what permissions they give to bots they invite
yeah and that also
Why the hell discord provided perms option then
top.gg invites bots with no permissions because they don't want bots to nuke the verification center
You can't add a loop for every command
to let know user what your bot needs and limit your bot function if they want to
like they don't want a bot to be able to ban members, then they disallow it. same thing goes with other perms
good luck!
Who invites a bot without permission
^
If they invite a bot without permission
Then they can use text command
Bot works same
in that case
The welcome message is for them
Yeah last time if they resolve it
Hopefully
Else I'm tired 😴
Welp
we always give default perms for bots
thankyou zobs for this
According to the Discord documentation, there is a rate limit of 50 API calls/second for bots?
But what if you're using the HTTP interaction endpoint and respond within the 3 second threshold? I effectively do zero API calls, correct?
I don't actually call back into Discord.
I have 10 ppl using the bot
discordjs
My bad! It's just a coincidence that I'm talking about rate limits at the same time you are haha. I'm asking a question for others, not responding to yours 😄
My bad too 🫂😅
Good luck with yours! I hope you resolve it!
I don't have new users
Would like to test? As normal person
if you have time
I would normally, but I'm working on my bot at the moment before my daughter gets up 🙂
When she gets up, it's pretty much 0 free time from then on
daddy
problem
No problem just finish your work and play with her later 😁
i just checked from our log, the bot indeed did not have a working help command, if you need more detail, you can dm the reviewer and wait for the respond
No I mean video
In #support
With the commands you mentioned above
guys, is AuditLogCreated event really exists?
uh yes?
lmao sorry, i was having trouble with the intents before. i asked that because the bot in discord.net's server replied with this
thanks
Hi senior developers,
I am new here trying to learn. I have recently started using cogs to categorize my bot's commands.
In the attached image 1: I am showing how I am writing my help
In the attached image 2: I am showing how it gets displayed in discord
I know this is not the best way to do it. Because it says "No description given" for arguments. Google directed me here (https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=commands command#discord.app_commands.Command.description) - But there are no information about arguments as a parameter.
Can someone please help me with this?
Thanks in advance
❤️
Tickets are intended only for auction-related matters
why do people straight away ping everyone known to man
https://pastecode.io/s/w8f7fffs
Got any improvements on my current functions, and if using fucntions was a good idea?
An incomplete assortment of functions to make my life easier when building my economy system
shouldn't this be (< -> >=)
if (userAccount.lifesystem.economy.balance[accountType] >= amount)
userAccount.lifesystem.economy.balance[accountType] -= amount;
your current code will only deduct balance if the user doesn't at least have amount
your error handling could also make do with some work, opt in for more graceful errors like sending a message "user not found" instead of throwing an unhandled rejection
you also seem to surround your code with try {}, throw errors inside of the try {} and then in the catch {} you throw the error anyways? this defeats the point of using try catch
catch (err) {
throw new Error(err);
}
for a simple improvement i'd change this to something like
message.reply(`Error while executing command: ${err.toString()}`);
if you dont mind your error messages being exposed
i just have these to throw err because i havent set u p my logger yet, im going to have a logger func that sends an embed to my servers error logs webhook its just temp for now
also just for now ive changed it to return a json of code and a message and that gets habndled by the command itself, so if its successful itll return code 200 with message 'Success' And then my command will ahve its own case for each code and reply dependent on that
https://pastecode.io/s/7o9tyksp
Any improvements on this?
Schema to go inside my guildSchema
What exactly are you concerned about
profaanity
casinochips
also consider using prisma or drizzle
only real difference is the schemas
d.py uses docstrings for its default help command
I see no difference in using mongoose and a orm
Tbh an orm is sometimes more limiting
orms are usually worse
i have a question
i was thinking about making a code debugger for my bot which is powered by a trained neural network which when a user decides to opt in to mining crypto currency ingame and installs the miner the bot sends its errored codes aswell as the code debugger and the users computer simulates resolutions for ingame rewards, im assuming this is a no right?
is it against TOS for this kind of thing to exist?
probably
big sad
the best option would be to rent GPUS right
it kinda sucks
i was trying to think of game features that would be practical both ways
i can see whre it would be potentially dangerous though
i think installing software onto user's computers for a discord bot is a big nono
especially to be part of a mining botnet it seems
well
to the users it was going to mine ingame currency
but in reality it would be debugging my bots code
but yeah
if downloadable software is a TOS nono
im done for for that idea
fuck it was such a good idea too
idk if it is but it would be a massive red flag no matter what
yeah it would be a totally optional thing
if your code is buggy to the point of needing to make an ai to search through it
i think you have bigger problems
can a man with ideas and ambition not try
i too lazy to learn
my bot has turned on
and trained
you'd need to learn a lot to make that
with complex logic
already
and spawned cards
with 10 traits
and created simulations
without knowing to code
ty gpt
however
its still not good enough LOL
i have a few computers at home anyway
i guess ill mine away solutions to my code with a locally created solution
my code is 10k lines+
its hard for it to not hallucinate
and easy to misalign
accross the 12 cogs
im going to rewrite my bot in MOE structure
run by a neural network cluster
so i can be lazy
and watch it figure itself out
Thanks
So as long as I am using discord.py, I can never fix the argument description missing error?
Man the bait isn’t even believable anymore
You can, as I said, it uses docstrings
Sorry I misinterpreted. Thanks for confirmation.
In that case, I am defining arguments in my docstring. I assume the code will be able to read from there directly. But somehow it still throwing the error. Guess thats why I thought it is not allowed or something.
Hi
That's not how docstrings work
Thanks. I will work on fixing them.
the first fully AI debugger
it was a genuine idea i just came up with
but yeah
i see how its a bad idea
ive changed my strategy
to a self healing method
since now im running MOE
the experts now simulate fixes to missing inputs and reports the success rates of tested inputs to the admin
then asks the admin for permission to update the bot with the fix
??
what
it now does it on my computer
its to heal config alignments
because am trash
Are you training to be a hacker in the next fast and furious movie
i just want my discord bot to work
idk why im making it really intelligent
i guess i want it to also be popular
the MOE structure can now self heal all json data and missing configurations
kinda lit
now i can monkey mash code into it
and it should deal with it ok over time
since its neural networks
idk
its fun though
managed to make o1 mini think 3 minutes about a code before
i terminated the thinking because i couldnt be bothered waiting longer
Had to go through a lot of the commits of a lib I maintain just so I could add @since jsdoc tags. It'd have been a lot easier if the project didn't convert to TypeScript and also have its files purged once. On top of that, I wasn't a maintainer for as long as I was developing changes to the lib so the version actually exceeded what was on the origin by a lot and I had to drop from v6 all the way back down to v3. Had to to back and double check it wasn't before the version reset commit which just added up to about 4h of work for a relatively small commit :(
If you plan on working on a js lib, add your @since tags from the beginning
Wondering what perms does it need again for bot to lock threads
defo not manage channel right
I use my lib to check perms needed cuz all the hard work is done
MANAGE_CHANNELS and SEND_MESSAGES
So it dosent need the same perms as lock cmd?
couse if like for example lock cmd
you need MANAGE_ROLES
MANAGE_ROLES on top of MANAGE_CHANNELS is needed to edit permission overwrites for channels other than threads since threads are the only channels that can be locked
using the built in locked feature that is
thanks
-# Someone is getting a red luca message soon for not using built-in

Say hello to Saya
Would it not be best to only show the actual leaderboard entries?
Like if there is only 3 users show the 3 users and not show empty?
Yes
Gimmie an idea to do if the leaderboard has no data?
“No data”
is prisma /w psql good for 4-5k writes per min
prisma is pretty slow
if you didnt start anything yet I recommend drizzle
might be a bit harder to get started with since it abstracts less though
yeah i love drizzle
i just need them to add some sort of middleware feature and i'll use it for everything
loool this reads like someone who got dangerouse half knowledge talking about stuff they do not understand, but they think they understand it
Do you plan to add sms as 2fa?
Because if yes, id recommend not to since its considered insecure and you already provide passkeys and auth app as methods
If someone is SIM swapping you to break your 2fa to your docker containers then you have bigger problems
If someone cares enough to sim swap you then you have bigger problems
Ok
SS7 is insecure as people can re-route your texts and calls
For context, SS7 is the backing technology of SMS/All phone calls that are not VOIP
Stock went down
And asking if you wanna gacha your life saving incase it can go up
Most of the time they dont thou
Except major coin
-b 1239238884697702431 crypto scam id
killwish95#0 was successfully banned.
just checked its late
But why would you add an insecure method if you support better ones already?
And SIM swapping is not the only attack vector regarding SMS 2fa. They can be spoofed if a bad actor gets access to the phone network youre in
react with 🤷♀️ if you hope i fail
easiest? probably any fullstack js framework. nextjs, sveltekit etc
Do I need any special intents to direct message the installer of my discord app?
I'm looking to send a guide / reference the help server upon install through that mechanism
Sending a DM is never a good idea. Also I'm not sure if you are able to check who added your app to their account
For someone running out of storage on his PC (and not wanting to spend monthly on cloud), should I invest on a Synology NAS?
intent no, but you need IDENTITY scope
I was recommended the DS723+ Synology NAS; however, I'm thinking of purchasing a used Synology NAS for maybe cheaper?
ds723+ rocks especially with the network card upgrade, only bad thing about it is not as many drives as some other stuff in the same price range and 1 usb port. software is great but I guess it really depends on what youre gonna use it for, just plain storage?
Not only plain storage, but mostly weekly backup of my PC files, camera, phones, and more. (they are TBs so I needed a solution for it)
For the used Synology NAS, I found a Synology DS2415+ which has 12 bays and someone's selling it used for $435, is it worth it?
^ considering its retail price is in the thousands of dollars $ - so not sure... do I go with a new model (low no. of bays & good network card) or older model?
thats a bit old no? im not sure i havent really used their older products since i couldnt really afford them at the time lol
but no encoding or a lot of simultaneous reads and writes right? like are you trying to host it as a server?
if its just gonna be used as storrage you could probably get away with a terrastation
or linkstation i forgor my names
Yeah, a server pretty much; I wanna use it for what I mentioned previously - if not attempt to be able to access it in any country, too.
whoops ment to write plex server lol
I'm not entirely sure if it's built for multi-tasking and simultaneous reading/writing
Yeah, similar to Synology DS223j you mean?
like i have a regular ol NAS for just file storage, back ups of my pc, movies, and games. I could get away with a diy solution with open source stuff but I opted for Synology since is probably the most user friendly one ive used. The buffalo linkstation was fine but its "ups sync" thing didnt work and it died when my power went out
yeah thats great for just regular "cloud" storage
It's not efficient for multiple users accessing it, though; only personal use
Well, I found it on Dubizzle (sell old products site) and it's 8% the retail price, is it worth it?
ohh i see its not for personal use
Not entirely sure if its OS will be similar to the OS of the newly bought NAS (forgot the os system called)
Yeah, I have a whole fam who'd want to access it simultaneously (so DS223j won't fit the equation for now)
its fine but i wouldnt try to stream multiple video files with it
can u pair it with a nuc?
I have no idea what that is, though you should be able to?
not sure the exact definition, but just a sff pc that u can use to actual process stuff and just use synology as the nas.
Here's where I want your opinion in, do I go with the DS723+ Synology Model or the DS2415+?
ds723+ is gonna be quicker but only 2 bays holds it back compared to the older one
723+ is what i would do, its just quicker and more powerful per bay. the 2514 only plus is just more raw storage
but if a nuc/pc comes into the question then it would be a harder question to answer lol
Hmm, how does it differ? I hope I'm not missing something I'm supposed to understand prior
What is the role of the nuc/pc when purchasing a Synology NAS exactly?
Why? Sending a DM thanking someone for installing?
I’ve seen several of the larger bots do it
You do you, I advise against it
How to get your bot quarantined:
Step 1: Do that
Step 2: ggs, your bot is on the perfect way to get quarantined
how do you get a game-bot to spread by word of mouth?
many people told me that the only way to effectively grow your discord bot is by word of mouth especially if it is something niche
i have more than a year (16 months) that I released my bot and it has only ~340 servers.
and those I got mostly by ads (spent around 30$ for ads till now)
and also by the free 15$ credit top.gg used to give back in the day
Synology kinda mixes compute and storage together in their systems, in my humble opinion i think letting a nas be a nas and having a nuc handle all the computing would be the most cost effective option ($ to power). Now for most home users the computing solution in a synology nas is fine as they are 1-4 people households. When you go over 1gb/s r/w/network, or need to encode, virtualizes, or run any sort of service then off loading that off a nas's pretty weak hardware onto a stronger device
basically have the nuc/pc as your server and the nas as storage
Ohh, I see - well, we're only 4 people, I don't think we'd need a seperate device that handles computing
oh 4 people, man im thinking u got the entire extended family on ur plex server (i used to have that xd)
I think it's entirely up to me; better computing or more storage slots... both same price, one new & another used
😂 😂
Then how are the bigger bots authorized to do that? Where is this information your suggesting?
On Discord's docs:
There are no specific numbers, but suppose your bot gets large and popular, ggs on getting it quarantined
Users add bots to servers
Servers have channels
Your bot highly likely can send a message in on of those
> Send in one of those channels..
Perfect. Thanks for this reference!
@prime cliff you use OIDC with blazor right? How the hell do you get it to work. The docs on microsoft are so fucking confusing at best, and illegible at worst
Im tempted to make my own implementation, but i'd also rather not suffer through that
You mean with Discord oauth or your own user account stuff?
worth to note, in this scenario it is a valid DM, as it was triggered by an user action
it would be forbidden if for example you DM'ed multiple people on join, which is a no-no
even dming just the owner of the server is not ideal
they mention sending a dm to everyone because of how many dms it creates
which can be the same as dming hundreds of server owners during +- a minute timespan because they added your bot
though here again, discord never gives specific numbers for a reason
same if you dmed people randomly after executing a cmd for thanking them for using your bot
triggered by a user interaction, though will get your bot quarantined easily
I have my own auth server that uses OIDC
I cant seem to figure it out though with blazor

wdym
Im trying to connect the client together so they can login. Is that not a blazor specific thing?
No not a blazor specific thing
You need to use asp.net itself and/or controllers/service
keycloak gang
started developing VZS mid august this year... ill soon hit 500 installs... most of them before topgg launch... and with ad's i have gotten like 40 additional installs with ~10$
I have a Discord leaderboard bot which updates automatically every x minutes….. give me a time I can make the bot update messages to avoid hitting frequent rate limit
honestly, never
Have the users use the command when they want to see it
Discord doesn't really like self updating stats
I’ve implemented this
if discord tells me to wait 5 seconds you wait 5 seconds
if discord tells me to wait 10 seconds, you wait 10 seconds
if discord tells me to wait an hour, you wait an hour
Public
Best way to do this is to make use of discord's own features
For every server that uses that leaderboards will reduce your update bucket
Post the leaderboard to a follow channel (whatever they are called), and force send it to all servers following that channel
Cool thing is, your bot can also have the server follow this channel itself so it can be part of your setup
That has a limit too btw
Ah yeah
Leaderboards don't HAVE to be real time
And if you want a real time leaderboard make a cmd for it
Otherwise sucks to suck
A website*
That as well
But most people don't tend to make a website specifically for it
They prefer keeping it in one place either due to lack of skill, or the effort it takes
This is good.
Yea
Riding the rate limit isn't a good idea either
Its a quick way to keep getting rate limited and possibly perma banned from the api
Your goal is to not get rate limited, not to attempt to just barely hit it

Unless im reading that code wrong
It will keep trying, until its no longer rate limited
The ratelimits are there for a reason. You won't get punished for following the rate limits
in fact, they want you to follow it
Thats not what I mean
From my first glance it looks like they are just repeatedly hitting it, until a 429 is no longer given
The only times you get punished is for 4XX status codes for cloudflare bans
Oh then yes back off
Honestly I didn't really take a good look at the code so I might be wrong
Im currently sick so my brain wonky
It's ironic that Discord won't punish you yeah, but cloudflare hates 4xx errors
Discord doesnt need to
cause cloudflare handles it for them 
CF is pretty quick with it
That's why libs have internal buckets and ratelimiters to prevent reaching discord limit
Yep, a few dozens will get you banned for the day
This is incorrect. If you exceed 10,000 4XX responses within 10min, you get a cf ban for a day
Hm, I stand corrected then
huh, this is kinda weird? or am i just having skill issue
Question is, at which point is it 1
your IDE could be showing you what it was before / after something happened to WinnerCount
when i fetch the data from database. i can try track it down in case something is set after the fetch. so it is possible the IDE not always showing the “actual” data?
Sure
It could be showing something cached, or maybe old data
Check the db, is it 0 or 1?
it is 1 indeed
How is data being propegated?
i might’ve set another value which i may forget, ill look into it
the data passed from a file that called that function
a little bit messy yeah

how did it hit more than 500 installs that quickly?
I find it comes down to 3 main factors
- Useability - How well is your bot able to integrate into the server? Is it easy to use right off the bat, or is there a learning curve (remember most users dont want to spend hours learning how it works unless they are looking for a grindy bot)
- Target Demographic - Is it something people want to use and invite to their servers? If its not something people are looking for, they simply wont invite it
- UX/UI - Does it look good? Are the embeds properly colored, is the grammar proper, does it feel smooth to use with no hiccups?
Keep in mind this is just my opinion and not fact, but over the years this is what i've noticed (im also tired so everything might be gibberish)
I think this is fine, if it looks good, it's more addictive 😼
Honestly.... I dont know for sure. But I suspect that one of my action lead to it. I have played the bot in a very big server, just for a split second. But overall people tried it out once and then didnt do it again. Though I didnt look often for it, but it was so that i gained roughly 250 installs from that i suspect. Especially since my bot was banned on that server when i returned and tried it out again...
It was just a test... but apparently i guess it went well ':D
honestly, you could reduce the clutter a bit
too many icons, the "Click below to upgrade" text could be in the footer instead
and "Current upgrade level" can be shortened to "Current level" or "Upgrade level" so the number doesn't jump to the next line
Alright
i think third point is strongest point. 1st the bot does have a learning curve but not anything crazy. would argue its less than owo
target demographic is kinda hard as it may bea niche game
would you give me an opinion if i showed you the bot ?
not even necessary assuming there's a button that says upgrade or something
I'll be very honest, people are dumb 
there've been many cases where despite having a blatantly obvious button people were unable to figure it out
We don't see the button, but if it's a button that only has an emoji I can believe that someone could not understand it
Agreeeeeeeeeee 1000000000000000000000000000%
Also they need to learn to read
I'm not happy with you talking about people that way
The amount of Time i got dm
And my reply is just "read the screenshot you sent me" is insane
It all comes down to a great guide and simplified explanations
Guide on how to read?
Idk if they can even read the guide
Like I said, don't explain it too much detail and try to order everything well
🤨
Which bug bot is made with Discord.js
sounds simple, but in practice it's very complicated
those who work with sysdev know it very well, no matter how simple you make things, how clear you word stuff, how many "how-to" images you put
the. user. wont. read.
in fact 60% of my job is adding safeguards on our app to railroad the user into doing things correctly
Indeed you can expect every mistake to happend
Even thing you thought might be impossible
Oh
Now I get it
They skip the guides
We all kinda do that
Hi
Wsg
Gimmie a good hosting service
yeah no doubt my samsung tv is part of a botnet now
Reply to this message then I'll send you a link to it
🤨
-# replied
Hetzner, digital ocean, vultr, linode
If you dont care about spec and just wanna to host a bot, there is a shared hosting like sparked host (althou you dont have control like other service max mention)
Hetzner is overpriced?
I know a provider that is cheeper then all of those
But the service is so bad i cant say the name
That’s why they’re cheap then
Or they thing its a targeted roating
Bro they dont care about costumer data at all
So it’s not a realistic option
No as they can nuke ur server any time with no reason even thou u paid
With a reason of false flag
Rip my data was there
My code that the last backup was a week
Yea it definitely is
You used your production server as the only place for your code?
How
Yes at that time (i was a not smart back then)
Now i know i always make a backup before live
Learnt the lesson
I mean, its alright if you are looking for EU servers, but I def dont recommend it for anything beyond that
And also service provider blacklisted
Their US servers aren't quite up to standard for the price they are putting them at imo
Yeah it’s better in eu but I’m only using it for a US server rn and it’s perfectly fine
Better spec than digital ocean
Good network performance
I use contabo atm simply cause cheap & quick provision times
Beautiful web console
It serves its purpose for testing
I use ovh is it good on the list?
Don’t contabo oversell and have really bad network speeds
I would enjoy it tbh if they dont keep getting payment Issue and asking me to send id
I never used them. I heard about them a lottttt years ago for Minecraft servers
I am using those baremetal
It was for big servers
oh
then yea
The only thing I hate is ovh's commitment thing
its understandable
but like 
Like you have to commit to a year of paying?
yea or you pay everything outright
Outright
Ahhh yeah I couldn’t do that I change my mind too much
But i dont seem to have any issue with the server at all
+its the company money so...
do i really care about how its payed... Nah
I just wish for hetzner to provide managed databases
I just wish for hetzner to offer dedis in the US
Their server auctions are eu only?
I wish ovh provide on indonesia
Ik digital ocean and vultr have a lot of regions
They dont have on indonesia
The shitty one before that i said have thou
Unless they finaly added it
Also I use that bare metal for mc server too
Hopefully they’re looking to do more with US since they added support for usd
I mean usd support is now standard nows days
If your target audience is Europe though it’s fine
@prime cliff is a separate api even needed for blazor? I am looking at all this example code, and other peoples projects and they manage to do everything server side
Are there better ways to use "files" in python besides the default "read, write, append" method? Maybe a library python thing has something better I suppose.
It's just annoying when you have to use ALL 3 "r, w, a" in the same block of code and you have to close file, open it again, close, open it again, close, open again.
isn't it the cheapest?
oh
my friend uses ovh dedi, and it's great + cheap
@pearl trail @lyric mountain anyone knows why this warning happened?
idk why its spoilered
stupid discord
e is List<Enum> btw
Apparently valueOf is better here
how so?
parseLong returns a primitive long, so re-boxing happens. Whereas valueOf will return a long object.
For some reason this is better
I dont know too much myself, only what i've heard
thank you so much aaron! that fixed the problem ❤️
👍
Looks fine, what are you worried about
(List<Enum>)e
I mean why not, all you are doing is telling the compiler its type
Rather
why not make it take in a List<Enum>
Why does it have to be Object
if i replace Object with List<Enum> then

this.getNominal((List<Enum>)this.getCoins(), (List<Enum>)this.getCash()) doesn't work either
This is Java right
Ah right
hm
Can I see the definitions for the Coin and Cash enums?
I mean it doesn't really matter if it takes in Object afaik
Im more curious why its giving you problems
if Coin and Cash are both enums, then they are instances of Enum afaik
enum Coin {
_100,
_200,
_500,
_1000,
}
enum Cash {
_1000,
_2000,
_5000,
_10000,
_20000,
_50000,
_100000,
}
damn TIL java's final functions more like javascript's const than C++'s const
never knew that
Ah
So you can't assign a list of enum values aka a list of Coins to a base type
Compiler doesn't really know what that will end up being I think (if im understanding this correctly)
Honestly just take in an object and cast if need be
Its the easiest way, unless one of the bigger java brains like @wheat mesa or @lyric mountain can answer better
oh wait nvm it worked pog!
Hmm im not that familiar with java
Nodejs devs, what node version do you use?
v23.3.0
now that i think of it, i should update
I know someone personally on v12
Really what I'm going after is if a good chunk of devs still use something older than v14 because of global.fetch (my lib makes use of it and putting a dep on undici makes the min node v20)
nvm my beloved
bro avoids new nodejs versions like it's discord.js
I mean I forgot what node v my prod machine is on. I know it's at least > v19
v12 is reasonable though since that v saw considerable performance improvements to Promises
is making the minimum supported version node v20 a bad thing?
I personally am not against it, but I am not the extent of the users of the projects I maintain:
https://www.npmjs.com/package/lavacord
https://www.npmjs.com/package/snowtransfer
https://www.npmjs.com/package/cloudstorm
Are a few examples
Someone requested I support a min of v14 as that's when fetch was added
For snowtransfer
But I don't know if some people genuinely have projects that break on newer node versions. Like, some native libs dont have binaries for later node versions
Tim also fucks around and finds out with node internals changing
Some features might need api routes for example login/register (Password managers detect POST requests), oauth, being able to access full http context, setting cookies or you just want external api access for your project with your own api tokens.
Passkey/webauth needs routes too with a little bit of js function invoke
Uploading files too needs routes
I just use whichever nvm labels as LTS. I believe 22 rn?
there's a couple that are lts I think
Best language to code a heavy bot with?
The best language to write any bot will be the one you are most familiar with
any language will do honestly i would be more focused on a better ecosystem and library support
a better library will allow you to scale more easily
and basically any language can scale if you try hard enough
What’s a better library ?
Ohk
library that has full coverage of the discord API, frequently updated, etc
do note frequently updated != frequently introducing breaking changes (discord.js dig)
Which would you do?
Discord.js or Discord.py
we are entering highly opinionated territory
Let’s go
Let's start the war 🔥
Which would u do?
im not a fan of discord.js because of the frequent breaking changes but discord.py can be a little bit on the heavier side because of the nature of the python language
it depends on what tradeoffs youre willing to accept
every person you ask will give you a different answer
id recommend for you to choose one you think looks the best and cleanest
Lets not start a lang war
id only start one for the sake of starting an argument
heavy as in resource intensive (video/music/ai) or heavy as in a lot of servers?
Lots for server
for lots of servers you're better off using the discord api directly or writing your own minimalistic wrapper for it
discord.py and discord.js are not really good at handling lots of servers (100k+)
its not hard to use the discord api directly, you just need fetch, websocket (you dont even need websocket if you go full slash commands) and read their docs
@bitter granite
Enums can have inner values in Java
That would be a better way to handle it
oh they can be like Rust?
That way you’re not parsing out a string for it
Not necessarily exactly like rust but somewhat similar yes
public enum SomeEnum {
VALUE1("Value 1 Description"),
VALUE2("Value 2 Description");
private final String description;
SomeEnum(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
You can use a generic to avoid having to cast
That too
Using enum constants would be better than parsing too yeah
Java enums are more flexible than classical enums
Luckily the only external api I use is from my auth server
Realistically everything else can be done via blazor no?
All the external apis, I will end up using some other companies api so its not like I need to make it myself
I wasnt sure if using a generic was allowed, as this seems like something for their class
and some teachers are like "You can only use what you're taught"
Ah, it's a class assignment
I think so
This is an interesting take – not something I've thought about. Is it due to their caching mechanisms / opinionated things that make stuff easier but hard to manage at scale?
I use DiscordJS ... but purely for the embed builder / component builders. I .toJSON them for the HTTP interaction response
I could have built my own ... but they already had it available
It likely slows my responses by a few microseconds ... but meh. Could care less about that
The builders and such are probably the worst of it for discord.js
In terms of what? Performance?
discord.js uses a lot of memory, mainly because of what it does internally to make your life easier
When I say builder, I legit only mean the embed builder / action row builder components. That's it.
Which si fine for small bots and beginners, but once your bot starts scaling, a lot of that is no longer useful for you, and in turn actually limits you
My stack is
Discord -> AWS API Gateway -> EC2 -> Redis - > DynamoDB
When building out a bot, what are some of the better ways to influence people to come into your help server?
Bugs
lol
low key ... I think this is actually may problem; however, I don't think the answer would be to inject "fake" bugs 😄
Might not apply but I’ve got a few features that are only available inside the official server and it tends to attract users
best way is if your bot has issues LOL
occasional random issues will encourage people to join to ask then probably just stay
@quartz kindle is this still the case? i thought they did this whole revamp in an effort to avoid caching where possible
now that i think of it their initial strategy of caching everything was a horrible idea that was never going to work
Idk … I’d say the majority of discord bot cases it definitely worked
I agree on your sentiment though
i mean it will always work if you do a ram upgrade every year
but for smaller bots yeah doesnt matter much
scratch that every month*
not sure, its been over a year since i last played with it, but im pretty sure they still cache most things by default
for example many things are a requirement for all the permission checking methods
guild cache, channel cache, role cache
the only thing that can be disabled without affecting most core functions is users/members/messages cache (except the bots own user/member)
but afaik the default is to cache everything as it comes
except messages which are limited at 100 or 200 per channel
mostly caching yes
discordjs reminds me of a stock windows 11 installation
by default its extremely bloated and you have to do a ton of config and uninstallations to make it bearable
Whats the best way to silently refresh access tokens?
Isn't that the point of access tokens? To be silently refreshed
Right, but how do I silently refresh them
I know I can make a post request with the required things
Using the refresh token
I know
Let me fully explain
I am wondering the best way to silently refresh them using the expiration time. Do I use some type of cron job, a timeout, or something else? What if the process goes down, how do I resume the timer etc etc
I actually don't know the answer to this, I thought youre supposed to refresh them just whenever you send the next request after it's expired.
But I might be wrong
Well
IE check every time you plan to send a request
The point of silently refreshing them is to do so without the user's input
So it looks "seamless"
The user wouldn't know here either. Other than the extra delay to get a new token.
I guess yea
Which hopefully is quick
Hm yea I guess I could check every request
Yeah, since you need to poll the db anyway you should have the expiration time too.
So it's a simple now > expire check
Yea fair
I can check prior to every request to see if the token is expired, if so request a new, replace the old and continue with the new one
Should hopefully be a quick process
Im having to implement the entire Authentication library myself since I can't use the .NET one
😔
I assume that's how it's intended to be done. But I've never really looked that far into it
Hey man, im learning new shit every day to complete this project
some of which I dont even fully understand 💀
I have so much work to do its insane
😆 Welcome to development
Yea i've never taken on such a massive project
With such unfamiliar tech stacks
I just initalized a new blazor project, and its different from the last time
So now im confused on what to do
💀
Can't be as massive like my project currently? 🙃 having to do all the auth, 2fa, ton of UI/data with API support/clients, swagger, multiple oauth connections and LOTS OF FUN xD
You trying to clone Discord then 
👀
but we have a lot of work cut out for us.
Not only is there auth and UI, we have to handle payment processing, order fulfilment, tracking, emails, account management, and product management to name a few
and thats just the tip of the iceburg
Oh nice haha payment stuff is gonna be crazy have fun 🙂
Well we plan on using stripe so it won't be as bad
but still a pain to integrate all these technologies into one place
Do you have help from other people or?
We are a team of 2
I do the backend, they do the frontend
Since we are using blazor though, I do all the C# required stuff as well on the frontend

Well at least you don't have touch frontend that's a plus css wise
Though im not going to bother making a separate api for this project
We won't be exposing any api endpoints to the public so theres no need
I plan on doing it all server-side on the blazor project and have the client talk directly to it
It's pretty easy to do api stuff in asp.net and just make your own authorization attribute to lock it down
Yea
Right now im having to implement my own auth lib
since I can't really use the one provided by MS
or I can and I just dont know how
public class IsAuthenticatedAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
if (!filterContext.HttpContext.Request.Headers.ContainsKey("Authorization"))
{
filterContext.Result = controller.CustomStatus(401, "Authorization header is missing.");
return;
}
string AuthKey = filterContext.HttpContext.Request.Headers["Authorization"];
if (string.IsNullOrEmpty(AuthKey))
{
filterContext.Result = controller.CustomStatus(401, "Authorization header is empty.");
return;
}
//if (!_DB.Keys.TryGetValue(AuthKey, out ApiUser User))
//{
// filterContext.Result = controller.CustomStatus(401, "Your token is invalid, for support go to " + Config.Discord + " ");
// return;
//}
}
}```
🙂
Yea
My thing is
I use OIDC, but my requirements are strict
I only allow certain email domains when registering for an account, so I have to build my own login ui instead of using the hosted one so I can intercept the request to check the email before continuing.
So I can't use MS OpenIdConnect package, since im not using the auth server's hosted login page
That's easy with blazor you just do an EditForm with POST request and asp.net identity has built-in user management/login
How so?
Mind if you show me an example cause I couldn't find anyway to do something like that
Since I use Microsoft & Google OIDC
[HttpPost("/auth/login")]
public async Task<IActionResult> Login([FromForm] string email = "", [FromForm] string password = "", [FromForm] bool rememberMe = false)
{
if (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
return BadRequest("Invalid email or password.");
AuthUser? AuthUser = await _userManager.FindByEmailAsync(email);
if (AuthUser == null)
{
return BadRequest("Invalid email or password.");
}
Microsoft.AspNetCore.Identity.SignInResult Result = await _signInManager.PasswordSignInAsync(AuthUser, password, rememberMe, false);
if (!Result.Succeeded)
{
return BadRequest("Invalid email or password.");
}
return Ok();
}```

Im not sure that will work for me
The way my auth server works, is I can use OIDC methods to interact with it, and then it acts as a relay between Microsoft & Google
User Login -> Auth Server sends request to whatever they choose (MS or Google) -> Google or MS responds with the information on that account -> Auth Server logs them in saving that information -> Redirected back to page
You can intercept the oauth callback with the data given and check the email format too
The problem is, I can't
Well
I could, but I would end up having to do 3x the work to get the end result I want
It's better to just implement my own login UI and not use the provided auth package
It'd be less work in the long run
The problem is right
My auth server, when they login with an external identity provider, auto creates an account for them when they first login.
So I can't intercept the callback, because an account is already created
So you do have user accounts then with a password or?
No
Just oauth only ok
There is no password, it simply uses whatever external idp I provide, and they login with those accounts via oauth
but the problem as I stated, is when they first login, an account is created on my auth server.
So intercepting the callback wont work since an account would already be created
They'd continue to be able to login, so even if their email is bad, it wouldn't matter
That's why I have to just go through the flow myself https://zitadel.com/docs/guides/integrate/login-ui/external-login
My auth server allows me to do so by making a series of api calls
Something like
public void ConfigureAuth(IAppBuilder app)
{
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
ClientId = _clientId,
ClientSecret = _clientSecret,
Authority = _authority,
RedirectUri = _redirectUri,
ResponseType = OpenIdConnectResponseType.CodeIdToken,
Scope = OpenIdConnectScope.OpenIdProfile,
TokenValidationParameters = new TokenValidationParameters { NameClaimType = "name" },
Notifications = new OpenIdConnectAuthenticationNotifications
{
AuthorizationCodeReceived = async n =>
{
// Exchange code for access and ID tokens
var tokenClient = new TokenClient($"{_authority}/v1/token", _clientId, _clientSecret);
var tokenResponse = await tokenClient.RequestAuthorizationCodeAsync(n.Code, _redirectUri);
if (tokenResponse.IsError)
{
throw new Exception(tokenResponse.Error);
}
var userInfoClient = new UserInfoClient($"{_authority}/v1/userinfo");
var userInfoResponse = await userInfoClient.GetAsync(tokenResponse.AccessToken);
var claims = new List<Claim>(userInfoResponse.Claims)
{
new Claim("id_token", tokenResponse.IdentityToken),
new Claim("access_token", tokenResponse.AccessToken)
};
n.AuthenticationTicket.Identity.AddClaims(claims);
},
},
});
}
}```
You can check the email in AuthorizationCodeReceived and redirect to an error page or exception.
Time to do my oauth stuff 🙂 bye
Is this a service?
I've not seen ConfigureAuth before
That's just a normal C# function that you run
You can split up your service configs into different classes based on what you're doing instead of all in 1 class
🙂 just pass to the service collection into the function to build
Oh cool
I never did that before
I ought to do that
👍
Thank you for the advice
I will look into this more
I assume you call this in your Program.cs file right?
Yea
I can remove discordjs entirely from my discord application if I built the one piece of it that I use: embed / action row builders. Do any of you know of a typescript library that can help with this? I can always build my own / reference the discord documentation regarding the JSON ... but hoping to use something off the shelf
Is there a reason you're using the builders over just the json?
Personally I'd rather just the JSON
Convenience purely
I just like the pattern / easy to use
@discordjs/builders is its own lib
I also like the typing DiscordJS provides
But yeah, I'll check out that library!
For reference, this is what I'm using in one of my imports:
import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
ComponentType,
InteractionContextType,
InteractionResponseType,
InteractionType,
type APIInteraction,
type APIInteractionResponse,
type APIUser,
} from "discord.js";
Some of them appear to be from discord's own library ... so I could maybe switch those out.
All of those exports are mostly from discord-api-types asides from the builders
djs just re-exports those types
Yeah, that's what I figured as well.
Yippepe my bot got approved
Good job
@prime cliff Thank you so much kind sir, your advice helped me find a solution to my problem without breaking my back. I was able to think of a way, while still crude works well enough
java aah design
java convention is to use builders for everything which i find to be so much boilerplate
want to add a new field?
be ready to edit at least 4-5 files
I can live without the insane compiled module import strings size in my heap
The ☕ experience
I like the boilerplate though
im only ok with boilerplate if it results in faster code
i find it very difficult to accept my 2 line simple code if it can run 0.1x faster if i add lots of overcomplicated code
builders are much nicer when you're programmatically constructing things
yeah it's a pain to initially write out but they're basically necessary in statically typed languages
anyone have experienced slow intellisense on jetbrains ide? it's kinda annoying
Running low on wam
wam?
Ram
Whats tbe rate limit message ammount again?
What message rate limit are you referring to?
If you mean sending a message in a normal channel, it's 5 messages per 5 seconds
Yes thanks
a lot of languages have macro/compile time support so you don't need to do this stuff and can easily define dynamic style structures, I'm not sure if java supports these but I wouldn't be surprised if it didn't because they have their own disadvantages
they can make code unpredictable to people from the outside and encourage complex unmaintainable patterns
how would macros help with that?
JSON is supported by most if not all languages which has no set structure
What does type safety matter if you're the one sending the JSON
Btw, I meant to say this sooner, but never hard code rate limits since they can change at any time
Hello, im a payment gateway provider... PayPal,square,authorise
hi payment gateway provider
I'm a payment gateway provider...I provider account like PayPal, square, authorise net....etc
"i provider account"
written with google translate?
Even google translate couldn't screw it up like that
Looks like a bot or scam artists no offense
yup
Yeah
lmao, it uses the ram as it's memory too right?
How to show a user's activity in discord.js
why did verifying bots become so easy
just verified all my bots in like 10min
even private ones
Because Discord probably tried to make it not so "special"
They want everyone to be able to create a bot and verify/monetize it because then they can also make money from it
This is probably the only way they make any money from someone creating bots
I see
Such a system sounds better than asking for money to use an API
yeah
or maybe the backlog for the old verification system was so large they said fuck it
Its likely a mix of the two
They saw how huge the backlog was, but they couldn't justify just letting everyone verify so easily so they found another reason as well

Notice how strange it was the monetization system came into play right about when they said fuck it everyone can verify
Because discord wants more money....
I can’t because I don’t have no license 🥲
56h 😩
All good now hell yea https://devspace.fluxpoint.dev/user/account
Cool
I once worked for like 4 hours straight
you could say that for every aspect of your codebase then
type safety makes your code easier to reason about and prevents an entire class of issues at compile time
Trust me, my code bases are as type safe as TypeScript lets me be. But the web isn't type safe
😱
Believe it or not i once worked for 30m straight with no breaks
yeah sadly, causes 50% 16gb ram usage off the bat with nothing open
thought 16gb was supposed to be good in 2024
16gb is quickly becoming the minimum 😔
unless you use linux 
yeah in linux 16gb is usually the 32gb for windows
{"user":{"297712327216594946":"mercatus.gg"}}
How is this not a dictionary C#
well a dictionary inside a dictionary
First key : User
First Value : Dictionary with key stringified number, with value string
or am I wrong?
JsonSerializationException: Error converting value "{"user":{"297712327216594946":"mercatus.gg"}}" to type 'System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]]'. Path 'urn:zitadel:iam:org:project:297838639419752450:roles', line 1, position 482.
Nvm I figured it out
Were you trying to convert an actual string to dictionary 🙃
@quartz kindle would you happen to know how to pass readable streams into FormData? There used to be a way to do it, but recent versions of undici more strictly check if something includes something in the prototype chain https://stackoverflow.com/questions/75793118/streaming-multipart-form-data-request-with-native-fetch-in-node-js/75795888#75795888
I have no idea tbh
Because this used to work, but now ig it doesnt anymore
i tried a while go and in the end i gave up lol
i went for reading the stream into a blob and then passing the blob into formdata
but for large files yeah, the formdata class itself is very limited and badly implemented in node
you could always use a better formdata lib
Man... That sucks. Though I guess it wont be THAT big of a deal as the file upload limit on Discord is being reduced to 10MB
I thought about making my own FormData lib
Since I know how to create the body and headers
iirc fetch supports a ReadableStream as the body, so I can just circumvent that
it should
but they are doing all this weird differentiation between node streams and web streams
they wanna copy everything browsers offer, but then they make it incompatible with node's own version of things
It's not hard to convert between them. Readable.fromWeb and Readable.toWeb
stream.Readable
yeah but its messy
has anyone ever encountered ...~ files in the project directory? with jetbrains ide? it happened to me both in goland and webstorm
it's annoying
i didnt find the solution on google
They are temp files
In case the IDE crashes or something it has a place to go back to so you dont lose your work (if you didnt save)
Depends on you
like you got bunch of files already, and it doubles
If you dont like it you can turn it off afaik
Once the IDE closes they should be deleted though
because local history does exists, so i don't really bother about the temp file
Ah
Once you save that file it gets deleted
So pages.tsx is saved, pages.tsx~ is deleted
npnp
Does node not support chunked uploading or compression or something?
does anyone know what causes this
its a simple for loop
the array has 4 functions, not much at all 😭
it does, but its complicated
node basically has 2 different sets of tools for the same things, one is node's own stuff and the others is browser stuff
and they are not compatible with each other, so you need to convert one into another and vice versa
At that point just create an asp.net api to handle uploads
chunked uploading by default with compression support and better form and data handling
hehe
The thing is that you were able to trick undici (the fetch impl in nodejs) into thinking you were passing it a File instance and supply a custom stream function, but they since patched it with more strict prototype chain checks. Now you'd effectively have to re-make the FormData class and then build the body and headers yourself. Luckily, undici supports supplying a ReadableStream to the BodyInit so if someone makes a better FormData class with a similar API then I would actually use that, but for what I am doing (Discord REST lib), I don't need to worry about it too much since the upload limit for bots and webhooks will be 10MB in Jan
I tried to do this, but I got stuck on working on support for iteration of the class since thats how undici gets the form fields. If you were to do a for (const [name, value] of form) … that would work as it has its own [Symbol.iterator]
I got stuck because I wanted to extend the undici FormData class so that undici would accept it and I wont need to build the body myself, but you can't get a reference to the internal state of the undici form without iterating over the form, but if you implement your own [Symbol.iterator] and try to get the super state, you'll just hit a loop and reach the max call stack size.
Actually. I think I just figured out how to do it, but idk if it will work since the [Symbol.iterator] is defined as a property and I think only methods are stored on the super
@quartz kindle Can you confirm?
Hey sorry
Can I have to api docs to configure vote rewards
?
(Python if available )
Apu should be #topgg-api
ahh cheers mate
auxiliary power unit?
no idea, never looked into it
but are you trying to extend node's built in FormData class?
or are you actually importing FormData from undici as an external lib?
afaik node built ins have more restrictions, even though they are the same as undici under the hood
undici
yeah i dont see what could be done, you'd just need to have your subclass wrap the original iterator with some method
do you want to like intercept the iterator when undici fetch uses it?
Yeah. Though I just realized I could do UndiciFormData.prototype.[Symbol.iterator] and then call it
Because I need to get the super state
Yes :)
replace object with function \🧌
replace function with yourmom
replace yourmom with yourdad
That leads to security issues though imo if you can literally just modify everything 🙃 which is why browser bookmark malware and malware extensions exist to inject js
I mean, extensions are apps… if you don’t trust them, don’t install them.
"run everything with windows administrator if you trust them" is basically what you're saying 
I have no idea what is going on here
<div class="w-full h-full">
<div class="flex flex-column text-center gap-4 w-full h-96">
<h1>This should be above</h1>
<p>This should be below</p>
</div>
</div>
Is this not how flex works???
Examining with inspect element, h1 and p are assuming its paren'ts height as well
Are you using tailwind?
yea
was gonna say
😭
pretty sure that's too long for a tailwind class name as common as that
ahem
yup
that worked
ignore me
:)
I am used to using bootstrap apparently
So how would I have text to the left and an image to the right if im using flex-col?
I can't mix row and col no?
I would recommend using grid for layout, flex for content
Whats the difference?
I'm not a super good-at-frontend person, but that's generally a good style to follow as far as I have learned
Grid is better at making layouts, flex is better at centering and spacing content
You can mix the two
productive work day today
I did more than that but gitlab is refusing to show it for some reason
oh god damn I did a lot, that was page 1 out of 5
thereeee we go
Damn
My current codebase is messy asf
Especially since im still not fully used to blazor
me when i accidentally commit my .vs folder in work
Except that this is a rare occasion where I actually did edit 96 files
Just removed the discord.js dependency 😎
Used discord-api-types and @discordjs/builders instead
I forgot to add a perms check on the main command actually I did add it just didn't add the right permissions lol
@bitter granite sorry for the ping, quick question, upon denial do I have to fully resubmit the whole bot profile or is there an option to resubmit without having to go through the whole form process?
-addbot
@remote cargo
Adding Your Bot To Top.gg
So you want to list your bot on Top.gg? We have a support article to help guide you through the process! If you need more help please contact us in #support!
Click here to follow our guide!
you need to add again if you have fix the issue
Thanks! I just wanted to double check before I rewrote the description.
So im trying to submit my discord bot but topgg is telling me its too new and not registered to discords api, but I made the bot a month ago and have been using it. Is it because its only a user installable application?
we dont accept bot that only have user install
since we cant invite them to test
Does anyone here use the monetization features Discord provides? Ie. one-time purchase SKUs?
I have implemented one-time purchaseables and the subscription. Fortunately, I've had customers purchase both, but I only see the subscription revenue and not the one-time purchases.
I'm curious if there's a lag on those metrics. I would contact official discord support, but my request would likely get lost in the sauce there. I want to exhaust my resources first 🙂
even tho i got access control headers on the preflight, i'm still blocked with CORS??????
ok now i got it working to send the POST data, but i'm now not getting the response, but still "CORS Error" even tho it's 200 OK
sorry for the trouble, i fixed it
At which point of spaghetti code is it worth the hassle of refactoring everything 
Im at 10k loc rn, im not a beginner programmer but this is my first discord bot. I think after a refactor with my current experience id be at ~6k 
you never stop refactoring
:^)
😂 well yeah, i guess i should’ve worded it as "start over"
hello, does this mean it's out of bigint range too?
oooo, i need to stringify it first before putting into BigInt
ah, but i can't do that with data not from variable right? like fetching from api
correct
i see, thanks for the information
Does discord require ALL commands use slash commands to use their search thingy or only some?
they want all commands to be registered and used as slash commands for you to get verified
Darn it.
I'm trying to add in BOTH '?' prefix and '/slash' command.
Does one have to be listed as client = this and another bot = this? Cause using client = and client2 = don't work.
you would need the message intent which would allow you read to message contents and see the prefix but discord only gives it to you for certain use cases and prefixed commands isnt one of them
I literally can't use ALL slash commands ONLY. I can only use prefix or mixture of the two since I am completely oblivious on how to make slash commands work with "cog files".

