#development
1 messages · Page 1706 of 1
hm
ok
try putting inside a div
the footer? ok
no, everything
nvm
forget that, am forgetting body is treated as a div too
hm
set the footer's bg color to be red
remove the body red color
does anybody know how to make for loops faster in python
why are they slow?
because im pulling and adding to my database
then the problem is not the loop its what you're doing inside the loop
for a in range(amt):
cash(ctx.author.id, "wallet", item_info["sell_value"])
info = await database.find_one({"id":ctx.author.id})
ritem(ctx.author.id, item, info["inv"])
im adding cash, getting whats in the database again, then removing an item
how important is a tos for bots?
but in remove item its another loop
def ritem(id, ite, inv):
c = -1
for a in inv:
if a == ite:
c += 1
database.update_one({"id": id}, {"$pull": {"inv": ite}})
for a in range(c):
database.update_one({"id": id}, {"$push": {"inv": ite}})
is there a better way to pull items?
yeah
if you need to make multiple database operations, always try to make as many as possible in a single query
ive searched the entire mongo docs but i cant find any better way to pull 1 item at once
because the inventory array is like ['item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item', 'item2', 'item2', 'item2', 'item2', 'item2', 'item2', 'item2', 'item2', 'item2', 'item2', 'item2', 'item2', ]
did you use !important or padding=0?
no
its even worse
the footer was a div with the id "footer"
in the css i just put footer not #footer
use this
body, html{
margin:0;
padding:0;
}
i fixed it already but thanks
okay nP
I need help with mongo db
so if the entire array was ['item1', 'item1', 'item1', 'item1']
i want it to become ['item1', 'item1', 'item1']
but "$pull":{"array":"item1"} makes it []
are those items exactly equal to each other?
yeah
then why not use an object with a count?
then you can just increment/decrement the count
using an array is easier
can't you just slice the end off?
because theres 20+ items
or reduce the array
and adding that to the db would fill it up like crazy
idk how to do it properly
The slice() method returns a shallow copy of a portion of
an array into a new array object selected from start to end
(end not included) where start and end represent
the index of items in that array. The original array will not be modified.
using an object would be much easier and would not fill it like crazy
isn't the whole point of mongo that you use objects?
instead of [item1,item1,item1,item1,item2,item2,item2,item2,item2] you have [{item:item1,count:4},{item:item2,count:5}]
which one is easier?
more importantly which is smaller
or even better {item1:{count:4},item2:{count:5}}
you could even have the items array inside the object and count it after
but it would be better to not do that
or even {item1:4,item2:5}
nvm
indeed
all i would do is
list = info['array']
list.remove(item)
await database.update_one({"id":id}, {"$set":{"array":list}})
thats a way ig
Listen to Tim
Using arrays will take a ton of space later on, plus deletion is slow
just have a counter
for each item
and increment/decrement it when needed be
and if you still want to use arrays, use pop to remove the last element
or even {i1:4,i2:5}
well yeah but hes probably using "item1" as the full name/id of the item
unless he has a map/dict for it
those are placeholders most likely
ik, just joking on how you went compressing the json like 7zip when seein a text file
If you want to go even further
Any pending questions related to discord.js? 
Im bored so came here to timepass
sure
in a buffer
if you're sure no number or id will ever exceed 16 bit
hey guys
nice
some datatypes have overhead tho
strings have a 16bit unit reserved for its length
same for bigints and buffers
makes sense, my custom bytecode interpreter works exactly the same
16bit for array length too
only 8bit for args though
unsigned ofc
my interpreter turns objects into arrays
honestly a serializer can pull that off too ^
No need I know how to make it better 😉
@cinder patio mine was made to do 2d charts from equations
Mine's a programming language
What if I only know some properties of an object and i dont know the rest of the object shape. What type would i use for a parameter like that in typescript?
Everything was going well until I started writing the parser / compiler
then I gave up
I didn't like the architecture the project so I'm starting over
well you know where to find me 😉
my computer is having such a stroke
ye its basically what i do too
interface Obj {
[key: string]: unknown,
key: ...
}
object keys are a sequence of strings identified by an index
then object values have a data type and the index identifier in their overhead
owo what's unknown
unknown is unknown
unknown data type ? 😛
can i do that
because deno lint is yelling at me for any
yeah use unknown
thx
also ive been solving 37 problems with my lib today from deno linter even though i saw them way before
dont ask why i didnt fix

