#development
1 messages ยท Page 1514 of 1
Then you can't really do this kind of thing with discord.js
You don't need the client to delete a message for example, you can make the request yourself
i mean thats just one example
but what if i need the client for other operations
i obv cant login again on the receiving process
yea that's why making the HTTP requests yourself is the only way to do this
An active websocket connection is only needed to receive events
Most of the stuff your bot does is HTTP requests, which doesn't require an active connection at the time of request
someone here earlier told me not to use ws
I don't know what kind of fuckery is going on here and what the use case is, so imma head out to eat
discord.js is not designed to be used like this, so if you want to delete a message for example, you will have to make the HTTP request yourself
I'm just giving it as an example
how do i share the message and client between 2 processes, one way is just taking the required data and serializing it over redis
im not able to get my head around this http you talking about
should i put a http server behind the client login?
after the client logins and when i wanna share my data
i just send it over http?
to the other process
so over http req i'll be able to send the message and client without serializing ?
in this case, the discord api is the server, while you are the client who makes the request
yeah
no that's just how to make http requests, you will still have to serialize the message data, and you can't serialize the client
so my receiving process must be a server
mmm
so bots build on js is not scalable?
you don't need a server - you just can't send complex objects from process to another process, only serializable data, and that's numbers, strings, bools, arrays, and simple boekcts
They are scalable. You just can't exchange javascript class instances through HTTP
just not that efficent
i still dont understand why a good config VM couldn't handle even 50 users
there was huge latency
even tho its in us
the vms
i see
there is a bug within your code
latency? just ping issues? no cpu issues?
it also caused the commands to be executed twice or something
"latency" means "lag" so, the number of users shouldn't affect latency at all.
double instanceing
because it was just single thread
it doesnt is bcs of the single threaded nature of js
im trying to break this into multi processes
I've handled 1400 server with about a million and a half users on a single nodejs thread so... it's not nodejs itself that's the issue.
you had 2 instances running
i got like 30k ping when users spammed commands
that spawned 2 different "bots"
users spamming commands could have resulted in a ratelimit
so ig the workers picked two jobs
also with the Ping stuff, did you use apis?
probably
had once my bot reaching 100kms bcs of an command that accessed an api
ive seen commands get ratelimited off one command
to be fair it where an edge case, one user got bored and constructed an argument for the command that caused the API to DDos the bot
why is that
How Can I Get My Emoji ID?
discord is doing that?
well, if your command does multiple api calls, you can get ratelimited.
escape it
-> \:dbl -> !dbl
by multiple api calls you mean the api calls to djs?
for example, editing a message 5 times in a short period of time = ratelimited.
What exactly does your bot do, @crystal wigeon ?
to get info like guild etc
Trying for a Minute
ikr
if you fetch a guild, thats an api call. if you get a guild, its not an api call.
That's literally nothing
i assume thats not api call?
@umbral zealot Thx
cache is a get typically.
yeah
So you get user data and... then what
hang on
are you creating full 10-minute videos with sound processing or something? lol
so im assuming message.send("some data") is an api call?
correct
also correct
anything where discord has to do something is an api call
create embeds should not be an api call correct?
i.e. REST
ok lemme show you what my bot does
sending an embed is an api call, just making the embed is not.
So here's what happens after this embed is sent it also calls the edit()
got it
so yeah iam sending embeds
and then editing that embed
so here i cant be sure how many times this gets called
That's pretty much nothing, like, generating those 2 progress bars is something, but it shouldn't require so much processing power, that's super simple
his cpu power isnt the issue
yes but the edit api call
we already determined that
yep
How often are you editing though
when a command is sent, or on a timer?
it invokes on a command then its just a timer until the health is 0
if multiple people use the command in a channel, you could hit the ratelimit quite easily.
which spikes the ping?
a single person probably wont
if it cant send any messages because of that ratelimit yeah
yeah my bot went viral 2 days ago and my server got flooded with 200 users who wanted to iuse the bot
and then starting sending commands in channels
so, on my game bot, i had restrictions for only one game in a channel at a time.
now i know why i get those missing message nad not permitted by discord error
limit those battles or whatever they are to one per channel
yeah
what woo said
as many ratelimits are per channel, that may solve your issues
ratelimits are very often per channel
throw more processing power on it. or use a language that is multi threaded
we already determined its not cpu power
python is multithreaded?
yeah not cpu issue
the latency is due to discord being rate limited the commands right?
well then more stuff like C# C++, GO, Rust
keep in mind that node often isn't able to take use of your hardware to it's fullest potential
if the bot gets verified, will the rate limit thing exceed or something tho?
consider using langs superbrain listed
yep im well aware of that
it only uses like 500 memory
this is just one instance
how many guilds?
wow what did you store in memory?
the test bot is just a replica of original bot which is in 160 guilds but the player base is same since im usign same db
did you do a lot of image manipulation?
yea the Canvas stuff will bog your bot down
wym
its slow and will take some time to render
well you got the issue that you have high latency. what if of the 160 Guilds 6-12 render an Image at once.
so will getting the bot verified increase the rate limit thing or something?
nope
unless you hit 400k Guilds then you have to contract Discord Support bcs you need the other API access
this is why im trying to execute multiple jobs parallely
i see
yea and js is single threaded
consider switching to another language
node just isn't as powerful for this task
canvas will render one after the other
yeah js is single threaded, but i have workers jsut need to figure out how to share the message and client, tho switching to another language would be i'll have to re-do the bot
also idk go
only python
and its also single threaded ?
ig
python is not that better
consider a compiled language
It's not any better for the job.
like the ones ive listed a short while ago
i would personally suggest c# because it has this powerful tasks api
you can run tasks in parallel and throwing them into another thread will automatically be handled when needed
well there's a learning curve for me there
its a bit harder to learn than js
but not impossible
i was gonna learn go for ML but was told its no that poppular and im better off learning something else
if you know js you will find some stuff that is similar in most languages
C# got ML.Net a quite powerful ML package
ive got recently into Rust and for now i like it (still havent really used it im still working throu the docs)
ohh now i get it the bot rates itself
THE PREFIX
language?
๐คฆ
dev language
programming lang
i think he means the bot language
coding language
oh
lol

