#development
1 messages · Page 1878 of 1
Where…
^
Hey @rose warren
aaaaand he did it again
nineth
Tf what
What I do
u don't need to fill any of those
Its my first time in développe
development doesn't start there tho
Those aren’t required
À music bot
Oh no
ha, forget about it
I want to learn in bots
you ain't going too far with music stuff anymore
What are you going to get the music bot from Spotify or YouTube?
What you mean
not only it is one of the HARDEST things to do but now you're basically running undercover
Message above
Can you help me to create a bot plz
im bored what should i curse do in react
Never have I been so offended by something I 100% agree with
You do bot sécurité ¡¡
imma make a box shadow generator
all projects have at least one unknown indian guy doing coding videos on yt
Have you ever watched Kitboga?
first steps
@earnest phoenix make something that would not make sense
Kitboga is a Twitch streamer who calls up tech support scams and does improv to waste their time. It's really funny. Some of the calls last for hours over multiple days and get totally crazy. You can look him up on YouTube.
had too much practice with that
KuuHaKu knows why
Hmm, sound funny... I will take a look 😆
Scaming scammers sounds funny tho
Like I got scammed with an invalid Windows server key a few minutes ago... Payed standard edition and the key can be activated for datacenter only. I mean wtf
the real question is why no archlinux
Because the software requires Windows
this is the best one i've ever seen https://www.youtube.com/watch?v=1-Vdez5BTvQ
just finished installing ghostspectre's version of windows 10 on another pc
looking dope af
no defender, no store, no updates
500mb ram usage
who's ghostspectre
I agree but I have to say the server versions are quite okay
why would you run windows on a server
some japanese dude who makes stripped down versions of windows
Why else should I choose Windows as server...
need some warez?
:^)
I wonder dude, they already sent me a new key
I mean 9,99 isn't a bad price at all

Compared to like.. idk 189
If you think this is funny you'll love Kitboga
i did watch him
but nothing ever came close to that
Lol
Most servers in my repertuar are running Ubuntu... so shut up 
Isn't a arch an OS for clients?
nop
i mean
its stupidly barebones
it doesnt even have a desktop when you install it as a client
switch to arch if you want the love of your life to kiss you uwuwhdsu89rhe insert copypasta text here
Never saw any supported server image by any provider I rented servers
well, its the kind of thing you only use if you know what you're doing
therefore there is no support for it
What's the difference to any other Linux distro?
copypasta?
Active: Jax enters Evasion, a defensive stance, for up to 2 seconds, causing all basic attacks against him to miss. Jax also takes 25% reduced damage from all area of effect abilities. After 1 second, Jax can reactivate to end it immediately.
At the end of the duration, Jax stuns all nearby enemies for 1 second and deals physical damage to them, increased by 20% for each attack dodged, up to a 100% increase.
it has nothing, you have to install everything you need
all the basic linux tools
etc
i want to write a new line into a textarea using js, the problem is it doesn't work?
when i do: js textareaelem.innerText = 'blahblah\nnewline';
it will just write 'blahblah\nnewline' into the textarea instead of \n making a new line.
fuck jax
rrrrrrright through the counterstrike!
the arab version is better
Hmm sounds a lite distro without any installed packages...
More work than needed compared to a lite Ubuntu install without any software (other than SSH maybe)
Sounds even more complicated to get the right network drivers, etc. if you wanna run it as server.
Not any provider supports a KVM like console to manage your server if you fuck up your CLI.
why
wtf
there's also amoguslang
oh hell no
among us (language)
that should not exist
fuckjs
hm, is it possible writing a bot entirely in sql?
like, sql is a turing complete lang isnt it?
Why not making things even more complicated than needed lol
won't it be vulnerable to sql injection tho?
from SO:
It turns out that SQL can be Turing Complete even without a true 'scripting' extension such as PL/SQL or PSM (which are designed to be true programming languages, so that's kinda cheating).
In this set of slides Andrew Gierth proves that with CTE and Windowing SQL is Turing Complete, by constructing a cyclic tag system, which has been proved to be Turing Complete. The CTE feature is the important part however -- it allows you to create named sub-expressions that can refer to themselves, and thereby recursively solve problems.
The interesting thing to note is that CTE was not really added to turn SQL into a programming language -- just to turn a declarative querying language into a more powerful declarative querying language. Sort of like in C++, whose templates turned out to be Turing complete even though they weren't intended to create a meta programming language.
Oh, the Mandelbrot set in SQL example is very impressive, as well :)
https://github.com/pramsey/pgsql-http heeee boy
That’s it. I’m making a bot on msDOS
I’m confused why the bot isn’t recovering any reactions. How would I fix this?
It returns 0 reactions
do you have the reaction intent enabled on client?
Why in the world would anybody need that omg
Do you also use a calculator with letters only?
i have a question, do u still need a webhook to send something like this even through an actual bot? or can it be done just through the bot
both can send embeds
i know, but do i need to have a webhook to send it through a bot
cuz i dont like webhooks
...both webhooks and bots can send embeds