anyone ever generated clients from .xsd files?
I was thinking more like, get rid of the object keys and let the receiver define them based on the order, so for example:
{a: 1, b: 2, c: 3} turns to 0x0 0x3 0x1 0x2 0x3 and let's say the receiver is using a lib to make it easier, they would deserialize it like so: data.deserialize("a", "b", "c") for exmaple
should i use erlpack instead of json for the websocket
but that requires both sides knowing the object structure
you should at least make it optional
copy from d.js lol
I'm a wizard
thanks ts
TS2571 [ERROR]: Object is of type 'unknown'.
`https://discord.com/api/v8/interactions/${d.id}/${d.token}/callback`;
^
at file:///home/aatif/Desktop/programming/SlashDeno/test.ts:36:56
How long can a message go until it can't be edited?
@client.command()
async def disable(ctx):
async with asqlite3.connect(db_path) as db:
async with db.cursor() as cursor:
await cursor.execute("SELECT enabled FROM welcome WHERE guild_id = ?", (ctx.guild.id, ))
result = await cursor.fetchone()
command = client.get_command("welcome")
print (result)
if result == ('1',):
await cursor.execute("UPDATE welcome SET enabled = False WHERE ?", (ctx.guild.id, ))
await db.commit()
command.update(enabled=False)
await ctx.reply("Welcome Message disabled!")
elif result == ('0',):
await ctx.reply("The welcome Message is already disabled")
else:
await cursor.execute("INSERT INTO welcome(enabled, guild_id) VALUES(?,?)", (False, ctx.guild.id))
await db.commit()
await ctx.reply("Welcome Message disabled!")
how do i make this command per server?
forever
forever in the sense until the heat death of the entire fucking universe
im making the object structure shareable similarly to how zlib streaming works
I give up
just query the db if that command is true for that guild_id and retrurn if it isn't
time to make another interface
I don't know how zlib streaming works
dude
isnt it coded like that tho
interface Obj {
[key: string]: unknown,
token: string
}
the lookup table is sent in the payload so that both compressor and decompressor know the structure
isn't it just disabling it in the db atm?
._ _
oh here await cursor.execute("SELECT enabled FROM welcome WHERE guild_id = ?", (ctx.guild.id, ))
just repeat that in ur welcome command
ok
and if it's 0 return the function
nope didnt work
and it's disabled in the db?
no its enabled
what is the result this gives?
await cursor.execute("SELECT enabled FROM welcome WHERE guild_id = ?", (ctx.guild.id, ))
result = await cursor.fetchone()
('1',)
doesn't that mean the command is enabled?
it does
so then it should run the command
if it's not that just return;
and the command won't run any further?
lmao now its not working
you messed it up
do i need to learn how to use default exports
import { Snowflake } from "../typedefs/Snowflake.ts";
import { Token } from "../typedefs/Token.ts";
import { Member } from "./Member.ts";
import { User } from "./User.ts";
yes i would if i was you
it will cut down time
well i sometimes have multiple related interfaces and types in the same file so ill need to remember to use default export in one file and {} in the other
and i have a heckload of typedefs to write so
ok
all of these plus moar
can you use enabled=True for per server commands?
yea lmao
run a debug on your code and then fix it
i already fixed it lul
do not use long variable nam-
discord:
nice
why
ok i did not use long variables
@queen timber i found an even longer name
ApplicationCommandInteractionDataResolved
lol
Hello
hey
What's ur bot can do
it can level up members in your server
... ohh can u come in my server
Plzzz
this channel is not for chatting about bots
i will dm you
nor is it for begging people to join your server
K sorry
he asks like he is mod
lol
how could I use regexp to replace only ;, () and []
so far I have ([^a-zA-Z0-9 ])+, but that stops when it reaches a letter
I want for example lala (olol);[] to change to lala olol
umm
/[\;\(\)\[\]]/
?
that stops once it hits a letter
huh
bro
you should use g flag instead of +
add the flag after the closing / like so: /g
this already works, you just need to use the global modifier
Hello,
I currently can't start my bot (no ready event emitted), is there someone with the same problem ?
shouldn't the + also go in the capture group since it would capture 1 letter only and there would be a ton of capture groups if the global flag is enabled
How I can do a img to svg? 
why?
I don't think there is a clean way to convert an image to svg since svgs consist of geometric objects. Your image would lose a considerable amount of quality if it's detailed
There's some tools from Adobe that can do that though
also inkscape
anyone know why VSC is showing this, it was working fine yesterday but now it doesn't wanna work
looks like nodejs isn't installed
or it's not configured in your path
try typing node -v in a terminal
see you didnt read what I said, it was working fine yesterday but today it isnt, which indicates nodejs is installed but today I cannot use node
Hello! do you guys have a tutorial on how do i make people react with an emoji and then a role is assigned? a role like age, sex, etc.
it's something i can make with a bot?
for all i know it was removed
You can make this with a bot
Try uninstalling and reinstalling it idk
Hello, can you help me?
How do I get the last image sent on the channel?
Yay! is there a bot you recommend me?
I think carlbot does it?
same
that's fancy, one day i'll make it to dev bots. Thank you guys
well fuck
this is not what you wanna see in logs
@quartz kindle do you perhaps know a way to check if the thread is getting clogged or something that might be causing misses in acks?
dunno if theres a profiler for that
best i can think of is try to run a while() loop for a couple dozen minutes and check if theres latency