lmao
Hello, it's normal that the bot is inactive ??
did you login with the bot?
if you dont run it, yeah its normal.
Yes the bot has been active in my server until now
@earnest phoenix and where is the main command line of the ${prefix}?
like this
const prefix = pre.fetch(`prefix_${message.guild.id}`);```
Are we talking about the Giveaway bot ??
btw last question, so even if i try to multi processes the traffic, i'll still hit the rate limit thing right?
theres like 100 giveaway bots
1000*
yes
yes the ratelimits stay the same
its a string inside a json file
that is a .json file
where define you the prefix in the message event?
he probably loads it from the json
if you console.log your prefix it also logs it correctly?
I doubt if that is a smart thing to do while it can be much easier in 1 line
const prefix = 'm.';```
yea but hardcoding such stuff is bad practise
uhm
and what if he wants to reference it in mutiple files?

so i just make it a const inside the main file
fair enougjh
and now good?
so whats wrong with the string in the json file?
loading it from the json is fine
just dont use json as a "Database"
quick.db is better
barebones sqlite is better. quick.db is extremely restricting
console.log(prefix) does your prefix ends up in your console?
yes
it sends m.
in log
if its a different prefix
like
r.
i still returns m. in log
could you make a small screenshot or copy/paste of your code? maybe there is something else wrong. Also make sure to not include any token
then something else is not right in your message event.
make sure everything is in the right order
ok
i mean
ill send you lol
my code is messy
but ill sends
cant be worse than other stuff i saw here
want me to send in dm?
i dont do DM stuff
sure
Sending it here would help others figure out the issue if one person can't
uhh
which means i have to send all of my bots code
We don't need the entirety of your bot's code, just the parts you defined and used the prefix
Starting points of your message event would suffice
const args = message.content.substring(prefix.length).split(" "); // prefix split
switch(args[0]){```

you're only checking the length
use a codeblock in the future 3x `
ok g
```
i know
That's not where the issue is occurring i assume, may you show us where you're defining your prefix
right
lol
so its just prefix
i dont need length
i think not in the message event
uhh
wait
You're planning to set your prefix accordingly but setting it outside the event listener
If I want administrator to use this command do I just put administrator in line 14?
like this
bot.on('message', async message => { // message async due to vrcuser and other commands not present for right now
const prefix = 'm.';
const args = message.content.substring(prefix.length).split(" "); // prefix split
switch(args[0]){```
thank you @earnest phoenix and everyone else
Yes
hm?
yea, you can

Thank ya!
@earnest phoenix but you probably don't need administrator permissions
he just suggests him to hardcode the prefix and ditch the config file
no bot needs the whole administrator permission, so you should just check the individual perms you need
Cant I just put
This channel, development in a nutshell 
administrator
Ima just do that
well k
dot dot dot
@mellow kelp is it with caps or just smoll letters?
caps
Dotpost combo
smoll
Administrator
lmao
ADMINISTRATOR
i have it so and works perfectly 
const pre = new db.table(`guild_${message.guild.id}`);
const prefix = pre.fetch(`prefix_${message.guild.id}`);
const pre1 = new db.table('serverside');
if(!prefix){
pre.add(`prefix_${message.guild.id}`, '!>');
}
if(message.author.bot) return;
if (message.content.indexOf(prefix) !== 0) return;
if(!message.member) message.member = await message.guild.fetchMember(messsage);
if(!message.guild) return;
const args = message.content.slice(prefix.length).trim().split(/ +/g);
pre1.add(`used`,1);
const cmd = args.shift().toLowerCase();
if(cmd.length === 0) return;
permissions are all in uppercase
i dont get it
smol
there is a difference between using a Database and hardcoding the prefix

tru
fax
mhm
Voltrex said it was because i was getting the length
const args = message.content.substring(prefix.length).split(" "); // prefix split
I never said that
why you the coding a bot? 
there is enough tutorial on YouTube how to do it
Million did
bro
tell me why you tryed helping and it did nothing
you legit sent the exact code i have
and said
do this
i already had a string for the prefix
you code is fucked up 
thanks
gathered
and not working

Chat, thanks for brutally ignoring whatever i said

am i missing semi colons lmao
they are not really needed
joke*
Pup I think you forgot to wrap <2021> under <2020> /s
yes
did you trim your args before splitting? incase there are whitespace
@earnest phoenix and what about if you try this as args?
const args = message.content.slice(prefix.length).trim().split(/ +/);

i think he meant me
and no
my code is working perfecly
it is something else
Oh
yeah
i would send you my stuff
if you want
lol
Just do it
maybe go step by step to check if there is something going around your args
Has anyone here ever tried running two redis services at once?
Yeah, I'm trying to
but why did you need 2?
redis is just a cache
just use unique keys
you can just prefix with the bot's discrim or smth
i use the Same redis and Mongo Server for 4 Bots and a WIP Dashboard
I'm pretty new to databases, especially redis. Would I just set the key to something like my bot's id and then store the entire data of the bot as a json string as a value to that key?
how did you plan to store stuff?
Well for one of my bots I wanna store currency
you're aware redis is memory only, right?
yeah
it's no different than storing the data in your code
Redis offers disk persistence
then just add to each prefix the id of the bot to make it unique to the bot. but for Persistant storage i would use a Database and then cache it in redis
What database would your recommend?
For stuff like econ, a structured database like any SQL based solution such as MariaDB/MySQL would be very good. Redis is more for Object caching for worker nodes to access
Mysql, MongoDB, Postgres are the 3 most used
(atleast for Bots)
each of them got theyre ups and Downs
MariaDB is probably the most performant SQL server
would not bet on it, Cassandra is also extremely fast
Is Cassandra SQL
used it
I just use Maria since it's an open fork of MySQL which means supporting the same IOPS
uses CQL
You must have gotten SQL and structured confused
If you're feeling quirky, you could get away with Mongoose
Some of the wrappers I've seen more resemble ORMs than wrappers which I don't particularly like.
Mongoose is nice, but if you want something faster use plain mongodb instead
one thing that is sad with mongodb is that you need a license for in memory storage engines
postgres + orm is heaven
you'll probably get the most support with postgres too due to it being oss
i fixed the issue for now using
if (!message.content.startsWith(prefix)) return;
Try sequelize if you are looking for an ORM
DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
Where can I change that?
Read the error stack
the first frame from the top is where the error originated from
How do you check if the bot has any permissions ? In djs
<message>.guild.me.hasPermission("perm");
souh why is my bot not working on other servers itโs only working in mine
Iโve updated gave it administrator perms but it still wonโt work
Define "working"
Like, are none of the commands working or is it offline etc.?
Okay
Well, does it print any errors when the command fails?
Is there anything in your bot that's only supposed to work on your server?
Nope
And the bot has permissions to send messages in the channels you're trying, yes?
Yes
Pretty hard to say what the issue might be without seeing the code
Is it fine if you can take a look?
Cuz thereโs like 8 commands
And uh I can really take pics of them all
I'm guessing you're doing js, which I'm not too experienced with.
you should use hastebin
Alrighty
He's using js
Alr
Uh wtf
I can only send in DMโs since people can copy my token or something
repls are public anyway even if you dont hand out the link
which is why you put your token in the environment variable
which you should do now
I didnโt but thereโs something but nvm..
random unused if statement on line 76 index.js if (message.content.startsWith("") )
im pretty sure i told you to remove that line before lmao
@quartz kindle remember I did?
aliases: "dep" && "put"
Then the bot stoped working
that doesnt mean it should be there
that just means you have bigger problems that are being hidden by that
Well, I canโt really do much
that if statement is useless because you can't send messages with 0 characters
And uh, so why is my bot not working?
do you have any errors in the log
two message listeners ๐
Nope
Which line?
So if you remove the redundant if statement, does it still not give any errors?
Thatโs why? Bruh
Nah that's old
do any of your if statements have the prefix mentioned
I mean token
lmao
lol
1 sec
Wtf still not working
Why does it work in my server then
But not in other servers
maybe it's because you don't know what you're doing... just a speculation
didnt know string#green was a thing
@cinder patio but how tf does it effect the other servers???
if you didn't copy code from 100 different places you wouldn't be here asking us this
Well not all are copied
And it has nothing to do with that
Itโs just working on my sever
not all
This is the uh invite link
@ember atlas
Not advertising-
Bruh this guy-
I just wanted to show if there was something wrong with the link..
How can the invite link be wrong
That's exactly what the problem is. You don't know what your own code does. Your index file has code from 3 different tutorials. You can't just copy and paste code from different codebases and expect it to work
@solemn leaf something with perms..
@cinder patio all commands work in my server not in others
they deleted thanks continue killing people
not that this is the reason your bots not working, but
if (command.staff && !message.member.hasPermission("BAN_MEMBERS")) return message.reply('You must be an administrator to execute this command!');
your telling people you must have admin, but are requiring ban members
might be confusing.
wow that was stupid
@earnest phoenix Glad you got your answer but I unfortunately have to mute you for advertising. Sorry.
-m @earnest phoenix posting their invite link to their bot in #development without being prompted to | 3 days
๐ค Muted pepoo the coder#7362 (@lean jungle)
thats boss for you 
that css thou
it was so good
welp
ill see if I can find snippits of it in this discord
its why we generally advise users to back them up.
Personally if your bot isnt approved yet dont do fancy HTML, wait until its approved
I had it backed up
In most cases after approval you'll be contacted before removal so it's better
-atmods
@smoky garnet
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
Why would you tag mods for an issue with emojis? 
have pr
Why did you ping us??
emote issue
what's "emote issue"?
was declined.

Did you seriously ping 25 moderators for a decline in a channel where you are supposed to talk about code and app developpement?
that's not funny
it's the being dumb for me
sorry
people and common sense: ๐ง
I hope this guy is drunk lmao, otherwise I'm not sure anymore
there's people for everything
bro there is not problem for you do you know @dusky sundial
this feels like talking to cleverbot
I'm not sure what that means, but thank you?
oml cry

@earnest phoenix
help, i need a vps, can you recommend me something specific?
galaxygate
something specific? sorry man, dropped my crystal ball in the car park a while back, you'll need to tell me what you need it for so i can recommend somethin
god damn, you gotta stop dropping it, here ya go ๐ฎ
thanks but its full of purple goop
Something specific, more powerful, for a complex bot, you understand?
ah i see
yeah so it doesn't break
=)))))
ุงูููู
Uhum
you could probably go for the 10/month galaxygate plan
gg?
It doesn't matter the price
well how many cores and threads as well as ram do you need?
Idk, 2/4/8 cores, and 4/8 gb ram
Some VPS providers I've used are: Vultr, OVH and Contabo.
Vultr has some decent pricing for high frequency core clocks.
OVH has a low core clock with 1 core but 2GB of ram at $3.5 USD which is pretty good for a small "ram heavy" project.
Contabo has a low core clock but 4 cores and 8GB of RAM. Kinda sus pricing - $6/m for a VPS in the US but I have 2 instances through them and nothing sus yet.
Uh, thx vm
oh this is waht i wanted to talk about lol
Lol
I forget which Xeons their docs say, but I imagine dual Xeons isn't relatively cheap
contabo doesn't include a ssl certificate?
dont think most vps providers do ๐ค
Because certbot
vercel seems to be more web focused
Getting an SSL cert through LetsEncrypt is literally free
can that be done in contabo or are u forced to buy it as a add on
actually vercel seems 100% web focused, rather than general VPS hosting.
letsencrypt is free always
afaik
yea
LetsEncrypt can be done on any machine running Windows or Linux. I'm not sure about the specifics of other OS'
It all depends on what you choose
so to get a ssl certificate you'll have to pay for it and renew it every 12 months?
No? When did I ever mention that
letsencrypt auto renews it for you.
no i mean
No Im pretty sure you can get ssl for free
if i use contabo
once you setup letsencrypt you dont have do do anything again
If they offer paid SSL, it's probably through someone other than LetsEncrypt
yeah
Also, pretty sure you have to run a script every so often to renew a LetsEncrypt cert. I just have a cron for it so no big deal.
i mean that can be done lol
when you setup letsencrypt pretty sure they have an option to auto renew built in, i havent done it in over a year so i dont quite remember the process.
yes they do
is making a site using a theme and then implementing your own backend good, or should i rather work with wordpress
Ah. Hm. Might be something new they're offering then or something I skimmed over.
Depending on what the website does, you don't need a backend other than simple HTTP request handling
no i mean it's like fully customized and there are alot of stuff i am sure i can't do in wordpress
also you do know that the certificate isn't free right?
which certificate
there's a one-time setup fee
which most likely covers the cost of the certificate
That's why we recommended setting up LetsEncrypt since that is free
Yup gotchya
With ytdl-core is there a way to skip to a certain part of the video?
did you look at the ytdl-core docs like someone said yesterday?
ah, yeah. iirc, they said its called skip, and it would be in the docs.
Ah thanks
if a new feature of my bot needs more permissions, will everybody have to kick and reinvite the bot to use this feature?
they can edit the permission
you could check for permissions before doing the new thing
and send a message saying which permissions your bot needs
but there is no automated way to prompt the server admin to the auth2 site to accept the new permissions?
Hi how long do you have to show up bot in the search?
I'd simply recommend updating it in the help command, explaining the perms they need. As well with proper error messages. No need to make people kick your bot? If someone doesn't have the right perms, they will figure it out, or join your support server.
Google indexed my bot in the first 2 hours. It really just depends.
oh ok thx
No problem.
How i can put a canvas buffer in new MessageEmbed().setImage()?
you gotta create an attachment with the buffer
Yes
then use attachFiles() to attach it and set the image to attachment://<your-attachment.png>
what's your code?
oh
How can I sort an array of mongoose documents by an element inside of the documents?
pretty sure Array.sort will do the trick
yea
what do we all use to host our bots?
Depends on your needs. Do you need a lot of RAM? A multi core CPU? What's your budget? How many guilds is your bot in and how many do you expect it to be in down the line?
What were you trying to do, exactly?
make a bot
idk
you don't know what you're doing?
making your bot invite link?
well there's probably not much we can help with then if you have no idea.
You were somewhere just before that screen. what was that "Somewhere"
when i finished verifying it showed that
verifying what?
to add the bot
Where were you Before this screen?
verifying to add my bot
WHERE
i love this channel
verifying where
on what site
app
page
where were you specifically and exactly
works fine for me
what
remove response_type=code in the end, I don't know why you had that there but it shouldn't be there.
how
im on this page https://discordapi.com/permissions.html#
A small calculator that generates Discord OAuth invite links
by... using the backspace key on your keyboard...
you know like
using... the computer... 
please god help me 