if you mean the vote webhook, thats not a discord webhook
and yes you need it to receive votes
Frick i don’t. Thx
isn't a bot technically a webhook tho?
a webhook is more like a callback over the internet
the webhook tells some other process that something has happened, by sending data over the internet
yes I know
so a bot isn't a webhook, but it can utilise webhooks
but yeah many bots are moving over to slash commands so they can just receive webhooks from discord and respond to those
it can be if you only use slash commands and nothing else
Reject slash commands, embrace prefix commands.
i cant think of a single database that isnt sql or nosql, besides json (which is not supposed to be used as a database) lmao, does anyone know a database that doesnt use sql or nosql?
Reject slash commands, embrace prefix commands.
Reject slash commands, embrace prefix commands.
Do you need a non sql database?
i dont- i just want to know if they exist
Graph databases (such as Neo4J)
discord-db
discord-db is almost an abuse of discord
pretty sure it can get u banned no?
Yeah
I'm just kidding guys :^)
Time series databases typically isn't nosql or sql right?
Don't scare me like that
dba.connect(process.env.mongo, {
useUnifiedTopology : true,
useNewUrlParser: true,
useFindAndModify: false
})
(node:1533) UnhandledPromiseRejectionWarning: MongoParseError: mongodb+srv URI cannot have port number
well, techinally... discord stores messages with cassandra which is a nosql db
i think thats nosql
well, yep cant think of a single db that isnt sql or nosql (besides json) lmao
So I've got an interesting question.
Currently I'm planning on self hosting a bot.
Do you think a 20mbit/s upload connection would be a limiting factor for a bot that only deal with messages?
I'm kinda doing a new chat filtering algo that's better than direct string matches.
Medium meaning about how many server?
Well, that exceed my expectations. That's nice to know.
kekw
if you are running mee6 though- and have a web dashboard- maybe thats a bad idea
if you are running a website on your bot, make sure to have ddos prot
My new chat filter algo can handle processing upwards of 30,000 messages per second. :D
I can't wait to put it to the test and light up all the cores on my server.
you can proxy the web under stuff like cloudflare
upload is never an issue for most web apps
^
unless you're dealing with heavy shit like 3d renderers and uploading giga files
Imagine using a web dashboard.