looks like normal reconnects?
every shard will reconnect at least once every 4 hours
nono
let me give you a bigger scope
@quartz kindle
these are just READY events
shards going brrr
idk then could be discord having issues
are you having that?
I don't think our bot is having a stroke atm with that. 

let me check
is this logs or a csv?
i assume i probably left some very amazingly good code there that might be clogging it enough to miss some acks
its my terminal
oh, thats postgres
im really not sure they should be reconnecting that often
thats once every 30m on urs tim
this is 30 every 30 minutes
well idk
yikes your bot ok?
clearly not
recieved a couple reports yesterday about it being offline on some guilds
did a bit of digging and found that out
having logs does make everything easy to monitor
i really dont think its a connection issue
im willing to bet its my pristine code
Might not be heartbeating correctly
does detritus log heartbeats?
i think it might
someone else was having an issue like that today
it re-emits all events
not receiving heartbeat acks
i think theres a ack event emitter
let me check rq
that would be under shard i assume
erwin what format do you use for your date for the logs?
If you fail to receive an ack, then you may not be sending one in the first place since Discord's ws will still send an ack in a service outage.
Although, there is the rare case ws connections become zombified and acks won't appear even if sending heartbeats. In which case, the socket should be closed and reconnected immediately
for it to appear this many times seems very sus
I had this issue before and it was a pain
Turns out, was a logical error on my end with my gateway lib
cake did patch something i found accidently yesterday
and i just updated it to the beta branch with the patch
but he's not having any issues on his bot either
99.99999999% sure its something on my code
could also be sending an invalid payload tbh. I think that also immediately closes your socket connection
detritus moment
how are these values separated?
how is the file formatted
read the file and encode it to UTF-8, then split the string contents using a regex with the global and multi-line flags which captures \d+ then sort that Array normally and return the first result
Might have to map the string Array and call the NumberConstructor on each entry though
just normal divided with \n and a snowflake before it
like this
so i already have parted the file so it only takes the 2nd part of the lines (the values)
just need to get the highest integer
my way wouldn't work out too well then, I suppose since it would capture IDs
read file -> split by new line -> sort by second word converted to number
aight i got it to log
its likely gonna spam the living shit out of my console
but fuck it
console go brr
I already parted the file so it only takes the 2nd part of the lines
so it only gets the values. That is already done
so you dont need the id that belongs to that value?
though i havent seen anything get logged yet
i need that for something else, but forget about that
Probably array.map(Number).sort()?
i can access the 2nd values of each line using m[1]
every 40 seconds or so
hmmm something is off then
is it only some shards or all shards?
all of them reconnect at some point, but its been specifically shard 1 being borked
I mean I get my bot on 1 shard reconnecting every once in a while
so thats normal
ig
but not all the time
which is your issue
Okay wait i am actually a bit confused right now
do you not log disconnects?
in my terminal i just log when shards are ready
ah
its my terminal, yes
ok makes sense
this is what the text file contains of. How can i get the max value of the second part only (so the values, not the snowflakes)?
yeah it is
that way you can use sort
array.sort((a,b) => Number(a[1]) - Number(b[1]))
you can also use reduce yes
if you only want one value
the max would only be ne tho
const array1 = [1, 30, 4, 21, 100000];
array1.sort();
console.log(array1);
// expected output: Array [1, 100000, 21, 30, 4]
``` I don't quite get why the sort is returning these values in this specific order.
sort weith a > function
is sorted by char code?
sort(a,b => b > a)
sort((a, b) => b > a)
the sort function expects a number return no?
hmm
yes it does
arr.sort( (a, b) => b - a) works
using npm, what would make a package have its own node_modules folder
im having an issue where the imports are different and therefore typescript is erroring
wot?
src/bot/worker.ts:17:109 - error TS2345: Argument of type 'import("/home/million/discord/terano-rose/node_modules/discord-rose/node_modules/discord-api-types/v8/payloads/user").APIUser' is not assignable to parameter of type 'import("/home/million/discord/terano-rose/node_modules/discord-api-types/payloads/v8/user").APIUser'.```
the issue from what I can see is that the latest version isnt installed there, causing an inconsistency with the types
a package has its own node_modules folder when it has dependencies
lololol typescript 😛
@opal plank
is there a reason why some required packages would be in the main node_modules while others are in another package's node_modules?
dev dependencies ig
its put in as a regular dependency tho
you're a regular dependency
probably if the same dependency is not used anywhere it will be in the base folder
if the same dependency is used more than once, then it will be inside their modules if the versions are different
and this is why yarn is superior
yarn v2 can go fuk itself
looks great on paper but breaks literally everything
i lost intellisense
and could not even build native modules anymore
😉
nah hes an irregular dependency
(node:2243) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
?
Your bot token was invalid.
... ok well clearly you deleted something you shouldn't have, and your token is not loading, then
you know what has docs? discord-rose
I renewed my token but the error continues
also last time i check that barely passed as "docs"
just letting you know @crimson vapor
it was legit 3 pages
Documentation for discord-rose
@umbral zealot
show your code
okey
WEW
your index.js specifically
bro
you really taking that as docs?
they work
lol
i mean ACTUALLY WRITTEN docs you dork
d.js does
its all done with jsdoc