probably dont click buttons you dont know what they mean when developing stuff.
and its offline
when you where making your invite link, seems you clicked "require code grant"
how do i fix it being offline :/
You appear to have a fundamental misconception about the nature of bots. A bot is not something you create and "get online", instead it is a program that runs on a computer somewhere and interacts with Discord's API, sort of pretending to be another user that just happens to respond automatically. A bot account you create on Discord's website is merely a (mostly) normal account that you use with the API instead of with the regular Discord client. Creating a bot account doesn't mean you automatically get a fully functioning bot for your server, you still have to write a program that actually provides the logic for the bot. This requires programming knowledge, and you must know a programming language.
i made code how do I add it
you have to run the code
how
this is my first bot
did you make the code, or just copy paste it ๐ค
made it
then you should know how to run it
yes
Where did you type this code
should i dm the code
no
notepad
I....
If you made the code, you probably also know how to run it
my favorite code editor

well idk how to
can you tell
Then you did not make the code if you don't know
Here, this will help: <#development message>
we actually dont know either, since we dont know what language its written in
its such an open ended question no dev can answer it with the information we have
its in javascript
Woah! What a day! Switched out all Discord.Collections() to leverage redis instead (leveraging Keyv). Fixed a ton of stuff ๐. Thanks for you help yesterday, Woo!
in your command prompt with the directory set to your bots folder it will be
node filename.js
@hoary vine
oh man, sounds either super fun, or really frustrating.
yeah, its one of those days in dev 
๐
yep
???
how
๐ฌ
i dont know how to explain that any clearer tbh
"Here I've been doing coding for like 5 minutes HELP ME NAOW"
Next question: "What's a terminal"
send video
I already sent you the resources.
videos are a bad resource for learning js and discord bots
discord bots specifically*
There is no 5-minute video to teach you weeks/months of programming
lots of bad practices, old information, and misinformation
You got it, lol
great minds think alike @long marsh ๐
I leveraged keyv from the start because I knew I would need to switch out to Redis eventually. It was fairly plug and play with the .set(), .delete(), and .get() methods for the cache.
All it needed was a redis url + 3rd party redis integration
oh, thats lucky. honestly havent used redis yet.
it's funny because that's the same methods I use on enmap and josh ๐
And, of course, a little snippet in my docker-compose.yml file ๐
redis:
image: redis:alpine
ports:
- 6379:6379
Runs it alongside my bot docker container ๐
All my shards will open connections to the container (debatable ... should probably create an API container ... but eh)
i guess im going to use this for the bot https://code.visualstudio.com/
should i?
๐คญ
sure. yes. vscode is perfect
it is?
k
I use it ๐
VSCode is used by over 50% of programmers, according to a StackOverflow survey.
I can believe it
its downloading
The only language I had trouble with using it for was Java.
java is more intellij
yeah but that's because you should be using IntelliJ IDEA for Java ๐
makes sense
Charen, are you a software dev?
In a career sense, I mean
Feel free to not answer - prob not the place for it.
In a career sense I'm currently jobless but I'm a senior react dev, yeah
Backend ๐คข
That's fair
j/k I write a lot of nodejs, I'm pretty full stack tbh
Yeah, I'd imagine
how can i get my bot off from heroku?
"off from"?
hosting on*
you mean turn off?
im so lost
resources tab -> turn off your worker
Barnie, are you asking how to transition your bot to another host provider or turn it off?
you can turn your Application off from the heroku control panel
turn it off
this
Yeah, there's a page that has the dyno where you can turn it off ๐
opening vsc
Haha, we don't necessarily need updates of that my guy.
Next message: opening folder
๐
If we start getting update every 5 minutes for the next month I'm going to lose my mind.
At the ending of the day, they're lacking some major fundamentals. Instead of asking for help, they should be learning how to research it themselves. Of course, I don't have to tell anyone this but them ๐