Wouldn't be me. I take the KISS philosophy to heart.
Keep it Simple Stupid.
imagine using phpmyadmin
I'm thinking about it, and its pretty nice. No site to worry about
cant be me
discord is just a fancy terminal
it's just a website
if you use phpmyadmin what are you doing
bots are just apt softwares
It's just irc
discord is just a site in a exe
If you use php, what are you doing with your life
it's called electronjs™️
i heard php was easy to load balance
but you can use cf workers or something to host a nodejs process in cf i heard
You can
Cloudflare workers are great when you have a usecase for them
100k free requests daily, $5 for every 10 million after
And the workers scale practically automagically
cloud bad >:c
Invest 10's of thousands of dollars into your own server infrastructure
:)
Aparently discord uses cf workers?
ngl 10 mil for $5/m seems a little but its a lot
let data = tickets.findOneAndUpdate({
Percentage: args[1],
});
data.save();```
okay so basically i want to update the `Percentage` string in my DB, I already found the ticket Id and it just needs to update the percentage of it, so how would i do so
mongob ,sql,others

just a tip, don't store the percentage but a current/max relation
except if percentage is integer, then it's fine
store everything as binary blobs
yeah percentage is an integer
wait so how exactly do i update a specific value
tickets.update doesnt work, or the one above
the one above will probably search a value by Percentage
Are you using a library to abstract away the database calls?
that's mongo
oh lmao.
I've never seen mongo
welcome to nosql shittery
First parameter is what your looking for, second is what you want to update it to
ohh alright
Should be the same with mongooose
if you ever used an ORM mongo basically feels the same
I've only written SQL statements by hand
Well honestly, I am looking for a Percentage associated with a ticket ID
https://mongoosejs.com/docs/tutorials/findoneandupdate.html
Yeah same in mongoose
You can do that
So I just want that percentage to change to whatever I supply
const casea = await tickets.findOne({ "TicketID": args[0] }); ```
You can do it all in one call
case.findOneAndUpdate("Percentage", args[1])
something like this? idk
well case.findOneAndUpdate wouldnt work actually
ooh wait i think ik what to do one sec
Tickets.fineoneandupdate(filter, update)
Filter would be the filter you supplied here, update would be
{Percentage: args[1]}
I didn't do caps dumb mobile
It also returns a promise with the updated doc if you need it in code
Has anyone gotten
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 2
While trying to connect a remote server to the db server?
Tried like 50,000 things and nothing is changing this error.
After 8 minutes? Or instantly
instantly
but we have another server also separate that can connect just fine
i dont understand
mysql is known for having ridiculous issues
this is a fresh ubuntu vps
especially with connections
Yeah main reason I moved everything off mysql
e
postgres is just a better mysql in every subject
need to get my site up on this new dedi so we stop getting discord rate limit banned 
but cant connect to mysql
A few good suggestions
i believe we were binded to 0.0.0.0 but right now its binded to the servers ip from a SO suggestion
will get it back to 0.0.0.0
btw, if you really want to continue with mysql, NEVER use VARCHAR(255)
use VARCHAR(191)
we do
Oh? What
okay so i also have this
const casea = await tickets.findOne({ "TicketID": args[0] });
how would i now make it send the percentage
mysql has a stupid issue with varchar fields of length 255
yeah lol
it basically corrupts the whole row, disconnects clients, ignore requests, etc
wait maybe its just casea.Percentage, nvm
I always have to set this in my applications boot
The old or the new? If you want the new use this @sterile lantern
otherwise I get errors
The findoneandupdate returns a promise with the new doc
I don't know if this helps
Hmm alr
but from my site I get these 2 errors:
SQLSTATE[HY000] [2006] MySQL server has gone away
(PDOException(code: 0): Packets out of order. Expected 0 received 1. Packet size=101
there are a lot of topics about that, just give it a search
it's guaranteed to error if you use surrogate pairs inside the string (as in, newer emojis)
and randomly errors with common data
it used to give me so much headache trying to find why stuff were failling seemingly at random
okay let's say i have like 5 different tickets, how would i place them all in an embed with only the Ticket ID and User ID (there's also guild ID and other stuff associated with the data), and no, it isn't an array
what lib are you using for bots?
Then map them and call the .TicketID and .UserID when you do so?
Lib doesn't matter in this situation
It doesn't? I thought he was asking about placing them in an embed.
No
well embed part i already have
if(err) throw err;
if(data.length == 0) ```
i assume it would be like
data.map(d => d.TicketID + ' ' + d.userID).join(' ')
data.map isn't a function
okay but
if(data) {
let array = data.map(d => d.TicketID + ' ' + d.UserID).join(' ')
let on = 0;
let content = "";
for (let v of array) {
on++;
if (on == 4) {
on = 0;
let abc = new Discord.MessageEmbed()
.setTitle(`Order Logs`)
.setDescription(
content
)
.setColor("BLUE")
.setFooter("Order Logs")
message.channel.send(abc)
} else {
content = content + v + "\n";
}
}```
i want it so like
if there are 5+ orders,
make another embed and send
what the
Why are you doing a for loop
Remove the .join() if your going to do that
o
Does mongoose return an object if it only finds one?
Will probably need to check for that too. The projection says it can return an object
I usually check if its a array and set it if not anyways
well now its not sending anything
if(!data.isArray()) data = [data]
And set it to a let
if you wanna check in case
Did you set data?
What are you doing in that for loop
oh that makes a lotmore sense
also im trying to make it
so if there are 4 values
like 4 tickets
then make a new embed, and put another 4
etc
I suggest just making a pagination
Can just do array.length for those checks
Tbh bots can now send 10 embeds right? Just always do one ticket per embed
in a single message?
eh id rather not
multiple embeds would b better
oh yeah forgot abt that
k wait so
let array = data.map(d => "Order ID: #" + d.TicketID + '\nUser: <@' + d.UserID + `>`)```
i edited it to this
now in the array if there are 4 of these values, make a new embed
or 5
well tbh
i think i can do 10 values
since the embed limit is like 2k characters i think
If you want to do multiple embeds, just map into embeds
One for each? Or just entirely depending?
depending
one for each would be kinda weird
actually
yeah one for each would work i guess
You can always group into seperate with some checks, or whatever way you want
hmm so how would i just make it send each order in an embed
rn its just
let abc = new Discord.MessageEmbed()
.setTitle(`Order Logs`)
.setDescription(
array
)
.setColor("BLUE")
.setFooter("Order Logs")
message.channel.send(abc)
```
put them all in fields
With your map you make each one its own embed, then send them in the same message
Direct support was added awhile back for multiple embeds
Was in webhooks forever, finally bots can now too
Virtual Private Corn?