tho
I'm like 100% certain the error is coming from DISCORD.JS, not from top.gg
hey i write docs
"docs"
Tim you're amazing tho
more like bibbles
yes
what should I do
those types are insanely big
its not the ts
imagine not using ts to generate it for you
its the doc
yea

so just use ts
show your whole index.js.
its the jsdoc thats big
i'd have to write it regardless
even if i used ts
i do have some stupidly large types, but 80% of the bulk is jsdoc
ts cant generate those for me
all?
ts is super good but its not omnipotent yet*
yes. all. the whole thing.
too long
no it's not.
just made a problem today 30 minutes ago
I am the problem
Would you like for our help, or would you like to keep debating about it?
yes it cant read minds
lol
If you knew where the error was you wouldn't need to ask us about it now would you? 😉
all index.js
?
For the 3rd time YES
okey 1 min i send the document
christ it's not even that hard to just CTRL+A CTRL+C then just CTRL+V here. smh
was hoping for token, disspointed
client.login(process.env.token); <---- so this is your login, right? In your file called exactly .env do you have a line that says ```
process=YOURTOKENHERE
???
or does it say PROCESS= maybe?
trick question, it shouldn't say process
are you actually reading my questions correctly?
What does the .env file say? Show it, except for your actual token
so
is that heroku
doesn't matter, they're partial so it's fine
what should I do
is that heroku
no
well either that's not saved, or the system isn't injecting the env values correctly, because this should all work
It started causing problems just 30 minutes ago
When I delete modules, it still gives an error
are you sure you're copying the BOT TOKEN and not, like, the client secret?
yes
¯_(ツ)_/¯
have you tried a small bot?
try reducing the code to just a core, basic example bot code and going from there
afaict all is correct, so...
maybe talk to your hosting support
make a request manually with the token
if it doesn't work, then your token is incorrect
hello, How do you remove a user’s access to a folder on debian 10?
For those who cannot open the file
const client = new (require('discord.js').Client)();
client.on('ready', => console.log('ready'));
client.on('debug',console.log);
client.login(process.env.token);
or try that ^^
FetchError: request to https://top.gg/api//bots/stats failed, reason: Client network socket disconnected before secure TLS connection was established
why
:(((((
One message removed from a suspended account.
One message removed from a suspended account.
yup
One message removed from a suspended account.
i requested it
One message removed from a suspended account.
since i lost access to it
One message removed from a suspended account.
so they can delete the account knowing you're the owner, but cannot restore your access

One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you know what?
fuck it
im dumpign everything in console
EVERYTHING

tired of this hide and seek shit with bugs
if (command == ".voicetest") {
dpp::snowflake channel_id;
ss >> channel_id;
bot.log(dpp::ll_info, fmt::format("Starting voice test! Channel: {} Guild: {}", channel_id, event.msg->guild_id));
if (channel_id) {
dpp::DiscordClient* dc = bot.get_shard(0);
dc->ConnectVoice(event.msg->guild_id, channel_id);
}
}
if (command == ".noise") {
/* This assumes that there is one shard and the voice channel's guild is is on it.
* Only for testing purposes, DO NOT make this assumption in the real world!
*/
dpp::DiscordClient* dc = bot.get_shard(0);
dpp::voiceconn* v = dc->GetVoice(event.msg->guild_id);
if (v && v->voiceclient && v->voiceclient->IsReady()) {
v->voiceclient->SendAudio((uint16_t*)noise, noise_size);
}
silly question... how understandable is this to non c++ devs? just wondering how easy it's going to be to convert people over :laughing:
i was making hotdogs :p anyway, generally not really
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
oh
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you'll have to hardcode them, otherwise how would you check for them
One message removed from a suspended account.
One message removed from a suspended account.
that's like 90% understandable to JS devs.
One message removed from a suspended account.
One message removed from a suspended account.
in fact it looks like normal JS except all the random extra pointless syntax
What is this, haskell?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
What's with languages having syntax that looks like the authors rolled their face on the keyboard when they wrote their parser?
One message removed from a suspended account.
:: >> -> * ?
One message removed from a suspended account.
One message removed from a suspended account.
not really
but dpp::voiceconn* v = dc->GetVoice(event.msg->guild_id); just looks like js with extra shit syntax to it tbh
hey, js isn't much better
I know I'm speaking from the position of a JS dev that's never done real programming, but still
One message removed from a suspended account.
cpp looks scary until you learn it
well php also uses -> for class properties and methods
the older languages have cleaner syntax because they're simpler, look at basic, COBOL, Fortran
- is used for pointers
yeah and I hate php too lol
xD
Pointer of that type
One message removed from a suspended account.
like this is, what, const voicecon = msg.guild.voiceConnection; ?
pointer to a voiceconn object... kinda like a reference on crack
One message removed from a suspended account.
pointers... references on crack
that was a good one
const voicecon = msg.guild.voiceConnection;
dpp::voiceconn* v = dc->GetVoice(event.msg->guild_id);
like I said, from my point of view, it looks like programming with a lot of extra random syntax characters
that code gets the current voice client for a guild and sends audio to it
hold SHIFT, hit a bunch of numbered keys, there's your syntax. But this isn't a CPP thing, haskell is even worse in that regards
and I think Rust too but I'm not sure.
well they're all low level langs
:: is getting a type from a namespace, -> is to access properties through pointers
so yes it's exactly like the js above it
haskell be like ```hs
eventHandler :: Event -> DiscordHandler ()
eventHandler event = case event of
MessageCreate m -> when (not (fromBot m) && isPing (messageText m)) $ do
_ <- restCall (R.CreateReaction (messageChannel m, messageId m) "eyes")
threadDelay (4 * 10^6)
_ <- restCall (R.CreateMessage (messageChannel m) "Pong!")
pure ()
_ -> pure ()
what does <- do
I have absolutely no idea
that doesn't look so ugly to me
lmao
why is there _ <- and _ -> ?
That's why I dislike purely functional langa
js is fun cuz its human redable
like I don't get it
Cause of this
method call by the look of it
its not a shitton of operators cuz you have no idea what they do
RAPID is a fun programming language, you just need a $40k robot to use it
try brainfuck
the arrow is pointing at the object it acts on
Yes. Exactly. That's precisely why I stick with JS, not because it's easier, but because it's simpler to read and parse as a human being
^^
I don't like how js builds objects
its more like a functional programming language than an object oriented one
you basically put a lambda in a dict lol
can end up with some very unreadable structures
i like it because its super hackable
I like js for web front-end
i hate front-end
where it belongs lol
can we speak about ts?
no