I'm going to keep telling them anyway
๐
because rule 8.4
man this channel is awesome
Not all the time
Anyone else here running their bot on Docker?
I like it for the development environment & the easy push to production. I have a full pipeline that basically just logs into the server and runs a few docker commands to respawn the application.
And, I can rollback the bot to a specific version anytime.
i cant even install docker on my pc 
anyways peep this https://i.imgur.com/IlFrk4W.png
True itโs efficient
And, for local development, it's easy just to build the image + run the docker container
Docker's great when you share code or deploy, but like, for bots that's pretty damn overkill imho
And, I know, it'll work on any computer.
This is the whole reason I did it ๐
yeah but how often do you need your bot to work on anything else than your dev PC or your host?
I already have crap to install to get my bot running, personally I don't care much for adding more layers of complexity
imagine running your bot on kubernetes
I don't use kubernetes ๐
who knows tho
I completely disagree with this. Docker will 100% be relevant; however, there may be another abstraction on top of it that makes it easier.
an abstraction layer on top of docker
for now i find docker kinda overkill
which is an abstraction layer on top of the OS
which is in itself an abstraction layer on top of the kernel
which abstracts the hardware
Abstraction may have not been the best word - better API? I'm trying to say that I don't believe docker will be obsolete. The Docker CLI itself may be, but not the technology.
I wouldn't want my application to restart when you can delete required files from require cache and then re-require and resync
uptime is pretty priceless
Wait, what context is this?
Are you for or against docker ๐
Oh, technically, the bot never actually sees downtime. Maybe a shard will.
fuck me, i cant think of a proper way to setup my new stuff
Or a collection of shards
Thats the same thing... Having to reidentify to the gateway and go towards your 1000 daily rate limit is completely unnecessary
what's "new stuff"
๐ค
What would you recommend doing instead?
like a new command
What language do you use
what does that command do
JS
stuffs with user
very informative
trying to create a mail system
modmail?
It doesn't matter that language though, unless you're specifically using a library.
wdym mail tho
like each user has like a inbox?
oh
yeah
database time
More on this topic, how would I hit the daily rate limit? Am I not understanding something?
i can think of plenty of ways to do it, none are good enough for my standards
There's this thing called require.cache
It's an Object keyed by file paths which holds references to required files. you can delete entries from the cache and then re-require files and the new exported data will populate that Object. You can then sync the result of the new require with old Objects to get new references
you use typescript right
correct
That's interesting.
@quartz kindle can u gib halp with logic? im too dumbo
Is that the preferred method for updating long-running applications? By physically 'refreshing' the files inside the cache?
correct, i can apply almost anything
nah i need a framework
and i cant think of a good one
implementing is easy for me
Erwin
Just find a good database
imma bonk you so hard
If one of your shards has to reidentify to the gateway, it's counted towards a 1k daily rate limit bucket. Restarting the WS connection adds to this unless you reidentify with a resume call and provide a valid session and sequence. If you hit 1000 non resuming identifies in a day, your token is reset
No
i know what im doing, i just dont know HOW to do it
if that makes sense
like i mentioned, i need a SCALABLE way
Make members have a storage limit
not the issue
Hnm
Employing similar solutions guarantees uptime when uptime is absolutely necessary. If your application relies on restarts to fix bugs, you need to fix your logic
Whats the issue
hmmm