Awh I want some vpc
Maybe some rpc too, real private corn
Korn?
let array = data.map(d => return new Discord.MessageEmbed()
.setTitle(`order logs`)
.addField(thing, d.property)
)
Then just {embeds: array} for what your sending
if(data) {
let array = data.map(d =>
"**__Order ID: #__**" + d.TicketID + '\n**__User__**: <@' + d.UserID + `>\n`
)
let string = "";
let on = 0
for(let d of array) {
on++;
if(on == 1) {
on = 0;
let abc = new Discord.MessageEmbed()
.setTitle(`Order Logs`)
.setDescription(
string
)
.setColor("BLUE")
.setFooter("Order Logs")
message.channel.send(abc)
} else {
string = string + d + "\n";
}
}```
this works
but it doesnt give
the description
like it sends two embeds without descriptions
Because you’re never giving string a value other than an empty string
like theres two orders and it sends two embeds, which its supposed to do
o
well im not too sure how to make string just one singular order
or well actually 5 orders
one singular order was just testing
so i want 5 orders to be the string
in the order that its mapped in
let string = "";
Your sending them as seperate messages which you probably don't want. Will get awfully close to the ratelimit
are rate limits global or per guild?
Global
oof
i have that?
120 req per second iirc
huh
ill just have each embed send 3-4 seconds apart
that'll be fine right
considering popular bots send like 3 messages at once im pretty sure that sfine
Sure, but if the option exists to do one message why not use it
alr
so how would i have
5 out of x orders
be the string content
like maximum 5
so if there's 3 orders, string would be the 3 orders
So you want all of them to show in the description?
Then just use array.join() in the description
no no, not all of them
only 5 max per embed
let string = "";
let on = 0
for(let d of array) {
on++;
if(on == 5) {
on = 0;```
here it resets the on value if it hits 5
and once it hits 5, it creates an embed of those 5 orders
but the description isnt working for some reason
Slice can chunk the array then.
https://stackoverflow.com/a/8495740
Temporary would then be joined and used as your description
Yep, youll probably want to join by newline or whatever you want
alr
if(data) {
let array = data.map(d =>
"**__Order ID: #__**" + d.TicketID + '\n**__User__**: <@' + d.UserID + `>\n`
)
var i,j,temporary,chunk = 1;
for (i = 0,j = array.length; i < j; i += chunk) {
temporary = array.slice(i, i + chunk);
}
let abc = new Discord.MessageEmbed()
.setTitle(`Order Logs`)
.setDescription(
temporary.join('\n')
)
.setColor("BLUE")
.setFooter("Order Logs")
message.channel.send(abc)
}
})
}
}```
i only want 2 orders per embed
(as an example)
rn its only sending one
like as soon as there are 2 orders, split it and send to another embed
You are chunking by one, you'll want to set that to 5
why would i set it to 5 though
how does this code look for protecting against rate limiting? js let apiCallCount = 0; const MAX_CALLS = 120; const queue = []; setInterval(() => { apiCallCount = 0; while (queue.length && apiCallCount <= MAX_CALLS) { queue.shift()(); apiCallCount++; } }, 60000); const enqueue = (apiCall) => { if (apiCallCount <= MAX_CALLS) { apiCall(); apiCallCount++; } else { queue.push(apiCall); } } module.exports = enqueue;
You want 5 per embed. Each chunk is one embed
You want one embed right? 5 values per embed, you only have 2
No i want multiple embeds
Confusion
Okay wait so I added 2 more values into the database
4 values in DB
I want 2 values per embed
So rn it should send 2 embeds
But it only sent one embed
Never knew that existed lmao
I'll hop on my pc in a sec, its hard to see what's going on
I want multiple embeds, with a max # of orders in each page
This max I want to be 2
There are 4 orders
Your sending outside the loop
Didn’t know it either, just took a look into the docs, too 
Honestly didn't see it either
im using lambda hosting so this probably wont work. lambdas shut down after 15 minutes max. so if the queue fills up it will just be lost when the lambda shuts down
is every discord api endpoint rate limited separately?
setTimeout(async() => {
message.channel.send(abc)
}, 5000);```
idk if im doing this wrong but its still sending both embeds twice 😩
it waits 5 seconds before sending, but sends both at the same time
i want each 5 sec apart
Don't think so
Many are other than global
i'd think things like creating voice channels or sending DMs would be more limited than responding to a slash command
return await axios.patch(`https://discord.com/api/v9/webhooks/${application_id}/${token}/messages/@original`, data, { headers: { Authorization: `Bot ${discordTokens[application_id]}` } });
that endpoint shouldn't be limited
Is responding even ratelimited? Other than if you defer them
they must have some docs somewhere
Discord? Yeah one sec
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
think i found it
Not great. You'd have to also have logic to reset the remaining calls after an interval
Note to self ask Tim if responding to interactions ratelimited
let abc = new Discord.MessageEmbed()
.setTitle(`Order Logs`)
.setDescription(
temporary.join('➖\n')
)
.setColor("BLUE")
.setFooter("Order Logs")
await message.channel.send(abc)
```
will this get ratelimited
if there's like 5 embeds
Not at 5
wdym?
can 1 make 120 call in the first second of the minute and then 120 calls the first second of the next minute?
first line of the setInterval resets it
ah ok
120 every 60sec
If you're using that ^ for ws, then that's fine, but I would recommend this implementation for rest calls
https://github.com/AmandaDiscord/SnowTransfer/blob/src/src/Ratelimiter.ts
If you want I can help you prevent ratelimits up to 250 tickets in one command if that's a concern.
Or just limit it to 50 with the mongodb request now if that's what you'd prefer
I just want each embed to send like 3 seconds apart
That won't trigger rate limits
Or any other limits right
If you're using a lib like discord.js, you'll never hit that limit effectively
Still should respect the ratelimits
do i really want to rate limit? it might be weird for the user to input a command and then a couple minutes later it happens
as soon as a ticket closes, it gets removed from the DB
or i could rate limit, but not queue
should still be fine. POST /channels/channel_id/messages is 5 calls per 5 seconds
and that's it's own bucket per channel id
Gotta love buckets
Still trying to figure out how buckets work entirely.
Especially with webhooks
in most cases, major parts of the route delimit their own bucket where you cannot reach their limit by requesting to another bucket. Unless you hit the global rate limit if applicable. Not all routes have a global limit
this is tricky
is there a good breakdown somewhere?
i guess that;s a reason to use a library
If you track the bucket ids/ratelimit remaining you can deal with it that way right?
Not that I'm aware of. Where I learned the most was just analyzing SnowTransfer's code as I was rewriting it and trying to make it better
yeah
That's how you're supposed to
yeah, but i dont know all the rules
you should always update your cached bucket limits based on response headers
Each webhook I think is its own bucket afaik. So it should be quite easy in my case then.
Currently the lowest remaining I've had is 3(out of 5) so it's not been a big concern
does the header say how close you are to a rate limit?
Yep
Yeah
niiice
It's on the docs, forget the exact header
It'll usually say X-Ratelimit-Remaining
Yep that's it
I also need to figure out queuing while being on a cf worker then I should be fine
I'd recommend just analyzing the links I sent or just using those libs to begin with 
Oh perfect, I'll save the links.
I'd like to properly learn about it rather than using a lib
Fair enough
I'd rather write low level libs which make little to no assumptions and give the user control rather than using bloated libs like djs
I mean. I ported SnowTransfer to API V9 because it's a low memory footprint
Still need to bug DasWolke about adding me as a collab to npm and git
It looks like it's a lot simpler than I thought
+1. Main reason I wrote my own typescript library.
180MB stable at almost 5k guilds is nice
gonna port to / commands at some point and be stateless
can't deal with 600MB at startup
Don't have the money to fund that memory hog

Hi guys
My bot only has like 50 guilds, so it just sits there using 20mb or so lol.
most of that is coming from node internals as well which is cool
I'm wanting to make a subcommand
exemple: prefix-command1 command2
as I know I can update bot on topgg and after that I just wait for you will check bot right ? if smt wrong pls let me know
That's how it usually goes
and I will get the pending
and I heard smt like I need make a list with the command of bot
I need explain for you why and how this work or not
Why people need to know the commands of your bot?
Because how else will they know what commands your bot has?
Ah, what library?
help
can I invited you to my ssver
I dont join random servers
I will sent you the link
I just said no? Please don't dm ads people 😔
so sorry
I dont know how to explain for you
wait a mins
it's the drop and pick up command. For normal operation, it is not possible because need to pickup a certain amount, the amount of the person in the account is equal to or higher than the amount of the pickup, When the player picks up but the amount on the floor is not enough, the money will be lost. falls to the floor by the amount of pickup
this is complẽx command
What library? What have you tried? What database?
i think this should be good enough for rate limiting.
i need to remove the check on line 29
fixed
is this for rest or for websocket?
yeah
rest
lambda
which will just shut down after 15 minutes and delete the queue anyways
rest doesnt have a 120 limit
its 50 per second global, plus per-route and per-bucket limits
if you are close to hitting 50 per second, discord will likely increase it for you
provided you have a good reason of course
do i need to keep an eye on it and ask them once i see it happening a lot?
what are you doing that needs so many reqs?
welp, 50 per second is a lot, you shouldnt hit it very often, if at all
Does responding to interactions/button presses contribute to ratelimits?
I dont know anything about how interactions work, but as your responding to something it feels like it wouldn't. @quartz kindle
mmkay, i'll make some alerts to see if it happens
no idea
ideally, your app should cancel/interrupt all requests for 1 second if you ever receive a 429 with a global true header
good to know. does that mean i just dont respond to the interaction?
but if your app is distributed like in a lambda, each instance of it will hit it once
which counts towards the invalid requests ban threshold
it's only 1 lambda
it's just a machine that runs for 15 minutes then shuts downs and starts back up
it can scale up
it wouldn't call the api twice. each lambda would handle their own set of requests
https://discord.com/developers/docs/interactions/receiving-and-responding#followup-messages
Got half an answer to this.
Webhook interaction responses follow the same ratelimits as webhooks.
but separate instances are not aware of each other's rate limits, so if one hits a global rate limit, the other wont know until it makes a request, which makes it hit it as well
ah yeah. so it would do a couple extra calls to the api depending on how many lambdas are spawned
at most one error per instance per second if done properly
the threshold for ban is 10k errors in 15min i believe
10k in 10 min, just checked
10k after the 429 header?
in general
do 429 responses count towards the total?
Is there a rate limit when it comes to deleting messages?
any request that returns 401, 403 or 429 counts towards it
yes, i dont know the exact rates, but i believe is higher than sending messages
I don't know what that rate limit is either lmao
That's still 10k errors though
if i stop for 1 minute after a 429 is it still possible to hit the ban limit?
depends how many instances you have
50 calls until a 429 right?
if you hit a 429 once per second, thats 600 in 10 minutes
if you have 10 instances doing it, thats 6000
still within range
wouldn;t it be less
yes 50 calls in less than 1 second
if you have 10 instances doing it, thats 6000
wouldn't it be less than 6000
how so?
60 seconds = 1min, 600 seconds = 10min
i might be doing soming wrong
but instance are running for 15 minutes
this is just theoretical
so they only error ever 15 minutes
if you have 10 instances doing more than 50 requests per second, every single second, for 10 minutes non stop
it all comes down to 6000 errors
still not enough to get a ban
as long as it handles it properly
oh, each instance would reset every second and then get an error the next second so it would still get those errors like you said
ye
that would have to be 10 ips or big bot rate limits
50 being global which is per ip
What are you doing?
one requirement for handling it properly is to make all requests sequential, which means there is a network delay between every single request
rate limiting for serverless
that delay in itself can already be enough to prevent 50 per second
That seems overkill
you can configure it for bursts as well
But also, at that point just use slash commands and a http framework and not worry about it 
someone could use your bot and spam slash commands with a botnet and get your bot banned
discord bans the bots after 10k in 10 minutes^
Do rate limiting in the bot 😳
technically interactions via webhooks should not have rate limits if you respond directly to them
because basically you would be the one ratelimiting discord
i want to be as unlimiting as possible
imagine suing discord for violating your interaction webhook rate limits
Am I misunderstanding then?
Simply make your bot work through http website preview embeds :)
Perfect
Cut out the middle man
i mean, i dont know, it has to be tested, but it would be dumb
like why the fuck do we have to control ratelimits for both outgoing and incoming requests?
Yeah, seems backwards
also, discord is the one making a request to you
if they make the request in the first place, they are by default expecting a response
i do an ACK and then a patch
the patch is a separate request, so it falls under the webhook limits
but the ack is the direct response
it should not have a rate limit
Oh wait, the thing I screenshotted was followup responses, not direct
Yeah
No where else does it mention ratelimits for interactions
yeah it wouldnt make sense
Are deferred responses also a direct response? Can't seem to figure that one out.
I would guess not, since you already responded you cannot respond again?
you have to make a patch request to update the message after responding with a deferred response
PATCH/webhooks/{application.id}/{interaction.token}/messages/@original
Yeah makes sense.
It's always nice being the dumb one in #development
Let's me ask dumb questions and learn ^_^
I love being dumb too :)
is there a discord enforced rate limit put on users trying to input slash commands?
I would expect so
Anyone have a ballpark estimate of the rate limit for deleting messages?
5 times per 5 seconds
but you shouldn't hard code rate limits
ever
request responses include details about rate limits
You can also bulk delete.
Dylan purple 
there are some caveats with bulk delete, but yeah
Hi woo.
Hmm almighty. 5 times per 5 seconds sounds really limiting.
It do be discord.
When it comes to a bot that would do chat moderation, that sounds like it would get in the way
I plan on having my bot in a lot of servers at some point.
It's better than every chat moderation bot that I'm aware of.
They only can do direct string matching.
Mine's better than that :)
It's up to your discretion to determine when you should delete and bulk delete. You'd have to track patterns like if a server is getting raided, you could perhaps hold off on deleting immediately and bulk delete a collection of messages within a timeout
Mmm, why not set a minimum time that a server owner can change if they want (without going lower than the minimum) assuming its a spam issue?
Users don't always know what's best for the bot
Well the 5 per 5 second is per guild, not globally.
per channel I thought
That's why you set a reasonable minimum and don't allow them to go lower than it
Iirc Dyno does something similar with it's automod no?
oh per guild. Okay that makes a huge difference.
I'm a bit confused as to why reactions aren't working. The result is 0 reactions.
message.channel.send("Test reactions.").then(sent => {
sent.react("✅")
});
const filter = (reaction, user) => {
reaction.emoji.name === '✅'
}
message.awaitReactions({ filter, time: 20000 })
.then(collected => message.reply(`Collected ${collected.size} reactions`))
.catch(console.error);
I have the intent GUILD_MESSAGE_REACTIONS enabled.
guys
wdym?
You're sending a message but collecting the reactions on the message before the one you sent
Resolve the promise of sending the message and collect the reactions on it, example:
const m = await <Message>.channel
.send('Collecting reactions!');
await m.react(...);
await m.awaitReactions(...)
.then(...);
...
Imagine awaiting your sends
Nerdsss
Pre es6 was callback hell. Promises were not made to continue that hell
i dont like being stuck in a chain
How do I have a simple userid based db
You could use some DB that is key value based like redis or even some sql solution like Postgres works great so long as you set it up properly
you use a database and store the userid

make it the key row
If you are just getting into databases, sqlite is super easy to use
Well I just want it to be like
212318242247671808
|---- IP: mc.darren.ga
|----- rcon port: 8484
|----- server port: 25565
@edgy vale What language are you using?
Python
In this Python SQLite tutorial, we will be going over a complete introduction to the sqlite3 built-in module within Python. SQLite allows us to quickly get up and running with databases, without spinning up larger databases like MySQL or Postgres. We will be creating a database, creating a table, insert, select, update, and delete data. Let's ge...
Watch this
It'll get you started on databases and run you through everything you'll need to know
im trying to change my bot status to how many users it has, but i kinda messed it up and now its coming back as "undefined" and i cant fix it
client.on("ready", () => {
console.log(`${client.user.username} ready!`);
client.user.setActivity(`${client.users.size} | .help`, { type: "LISTENING" });
is wut i have
Well if you're using anything after v11 there's a cache thing now
So you have to use client.users.cache.size
ah okay
yeahh that was it lol, ty<3
ok
is it possible to add buttons in the embeds[].fields[] somehow?
No
Only buttons on the bottom of the whole message
You could be creative and have rows correspond with fields, but that may be confusing to some
yes
@commands.command()
@commands.has_permissions(administrator = True)
async def warn(self , ctx , user:discord.Member, * , Reason = None):
uid = user.id
guild_id = ctx.guild.id
if collection.count_documents({"_id":uid,"Guild":guild_id}) == 0:
collection.insert_one({"_id":uid,"Guild":guild_id,"Warns": 0})
warn_count = collection.find_one({"_id":uid},{"Guild":guild_id})
count = warn_count["Warns"]
new_count = count + 1
collection.update_one({"_id":uid},{"Guild":guild_id},{"$set": {"Warns": new_count}})
embed = discord.Embed(description = f"Warned {user.mention}|Now they have {new_count} warns" , color = 0xED4245)
await ctx.channel.purge(limit = 1)
await ctx.send(embed = embed , delete_after = 5)
can someone help im making a warn command in mongodb
but the bot isn't doing what it's supposed to its not working at all
Well if you have any errors it would be useful to provide them
i don't have any errors
thats the problem
@earnest phoenix you there?
@earnest phoenix i don't think it's a good idea to mutate the _id property on a document but it probably isn't what's causing the issue
yes
i think so
lemme do it
done
now its OMGid
Any python coders willing to look at a piece of my code and help me figure out what is wrong and why it's not working properly. It should print errors from my website but it doesn't do that. It should also load data from my website but it doesn't.
The bot is fully functional and works properly except that part
Just show your code and errors you are having
Someone who knows python will eventually come along
Sure! Let.me get on my pc
the code for my bot is here: https://pastebin.com/6eFXxJ0D
What works fine is the bot scans images and dms users the results from the web.. what does not work is the key! each scan should query my webserver to make sure the guildid has a key, and, if it dont, make one! if it does then it should make sure the key isnt expired, and if it isnt then it should go ahead and scan the image and dm results.
the php is made very well, works great in URLs, doesnt work at all on the bot, my friend who coded this doesnt now what the issue is either, and i cant find any issue either but i dont know python well, im a php/sql coder, please.. please help me get accesskeys working 😦
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
reminds me of my old react code
null tells me to sleep and yet I'm being pinged

I dislike react with a passion
Just get muted like last time?
What do you use then?
Angular
I wanna try svelte
nice
ddg stan using angular
Though not as much anymore
help 🥲
Update your node version
Use npx node@16.6.1 . instead of node . on repl
Needs 16.6+
Yea
hey....16.1 is the latest right?
No
You can't upgrade nodejs on repl
thank you
You need to execute the npm binary
you're welcome
Use Tim's solution
Put it as the run command in the replit file so you don't need to type it manually
I thought that was release in the v16s
we're lazy devs we use npm ¯\_(ツ)_/¯
14
how are u on every channel?
They respond in one channel and instantly switch to the next and start talking
I switched channels by clicking?
I mean how are u active in all channels at the same time!
I trype fast
he's hacking
yo why are you exposing me
revenge?
Code doesn't hack
Code has multiple monitor setup
One for each server they're in
I'm using a phone
multiphone setup
One for each server
fuck split screen not supported in discord
Imagine being able to split screen on a multiplayer game on mobile
I wonder how annoying that'd be
you can do that
someone was watching tiktok while playing ff
Not what I mean
Like Xbox cod split screen
ff is a multi-player game take it or leave it

tiktok is bad ngl
What even is ff
p2w game
proceed with caution
||https://ff.garena.com||
Oh free fire
Basically the game that took over pubg
yeah
because it was better
and had less toxic players
Kek
nothing beats minecraft 😎
lmao we went off topic
If I knew java well
I'd take a crack at minstrom
I wanna learn svelte
I never liked the idea of svelte
Smth about it just doesn't sit well with me idk what it is
I want to learn c++
if a guildDelete event happens and guild.available === false does that mean there is just an outage and the guild still has my bot?
why does this code js let channel; if(oldState.member.voice.channel && newState.member.voice.channel) channel = "true"; if(oldState.member.voice.channel && !newState.member.voice.channel) channel = "left"; if(!oldState.member.voice.channel && newState.member.voice.channel) channel = "joined"; if(!oldState.member.voice.channel && !newState.member.voice.channel) channel = "false"; return "false" when a user left so it should be "left" and "true" if a user joined though it should be "joined"?
No, unavailable guilds are emitted in the guildUnavailable event
guildDelete is only when the client left/were kicked or banned
I've had errors before where the guildDelete event fired for unavailable guilds. Best to check if it's available before doing anything in the guildDelete event.
mmkay. maybe if its offline for too long it thinks the bot is deleted
i tried to make the bot leave after 100 ms if nobody else was in the vc but from line 19&20 and on i dont get any console.log's anymore, no errors, can someone help? https://srcb.in/4NRSxzG5Bq
How can I view the source code of an exe file?
you can't view the source code, but you could disassemble an exe file and attempt to read the machine code
bot.on('ready', async () =>{
console.log("this bot is online!");
setInterval(() => {
bot.user.setActivity(`with money | e!help | in ${bot.guilds.cache.size} servers.`, ({type: "PLAYING"}))
}, 600);
setInterval(() => {
dbl.postStats(bot.guilds.cache.size);
}, 1800000);
})
i dont see anything wrong, its not updating the servers on top.gg
You're using dblapi.js?
damn, imagine waiting 30 minutes to see your server count
i think 2 weeks is more than that
yes
do i need to define dblapi.js?
like const it
yes i do sorry about the trouble
the problem is that i did const DBL = require("top.gg")
and not const DBL = require("dblapi.js")
hey i have some questions how do i host my discord bot on my own pc
like a permenant type thing
🦷
^ i repaired you broken tooth
@round edge its a possibility, if youre willing to leave your pc on 24/7
not the most energy efficient way to do it
if you want to host your bot 24/7 at home i suggest getting something like a raspberry pi 4 or similar. something with reasonable specs and the power profile of a router or tv set top box
i just need to know how to host it
i mean think of the trees 😄
well if youre hosting it on your own pc, just leave the program running
can u tell me how to
"dont click close"?
i got that
i have an on-off minecraft server i host like that lol
hmm, so you got code for a bot that someone else made
and youre new to bots and programming and want to know how to run it
ok
so someone else wants you to run this for them and youre offering hosting it for them
yes?
ok
so how can i do it
How to check the input is 1h, 1m, 1s. I do the mute command, but sometimes I get the error val is not a non-empty string or a valid number. val=undefined
just run it
but i advise NOT doing so @round edge
two reasons: 1) dont run a yt bot on your home pc, your home internet certainly wont be able to cope with the bandwidth requirements of a yt bot
- do you really think yt bots have a future rn? google/alphabet are coming down on TOS abuse of their platform with a giant lead ban hammer
- if you do and you get IP banned everyone in your house hold is going to be rather pissed off
any yt bot anyone makes right now is also instantly hit with immense levels of usage that will kill your desktop pc
that too! ^
yeah YT bots need a pool of ipv4
not just one dynamic ip from your residential isp
or massive pools of ipv6
looked like it
then what service do you use for music
fair point
maybe that y when i put it on a free service like heruko and after the bot got invited to 10 server's it didnt wanna load
@round edge
yeah
you can use the cmd
is it safe for music bots?
just run the code
k
ik that
will a i5 processer and 8 gigs of ram?
should be enough
ok
what gen is it
i5 gen10? i guess
so how can i do it?
what do you run your code with
if its node.js, do npm install pm2
depends on how the bot is made
does it use yt-dl and ffmpeg?