to me, node is like one day someone woke up and thought
"today I'm going to take that tractor engine and put it in my Ferrari. and then use it as a generator to power my washing machine using a million hacky little dependencies made and maintained by strangers..."
if its stupid but it works then its not stupid
node is really only powerful in the UI department
i'll take node for UI apps over any other language anytime
for anything else, it's a nono
three words: npm is-even module.
JS is more starting with a tractor then slowly adding more power, nitro, redoing the body, redesigining the transmission, and then eventually after a decade, you have something closer to a ferrari than your starter tractor, Brain. 😛
node.js is just V8 out of the browser
npm is ass
is-thirteen > is-even
node I can accept as an idea that works
but npm is just full of junk
like PHP composer is
I mean you don't have to use the trashy packages
you don't know if you are though
import one and it depends on a billion more under the hood
and the reason why dependencies of your dependencies of its dependencies install their dependencies
Generally downloads and github stars are a pretty good indicator
that then depend on more still
most of the time i end up building my own modules rather than using stuff from npm
except basic things like websockets and http
One moment @green kestrel, u are the developer of triviabot
yes he is
Wow, I am quite new to this
I'm developing my first bot and let's see what happens
good luck ;)
Ty
Okay so do you guys think... js would work without a gc... imagine js with manual memory management
your average node dev doesn't know how to spell their own name
there wouldn't even be memory to manage 
true
i think js could work well with manual memory
considering it's really running on cpp
its already a super simplified language, it could use some mechanism to create super simplified memory management
if they just exposed the apis
it could be very useful
for people who actually know what they're doing
well technically you already have buffers
isn't this built in to v8
which is kinda the same as malloc
Yeah but I don't think having both a gc and manual memory is a good idea
yes but not the standards
How would that work
node has tcp but not websocket according to rfc etc
so i rather use the ws package from npm
because icba making rfc stuff
Buffers still get gc-ed
I've seen someone on #osdev on IRC who made a js os, manual memory management and all the basic stuff trimmed out
but I guess you can allocate memory via them so that's kinda low-level
i think ive seen something like that
buffers are garbage collected if you lose the reference to them
but if you create global buffers then no
@quartz kindle having spent 36 hours making voice I'm sick of looking at RFCs lol
well yea isn't that the case for all objects
I've had to delve into opus, RTP, and all sorts
ye
rfc overcomplicates everything
because of compatibility constraints
simple js memory management: ```js
global.bufferCount = 0;
global.buffers = {};
function malloc(size) {
const buff = Buffer.alloc(size);
global.buffers[global.bufferCount++] = buff;
return buff;
}
function free(i) {
delete global.buffers[i];
}
xD
a simple question, how much ram is it advisable to have for a discord bot?
Shit
Hmm now 10 but i want more so
i'd say 2gb, 4gb to be safe with a LOT of room for breathing
i dont think it'll hit 1gb anytime soon
so 2 would be your "good spot"
im recommending double so you dont have downtimes in case you need to increase
on a reference for you
@earnest phoenix
2gb ram on detritus.js with 740K users and 5.5k guilds
thats why i asked if it was shit code/lib
Ok, tysm
grafana?
yup
2gb is good going
in fairness
for js
theres a LOT of stuff here
especially with caching
you have to multiply some of the stuff there
i got a lot of useless shit
image buffers stored
2 different entries for each user
so a user may end up having 3 different objects
one for my cache
one for detritus(for discord)
and one for genshin
you know,.I'd be curious to know how much ram a cached user takes up in discord.js
at the ram level natively
if you were to build a bot on this scale with detritus, you'd be looking at around a gig prob
because you got a dict/map for an object with many more inside it
i could make it a bit lighter by merging it all into a single map
instead of 3 different maps for each user-metadata
Chrome shows the size of each individual empty array as 32 bytes and the size of each empty object as 56 bytes. hmm @quartz kindle you think v8 is using STL maps and vectors? those sizes sure look like it
i
fucking
aaarg
okay
hear me out
the request is sent in buffer format
now
hear me out
without manually copying this like a retard
and idk where this is coming from, otherwise i'd be able to add a proper capture block there
is there SOMETHING i can do to convert that body into a string?
once again, i've already copied 300 numbers before and converted it
copy it outta the buffer?
well js has .toString() on Buffer objects...
dont wanna do it again
lol
and its tilting me cuz its a promise that i clearly missed
literally thing.request.body.toString() should do the trick, no?
if i were to convert the buffer i'd get the content which would tell me
in code
yes
i only got this in console
its like an array you have to manage yourself that your access to is marshalled beyond usefulness isn't it
haha
dafuq
oh
help me out here
lmao
what the fuck is this
any digit, greedy, until :
.split("\n").map(x => Number(x.split(";")[1]))
why
nono
imma use vsc to replaceall
split
oh
oh
(\d*:)(\d*)\n
just need to remove that
try \n\d;
just add the :
all roads lead to rome
all romes lead to road
all romes lead to romans

romes === sex
wut
\n\d*:
ur regex didnt catch more than 1 digit
...
ey pog
okay
so
for future reference
you can only copy stuff from the debug console that you see on screen
so, if you scroll up, everything that dissapears below wont be copied
therefore i pressed ctrl + - a couple dozen times where i could fit everything on the screen

lmao
Are you able to get a form element in js and call a submit function on it
Don't really know if thats a thing
just give it an id and get the element
I know that part
if you want to make a submit button either use the linking submit tag or just a seperate button that know's what form it's refering to
I got the document.getElementById() part
👍
@modest maple Any idea why this wouldn't click?
.submit()
👍
.yeet()
If I have 10000 servers and 10 shards, whats a good amount of clusters to have?
1
only 1?
When should it be upscaled to 2
But you shouldn't be 1k / shards
well how many shards per cluster is optimal?
2.5k guilds / shard is the perfect amount, but it's the max
So like maybe around 2k / shard
I would say, around like 14-18ish shards
Split in 2
kk
But that's already a little overkill
You won't need to cluster more
For a while
weird djs shardingmanager is taking discords recommended shard counts and is putting us at 10
for 10k servers
Wtf is this
Really!?
@rustic nova
@rustic nova
@rustic nova
LOL
-b 793233385862332446
Banned urmomsunderwear#2954 (@silk turtle)
Lol
#spamhope







