#development

1 messages · Page 195 of 1

radiant kraken
#

optimized down to the bytes

#

🤌

harsh nova
#

I wish my bot could be webhook only boohoo boohoo boohoo

frosty gale
#

too much work

#

maintaining a library all the time bc discord keeps changing the api and adding new things alongside a bot

#

it could be worthwhile if you open sourced it

#

I don't like discordjs but wouldn't feel its bad enough to make a completely new library expecially now that they added more fine tuned cache control

quartz kindle
frosty gale
#

yeah but what about new features and updates to existing ones that you wanna use

#

and you'd need them to be implemented well as well if you're considering production use

#

feel it's a mess

#

I don't use djs or do discord anymore so I don't know what the js discord ecosystem is lacking

#

discordjs pretty much has the beginner side well covered so what's really left is serious use for big bots

#

id imagine some bot devs are also fed up with djs's constant breaking changes so a stable and standardised api for a new library would already be a big plus for big bot devs

quartz kindle
#

whatever new thing discord does, i can literally add to the bot code without touching the lib

#

dont make wrappers, use the discord api directly

frosty gale
#

what do you mean by wrappers exactly

#

you mean code on top that abstracts the raw api calls?

quartz kindle
#

ye

#

like why make a function to fetch members if you can make an api call to fetch members

#

you can abstract the api call, but you dont need to abstract the entire functionality of the api call

#

the problem with discord.js and similar libs is that they abstracted everything

#

anything you wanna do, you need to do it the lib way

#

so just stop adding these middlemen abstractions to the lib and allow the user to do it the discord api way

unreal lotus
#

how do you come here?

#

i dont understand

quartz kindle
past field
#

ok here

#
async function startGame() {
                const shuffledChannelIds = shuffleArray([...eggChannelIds]);
                let winner = null;
                let eggsFound = 0;
                let eggFoundMessages = new Set(); // Set to store message IDs containing the egg emoji
past field
#

to store the egg emojis in the array

#

and ```js
try {
for (const channelId of shuffledChannelIds) {
const channel = interaction.guild.channels.cache.get(channelId);
if (!channel.isText()) continue;

    const messages = await channel.messages.fetch();
    const eggMessages = messages.filter(msg => eggFoundMessages.has(msg.id)); // Filter messages using Set
    await Promise.all(eggMessages.map(msg => msg.delete()));
}

} catch (error) {
console.error('An error occurred while deleting egg emojis:', error);
}

sharp geyser
#

What’s the problem

past field
#

to delete them after the game, right?

#

it isn't deleting the egg emojis from the channels afterwards

sharp geyser
#

Is it erroring?

#

Also be careful calling fetch in a for loop

#

It can be api spammy

#

It’ll by default check cache which messages typically are always cached

unreal lotus
past field
sharp geyser
#

But in cases where you’re fetching stuff that isn’t guaranteed to cached doing so in a for loop is ill advised

past field
#

okay so

sharp geyser
#

Also what’s the point of using Promise.all here

quartz kindle
sharp geyser
real rose
#

crazy amount of arrows on the chat

sharp geyser
#

So doing eggMessages.map(msg => msg.delete()) makes no sense

unreal lotus
quartz kindle
#

show how you store the messages in the Set

past field
#

ok 1 sec

quartz kindle
#

the idea is not to use the message ids to filter messages, the idea is to use stored messages to completely replace the fetch(), because fetching messages is expensive and not needed

past field
quartz kindle
#

and how did you define reply

past field
#

wait hold on

unreal lotus
quartz kindle
#

and then go there again

unreal lotus
quartz kindle
past field
#
let eggFoundMessages = new Set(); // Set to store message IDs containing the egg emoji
unreal lotus
quartz kindle
unreal lotus
quartz kindle
#

its free yes, but you still need to register a payment method

#

because if you go over the free limits, they will charge

past field
quartz kindle
unreal lotus
past field
#

or how did i define it in the code?

quartz kindle
past field
quartz kindle
#

you will either need to run the bot in your own computer, or ask for help from your family or parents if they let you use a card to register, explain to them that is only for registration and that its not gonna be charged anything

#

and its for education and training for future job

past field
#

honestly man idk, i may be trying to do more than i can handle 😂

quartz kindle
#

depending on where you live tho, you might find VPS offers that accept other types of payments, for example paypal or bank transfer

past field
quartz kindle
# past field

so basically, you can simply store the message itself, not just the id

#

eggFoundMessages.add(reply);

#

and then you dont need this at all

for (const channelId of shuffledChannelIds) {
                            const channel = interaction.guild.channels.cache.get(channelId);
                            if (!channel.isText()) continue;

                            const messages = await channel.messages.fetch();
                            const eggMessages = messages.filter(msg => eggFoundMessages.has(msg.id)); // Filter messages using Set
                            await Promise.all(eggMessages.map(msg => msg.delete()));
                        }
#

you can delete all of that

#

and simply do ```js
eggFoundMessages.forEach(msg => msg.delete().catch(() => { /* do nothing */ }));

past field
#

ok let me update this

#

ok so i get an error

#

saying that eggFoundmessages.map is not a function

#

says it's a set, not an array

#

and doesn't have a map

quartz kindle
#

thats why i used a forEach in my example

#

if you want a map function dont use Sets, use arrays

past field
#
if (winner) {
                    try {
                        eggFoundMessages.forEach(msg => msg.delete().catch(() => { /* do nothing */ }));
                    } catch (error) {
                        console.error('An error occurred while deleting egg emojis:', error);
                    }
#

like this?

quartz kindle
#

you dont need the try catch anymore

#

use the .catch instead

#
eggFoundMessages.forEach(msg => msg.delete().catch((error) => {
  console.error('An error occurred while deleting egg emojis:', error);
}));
#

if you want error logging for those

#

keep in mind that it will check for errors on each individual deletion

#

so your logs will be spammed if many of them error out

#

i usually dont add error logs to message deletes because the most common error is it was already deleted by mods/admins/other bots, so its not really a real error

past field
#

i like adding the logs because i’m so new and it kinda help me figure out where to look for the problem

unreal lotus
lyric mountain
#

you can, but can you sustain the maintenance?

#

also you'll have to ask your ISP for a fixed ip, which some providers charge extra for

past field
lyric mountain
#

ok tim, need to ask your help regarding browser shenanigans

#

my game runs pretty fine on chrome, but has a hard fps drop on edge

#

for some people it's the opposite

#

on mobile it's neither

#

is there any metrics or debug tools or anything to find out what might be the matter?

quartz kindle
quartz kindle
quartz kindle
#

webgl?

#

first thing that comes to mind is hardware acceleration and gpu status

quartz kindle
#

check chrome://gpu

#

and compare reports on different browsers

quartz kindle
lyric mountain
#

but yes, webgl which is what godot compiles to

lyric mountain
quartz kindle
# unreal lotus what would you choose?

before i had a credit card, i had a small laptop i would leave on 24/7
after that a friend offered me to use his vps
then i got a debit card and i used google compute engine

quartz kindle
#

because surprisingly, it can cause a lot of bugs

#

from scroll lag to stuttering and increased battery usage

lyric mountain
#

I suppose discord activities uses the same settings as discord itself right?

quartz kindle
#

ive even seen youtube completely broken with hardware acceleration lol

lyric mountain
#

in which case if hw accel is enable the activities' browser will be too

quartz kindle
lyric mountain
#

in the app, like an iframe of sorts

#

I didn't test the game on it yet, just asking

quartz kindle
#

not sure how stuff like elecron works regarding hwa

#

apparently it has its own settings which can be exposed to the user if the author wishes to

#

so idk what discord set in their app

unreal lotus
#

@quartz kindle is there nothing else free out of my house where i can drive a small dc bot for free witout a credit card?

quartz kindle
#

i think they all changed how their systems work so that bots will no longer work

deft wolf
#

Heroku is no longer free, unfortunately

quartz kindle
#

also, there are a lot of "free discord bot hosting" on the internet, but they are very limited and i dont know if they are safe

lyric mountain
#

only repl.it out of those 3 is still available

#

glitch will kill your bot the moment it finds out

quartz kindle
#

last time i checked my replit account it asked for a paid plan in order to deploy

#

it seems it now only runs while you have it open

lyric mountain
#

eh, then they jumped off the "we have free bot hosting" stance like glitch

quartz kindle
# lyric mountain eh, then they jumped off the "we have free bot hosting" stance like glitch
Replit Ask

Always On will be fully removed from the product on January 1st, 2024. After January 1st, Deployments will be the only way to host applications on Replit. For most users, Autoscale & Static deployments will be less than 20 cents per month or included in the Hacker & Pro plans. Static deployments will be free as long as you are within your egres...

frosty gale
#

i honestly dont see anyone serious using these host platforms like glitch/repl

#

youd usually have the hardware to do it on your own machine

#

i only see amateur and hobbyist projects on them and those users are mostly there bc its free

#

if you take away the free im not sure how many users that leaves them

#

glitch basically died the moment they took away uptime robot and long lived projects

#

the forum used to be extremely active now its completely dead

#

and now glitch sold themselves to some company called fastly and focused on cutting costs so that says a few things

harsh nova
#

Ain't fastly some CDN company or am I tweaking

quartz kindle
#

but at the same time you have to ask yourself, were they actually making money when they had super popular free services? or were they taking losses from it?

frosty gale
#

how tf did glitch make money

#

they did say how but not sure i 100% believe it

#

unless they were backed by some other company they had no business model

#

which leaves me to believe they either lost money all the time or resorted to shady things like selling data

#

a possible explanation could be that they were a startup project and were given funding without the necessary stress of having to cover costs yet

#

theres not much they could be selling other than shit code as it is

#

they did a poor job of moving it to become monetized in my opinion

#

multiple people expressed interest in paying for some sort of premium plan before they even had one, when premium plans came out you could only pay by card and not things like paypal which i saw was complained about a lot (i think thats still the case), their premium tier was quite expensive for what it offered and you got more bang by staying free than going premium

quartz kindle
#

the whole idea of going free for a while to gain popularity is very tricky

#

one one side it works very well, on another side it eventually backfires pretty well too

frosty gale
#

wouldnt be surprised if glitch gets shut down eventually

#

they dont really share how many clients they have paying

#

but given inactivity on the forum i cant imagine its many people

#

repl.it has a decent paid user base as far as i know

#

theyve had paid tiers since forever i think

sterile lantern
#

is it possible to parse something like "4 PM ET" and "Monday | April 1" to 04/01/2024 4:00 PM ET as a date

quartz kindle
#

back in the days we used dyndns

#

also you dont need a static ip for discord bots

#

only if you use webhook interactions

#

i still see routers today with built in support for dyndns lul

#

of course, they were manufactured in like 2010

#

its amazing how many routers being sold today are actually old af

past field
#

now i’m about to call spectrum and cuss them out

frosty gale
#

they have entire linux installs running on them

#

powerful enough to run reasonable stuff

#

i went through the firmware of one of them once for training and theyre basically entire computers

#

i would opt in to something more embedded and save costs on hardware if it was me

frosty gale
sterile lantern
#

or just a date

quartz kindle
#

most routers are bloated af

frosty gale
#

hard to find a word for it really

#

overcapable maybe

#

bloated too ig

#

my electricity is not going to good use

quartz kindle
sterile lantern
#

would Date.parse work (js)

quartz kindle
#

in js the ms lib actually does a decent job, but its pretty much hit or miss

frosty gale
#

javascript said no

sterile lantern
#

it would probably need to be formatted

quartz kindle
sterile lantern
#

does ms have good parsing

#

specifically for smth like Monday, April 1, 2024 4 PM ET

quartz kindle
#

if is that specific, youre better off writing your own

frosty gale
#

for your specific format youd probably need to write your own parser or use one that lets you specify your dates structure

sterile lantern
#

i mean the format could be flexible

frosty gale
#

or use an LLM to transform your date to something js date can understand

sterile lantern
#

i get the following from user options:

Monday | April 1
4 PM ET

#

the 2024 would just come from currentyear

quartz kindle
#

ngl thats actually a good job for ai

frosty gale
#

they are the future after all

#

it should at the very least be able to parse a date

past field
# past field

sorry to keep bothering you @quartz kindle but can you take 1 more look at this and give me some feedback 😭 i promise i’ll leave you alone after this

quartz kindle
sterile lantern
#

oh i could probably do this

#

and then specify YYYY MM H:mm etc

quartz kindle
#

looks good

past field
#

so this should delete all messages with the 🥚 emoji after the game?

frosty gale
#

promise it right now

#

make a new Promise()

past field
frosty gale
#

your promise saying to leave tim alone is this

new Promise((resolve, reject) => {
  reject("lol no");
});
past field
#

💀

#

his bot’s gonna be working off an event to detect me saying his name and it’ll reply “fuck off mo.”

quartz kindle
#

unfortunately my bot is not on this server

frosty gale
#

no one said you cant make a user bot

quartz kindle
#

well, discord did

#

:^)

frosty gale
#

discord says a lot of things

#

sometimes you just need to break a few rules

quartz kindle
#

rules are made to be broken

#

like buildings...

#

... or people

pale vessel
#

i don't think bots can even send messages here

#
{ message: 'Missing Permissions', code: 50013 }
#

nop

#

it could probably read and dm though

timber hatch
#

does anyone know if having my site in "under attack" mod on cloudflare would detriment apps' abiltiies to get the meta propertis?

I had it on, and my url would just not embed. removed it, and it is embedded.

which (for obvious reasons) leads me to believe it does have an impact.

if so, is there a rule i can add to the configuration to prevent that?

frosty gale
#

im more inclined to say it shouldnt

#

but you should test it yourself

#

but its a difficult problem because to get your sites meta props it needs to send a request and get your websites html

#

if anything else can do that why cant an attacker do the same?

past field
#

so what’s the difference between an array and a set? and when should i use which?

frosty gale
#

except many times per second

frosty gale
#

i think sets are best used when you have a bunch of unique values and need to know if they exist somewhere without attaching any data to it

#

arrays for everything else

past field
#

i was creating an egg hunt game that hides eggs in random channels, members find the egg, reply to it with an egg emoji, get the points and it’ll hide more eggs around the server until the required number of points have been reached - to which then the bot will announce the winner and delete all the messages that contain the egg emoji after the game ends

#

it was suggested to have the bot store the egg messages in an array to be deleted immediately after the game

quartz kindle
#

you can use whatever you want, objects, arrays, sets, maps, etc

#

depends on how you want to access the elements

#

use the best tool for the job

past field
#

idk yet lol

lament rock
#

Each storage medium has its use cases

past field
#

when i tap the start button, it send this message and the command functions without errors but i still get “interaction failed”

#

would it make more sense to make this a interaction reply?

#

because i’m guessing the interactions isn’t being acknowledged within the 3 secs?

quartz kindle
#

if the command is fast, use reply asap

#

if the command is slow or does something that takes a while, defer it first, then do the job, then reply

past field
quartz kindle
#

because you didnt reply

#

you used channel.send

past field
#

ahhhh ok i see what you’re saying

#

i thought that would be considered as an acknowledgement if the interaction

#

& is there a way to get it to delete the bots egg messages too?

quartz kindle
#

more than once

past field
#

i put it in the code

#

unless i still did it wrong 😭 let me check again

sterile lantern
#

people with administrator bypass these discord-based command overrides, right?

quartz kindle
#

role and member probably yes, not sure about channel tho

#

try it and see

sterile lantern
#

it worked with administrator

#

but not sure if thats the only perms that can bypass it

#

id assume so following the logic of channel perms

#

also - can bots set these permissions by themselves? nvm, they can

eternal osprey
#

Hey guys on the right i got sum extra space left. What can i put there? I actually wanted to put a nice animation, image or sumthing. My overall bot(s) are space themed.

quartz kindle
#

honestly

#

i would extend the middle area to the right

#

3-column designs are kinda oldschool, i dont like them too much

#

but

#

you could always put ads there and make money

#

:^)

eternal osprey
#

aboutta chase the bag

eternal osprey
#

ended up filling it with a random ahh chart

#

fake it till you make it, 100% fake statistics KEKW

quartz kindle
#

lmao

eternal osprey
#

I think that this is my final outcome

sharp geyser
#

Don’t put something fake there if it’s an important page

eternal osprey
wheat mesa
#

I am so confused right now

#
window.onload = () => {
    const element = document.getElementById("term-user-input");
    console.log(element.innerText);
    console.log(element.innerText.startsWith('> '));
}
                    <div id="term-6" class="terminal-command">
                        <div class="term-input" id="term-user-input" contenteditable="true">
                            >&nbsp;
                            <span class="terminal-caret" contenteditable="false">&nbsp;</span>
                        </div>
                    </div>
#

Why on earth does element.innerText.startsWith('> '); return false??

#

I copy pasted the character that gets logged into my editor to make sure it wasn't some sort of weird unicode character, but it's just a regular space

radiant kraken
#

and see what it logs

#

my guess is that element.innerText is >\n?

wheat mesa
#

Ah 160 is a no break space, not a regular space

radiant kraken
#

yup

#

try /^>\s/.test(element.innerText) instead

wheat mesa
#

element.innerText.startsWith(>${String.fromCodePoint(160)}) works instead

#

thanks null

#

I hate js

radiant kraken
#

though i recommend the regex alternative

surreal sage
prisma nebula
#

hey guys, anyone knows why this command stopped showing after making it guild only


    @commands.hybrid_command(
        name="update",
        description="This command is used to send update embeds.",)
    @app_commands.guilds(discord.Object(id=guildid))

like after adding this part: @app_commands.guilds(discord.Object(id=guildid)) it stopped showing even in the private guild itself.

old sonnet
#

guys im tryna make my bot work for user apps, i dont really know how they work but like how do i deploy the commands to the user? I authorize it but idk where they should appear, im guessing everywhere right? Unfortunately they dont so can some1 help plz

deft wolf
#

25 days of waiting for Discord's response but it was worth it, one polish bot advertising all kinds of shops selling accounts and various other morally questionable things less 😊

frosty gale
#

since when did discord tell you the outcome of a report

deft wolf
#

I have no idea, but the report's result is visible to the naked eye

lament rock
frosty gale
#

@quartz kindle on reddit people are getting mad at rossman because he uses the word "rape" to describe what companies do to us

#

it is the stupidest thing ive ever seen

#

its worrying people are getting more mad over the choice of words rather than the slow violation of rights that is happening

proven lantern
eternal osprey
#
let message = await member2.send({
          embeds: [botInfoEmbed],
          components: [action],
        });
        const collector = message.createMessageComponentCollector({
          componentType: ComponentType.Button,
          max: 1,
        });

does this work on dms? Cuz it ain't working for me, i get the TypeError TypeError: Cannot read properties of null (reading 'id'

eternal osprey
#

strangely it is coming from that js componentType: ComponentType.Button,
line..

lyric mountain
#

@radiant kraken turns out it was a browser issue all along

#

Tim was correct, browsers don't use gpu by default

#

So I had to optimize the hell put of it lul, doesn't lag as much now

outer smelt
frank vector
#

hello

lament rock
#

On a note usually nobody takes seriously because it would be a lot of refactoring, consider not using a monolithic library like djs. It's a trap

#

Or libs that introduce too many layers of abstraction

quartz kindle
quartz kindle
lament rock
#

yes

#

exactly

pale vessel
#

smh

lament rock
#

wdym smh

#

They're really good (like legitimately not biased)

quartz kindle
#

legit

pale vessel
#

yeah, i've used tiny-discord before switching languages

lament rock
#

Im actually being so fr. I prefer it this way than djs

pale vessel
#

had a few issues but tim fixed em

#

🐐

lament rock
#

tim is the goat

pale vessel
#

i'm using twilight for gateway and tonk's crate for webhook

#

i wish there's something better for gateway. twilight seems a bit too modular for me. i just need a simple gateway implementation (without having to bother with sharding or reconnects)

quartz kindle
#

a goat who doesnt work, constantly procrastinating

#

xD

lament rock
#

Perhaps getting paid would change that

radiant kraken
pale vessel
#

that's even worse

#

i don't need the features

radiant kraken
#

dont they have feature flags or something

pale vessel
#

hmm, never rlly checked

quartz kindle
radiant kraken
#

become Veld's assistant

sharp geyser
#

That’s too low of a position

#

Also unless Tim knows front end or C# then idk

radiant kraken
#

who knows

#

maybe he does mmLol

frosty gale
#

chief optimizer of the v8 engine

acoustic bough
#

rewrite v8 in rust

frosty gale
#

v8 is written in a relatively memory safe style so i doubt thatd be a big improvement

#

and theyve already kinda did that with deno

#

now we have bun

#

i wish they gave it a better name because i cannot in good faith answer "i wrote my program in BUN"

#

sorry in good @sage bobcat

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

acoustic bough
#

(the runtime, the package manager is fine)

frosty gale
#

bun is cooked

#

it was supposed to be much faster

#

and i think it is if you use their built in way of doing things like http servers

wheat mesa
#

Because the "benchmarks" bun did in their showcasing of it were biased af and never modeled real world situations

quartz kindle
#

bun focused on "startup performance", and then marketed it as runtime performance

#

sure, it runs faster than node, at starting up amd shutting down, only that lol

neon leaf
#

It is also the built-in web server of Bun even though µWebSockets.js for Node.js runs 80% faster than Bun.

#

idk what they did

quartz kindle
#

lmao indeed

neon leaf
#

but it sounds bad

solemn latch
#

👀 so, what cases would bun be better?

Creating/deleting workers or something?

neon leaf
#

convenience

quartz kindle
#

spinning up instances

#

like cf workers

#

run on demand

#

even then difference is probably gonna be negligible

quartz kindle
solemn latch
#

So, realistically not much benefit

neon leaf
#

speed wise not really yeah

#

but the experience is on another level

solemn latch
#

👀

#

The handful of times I've used bun I really didn't notice much experience benefits.

It just was quicker to get started

neon leaf
#

I mean

#

it depends on what you do

#

personally being able to use cjs / esm in the same file without weird workarounds is a life saver sometimes

#

or just being able to bun run blabla.ts

#

no tsnode or others needed

#

it just works

#

(sitll will use node tho)

solemn latch
#

But it does help for sure.

frosty gale
#

absolute waste of contributors time

#

at least deno adds on a lot to nodejs like typescript support, more web apis, etc

#

better package manager too

frosty gale
#

even though its been already written in a good enough performance language

radiant kraken
#

do people even still use bun

#

because i think the hype died down again mmLol

craggy pine
neon leaf
#

idk if im hallucinating but it seems to cache code or something

#

like

#

I update a file

#

and it does NOT do what the file says

#

like the array isnt being pushed to

#

but when I push while adding some random comments it sometimes works

#

it works fine in node

frosty gale
#

#remotecodeexecution

neon leaf
#

it isnt

#

it uses template string shit

frosty gale
#

fancy

#

but then this kind of thing looks like its hard to sanitize

neon leaf
frosty gale
#

so im not convinced this would be fully safe to run

#

would wanna try it myself

#

shell commands arent like sql where you can use templates and have values be handled separate from the actual query ofc

proven lantern
sharp geyser
#

How does this work

neon leaf
#

exactly like that

sharp geyser
#

💀

#

Well I can see the output

#

Not how it resulted that way

neon leaf
#

the rest is done by js

sharp geyser
#

Yes I can read I just do not understand how this is possible

neon leaf
#

do you notice that there are no ()

sharp geyser
#

Yea

neon leaf
#

yes

#

its a template string function when you do that

#

its just what it does

sharp geyser
#

Idk what that even is

neon leaf
#

just a function that is called with a template string

sharp geyser
#

Why is that possible

#

😔

neon leaf
#

yes

#

why not

lament rock
#

why not indeed

frosty gale
# neon leaf

so they have this shit but they wont add decorations

spark flint
# neon leaf

you can also do js const ts = (...d) => console.log(...d)

#

🎉

#

i love making unnecessary code KEKW

sharp geyser
#

😭

#

I am confused on what js is actually doing here

spark flint
#

d is an array of anything passed through

sharp geyser
#

right

spark flint
#

not an array

#

but like

#

wait yeah an array

#

then ... spreads the array of whatever you call it

sharp geyser
#

but how does using a template string instead of a normal function call result in this behavior

spark flint
#

myheads not working

sharp geyser
#

what is js doing to make it result this way

spark flint
#

tbh idk

sharp geyser
#

@quartz kindle

#

answer you js freak

spark flint
#

me and js are in a "if it works it works" relationship

sharp geyser
#

ill just get time to explain it

#

or better yet I can dm voltrex

spark flint
#

i wish. volty was still here

pale vessel
#

it was introduced in ES6

neon leaf
#

I think I should go to sleep

sharp geyser
#

There’s no public information on that from what I’ve seen and you’d have to find that out yourself by looking at the response headers

#

Though if anyone knows it off the top of their heads then props to them

frosty gale
#

not a good idea hard coding it anyways since they can change it at any time

#

think thats their reason for not publicly stating rate limits

#

they want you to use ratelimit headers to know when to back off

#

but doesnt take into account global ratelimits however

sharp geyser
#

Rate limit specific routes don’t conform to global rate limits iirc

sharp geyser
eternal osprey
#

ghellooo, does anyone here have some suggestions on fixing how the dashboard looks?

#

idk it seems... ugly for some reason but i can't place it

radiant kraken
#

aligning it with the line

eternal osprey
#

say less

past field
#

If anyone is willing to take a look at this, I would appreciate it!

#

I've created an unscramble game. Been working on it for 2 days now lmao, and I got everything working perfectly. Lobby, buttons, game function, it's all working.

#

The only issue is when I start another game, it displays the letters of the previous game instead of only the new game.

#

Any help would be so greatly appreciated.

#

I am new to this and learning something new everyday so the code may be a little sloppy..

#

this is discord.js v13 by the way

digital swan
humble gyro
#

Look into content hierarchy

#

Everything feels equally important

#

Chart has no dimensions idk what they mean

past field
# past field

so i’ve boiled the issue down to the handling of the start button.. i think

humble gyro
#

Kinda feels like your dashboard is your landing page for new users

wheat mesa
# past field

I haven't read all of this since it's a big snippet, but why is ```js
function unscrambleWord(word) {
// Placeholder for actual unscrambling logic
return word.split('').sort(() => Math.random() - 0.5).join('');
}

#

This doesn't make much sense

#

Or perhaps your functions are named poorly and you meant this to be scrambleWord

past field
#

i just feel like the game is not actually ending

#

i run the command once, it works great, then i run it again and get a error that the join button has been acknowledged already

sharp geyser
#

💀

#

oh god

past field
#

it’s like it doesn’t reset after the first game

sharp geyser
#

please dont turn into noob

past field
#

i know 😭😭

past field
radiant kraken
wheat mesa
#

This scrambles the word, not unscrambles it

radiant kraken
#

then its a chatgpt issue ig

frosty gale
#

just not very often

past field
#

💀

#

andi get this error with the secondtime i use the command

#
DiscordAPIError: Interaction has already been acknowledged.
    at RequestHandler.execute (C:\Users\Maurice\Desktop\Da-High-Roller-Bot-main\node_modules\discord.js\src\rest\RequestHandler.js:350:13)       
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RequestHandler.push (C:\Users\Maurice\Desktop\Da-High-Roller-Bot-main\node_modules\discord.js\src\rest\RequestHandler.js:51:14)     
    at async ButtonInteraction.reply (C:\Users\Maurice\Desktop\Da-High-Roller-Bot-main\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:103:5) {
  method: 'post',
  path: '/interactions/1226838581797195797/aW50ZXJhY3Rpb246MTIyNjgzODU4MTc5NzE5NTc5NzpQa0drVGt5bGowYlA2S0F2emJiNk1TQ0pISEpNQ09Xc2U5dmV3VFZkRThIMm03TG1mMXlQV05XbVdGN3Z0NmNGb0tMc2x2UHNYR28wdnZOMlNuZ0NoOVZkeVFYYm9CY0lOZmdQOTZOZnk2N2NBeTloWm5EZG45MHhib3g2TmRXTA/callback',
  code: 40060,
  httpStatus: 400,
  requestData: { json: { type: 4, data: [Object] }, files: [] }
eternal osprey
#

I can't lie, designing is like really hard. I love the coding part etc, but i am just not a very creative person. When working as a real web developer for a company, you usually get all the designs already right? Or do the expect you to be a web developer as well as a designer?

quartz kindle
#

missing "narutimate ninja plan"

eternal osprey
quartz kindle
#

if they can afford separate designers and coders, sure

#

if not, you do everything

#

overworked one-man army superstar employee for a startup company

#

earning minimum wage

#

:^)

eternal osprey
#

yeah fuck this whole coding journey. Good that i chose a double bachelor being software developer and data science instead of just software 😭

quartz kindle
#

:^)

eternal osprey
#

Nahhh in data science i will do data sciency stuff such as data mining and.. sorting.. big data.

#

Annddd

#

i get to lie and people will believe me

quartz kindle
#

xD

eternal osprey
#

exactly what i am doing as well hhahah

#

you can choose a certain path to follow as well right?

quartz kindle
#

im stealing wifi from my neighbours because i have no internet at home for 3 days now... still waitig for shitty isp to come fix

lament rock
#

Wish I was professionally taught cpp

eternal osprey
#

what's that specific thing

#

i don't agree

quartz kindle
#

study all the things only to become a comedy writer

eternal osprey
#

Many self taught programmers, again not everyone, but a reasonable amount don't really use the coding conventions. I also really think that taking cs at university programs your mind in the way you are thinking. But that's my opinion

lament rock
#

I cannot get into cpp because getting started seems very hard from the tutorials I've read/watched. Maybe I didn't look deep enough or misunderstood something, but I gave up after that because I'm lazy af

#

I alr know other languages I can perfectly work in

#

Unity cs is fun

eternal osprey
quartz kindle
lament rock
#

Java web applets

eternal osprey
#

damn java is my bb girl

quartz kindle
#

jabba

eternal osprey
eternal osprey
#

SwInG freerealestate

lament rock
#

I have depression every time I have to do java work

#

actually I just have that all the time nvm

quartz kindle
#

i have depression everhtime i work on my api

#

:^)

eternal osprey
#

i have depression whenever i need to code haskell

quartz kindle
#

you know whats funny, i made the first version of my api like 4 years ago, and i was like, ok im gonna redesign this from ground up and make it much simpler and better.
today the new version is 10x larger and overcomplicated

#

and still not done

eternal osprey
#

what is the api like?

#

what's it used for

quartz kindle
#

some bullshit

#

planets and shit

radiant kraken
#

right now i am around half-proficient in C++ but i still find 90% of its documentation overly technical and complicated

#

C++ is probably the most overly technical programming language

wheat mesa
#

C++ would be great if they could revamp it in modern day standards

#

It’s just very urban-sprawly

spark flint
#
await new Promise(resolve => setTimeout(resolve, 1000))```
#

i do that

deft wolf
#

Same

lyric mountain
#

wrap it into a function for simplicity

spark flint
radiant kraken
#

too lazy to write it into a util.ts file

harsh nova
#

Wild that functionality ain't provided out of the box

pale vessel
#

await require("timers/promises").setTimeout(1000);

radiant kraken
#

LMAO

#

it actually is provided out of the box

neon leaf
#

I just use my own libraries in all my projects that include all the utils ill ever need

#

👍

eternal osprey
#
  <div class="row">
        <div class="col-lg-6 mb-4">
            <div class = " d-flex flex-row" style = "border-radius: 15px; box-shadow: 0px 0px 15px rgba(0,0,0,0.3)">
            <div style="border-top-left-radius: 15px; border-bottom-left-radius: 15px; border:none; background-image:url('./192-ai-3.png')" class="card">
                <div class="container-fluid w-100 d-flex flex-row">
                </div>
            </div>
            <div class="w-100 d-flex flex-row">
                <div class="card-body p-3">
                            <div class="numbers mb-4">
                                <p class="text-dark mb-2 text-sm text-capitalize font-weight-bold">Your Metrics</p>
                                <canvas id="chart"></canvas>
                            </div>
                    <div style="height: 2px; background-color:#E60E8D" class="w-100 container-fluid"></div>
                </div>
            </div>
            </div>
        </div>
    </div>```

can someone tell me how i can move this piece to the top?
#

I want it to fit, but i use a grid bootstrap system..

lyric mountain
#

you mean fit in that empty slot below the first 2 white cards?

#

if so, you cant, that's not the correct layout for the task

eternal osprey
#

what shoul i do then

lyric mountain
#

use flex layout

eternal osprey
#

so not grid layout?

lyric mountain
#

grids work strictly with rows and columns

eternal osprey
#

shi

lyric mountain
#

rows cannot be crooked, as you imagine

#

neither can columns

#

you need a layout that doesnt use them, so flex layout

eternal osprey
#

i was able to do it in the end by using negative margins

lyric mountain
#

dont recommend it

#

it'll invade other elements' space if they have their size changed

#

and it'll not be responsive, which goes against bootstrap's purpose

late oak
#

Hey there! I'm the admin of a Discord server. I added it to Top.gg in order to be able to bump the server. However, I get a notification saying that the server has been discontinued. That happens when I click on the "edit" button from the server, on my profile tab. When I click on "view" I get redirected to a 404 error page". I would like to know what caused this problem and how I can get if fixed. Thank you!

gilded plankBOT
#

@late oak

Servers have been removed as they were getting harder to moderate. For more info, please read: #announcements message

stark abyss
#

i tried doing npm start which i normally do to start the server but it didnt do anything
then i tried npm install but nothing happens
none of the npm commands are working
no errors, doesnt exit program

#

Apparently restarting the computer fixed it..

lyric mountain
#

is it windows?

latent badger
#

hi

stark abyss
#

Yeah

dusky idol
#

can someone quickly help me?
Why are many servers the bot is in throwing this error?

  File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 173, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\ASUS\OneDrive\Desktop\jjkb\cogs\utility.py", line 426, in help
    await ctx.reply(embed=embed, allowed_mentions=disnake.AllowedMentions.none(), view=view)
  File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\context.py", line 377, in reply
    return await self.message.reply(content, **kwargs)
  File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\message.py", line 1997, in reply
    return await self.channel.send(content, reference=reference, **kwargs)
  File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\abc.py", line 1655, in send
    data = await state.http.send_message(
  File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\http.py", line 415, in request
    raise Forbidden(response, data)
disnake.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
#

It's not missing perms for sure, the bot has Admin perms in many of those servers

#

it's working fine at the support server, and it was working absolutely fine a while back in every guild it's inside.
Now it's somehow giving this error? Even in one of the servers i own it's giving this exact same error

#

Even tho it does have Admin perms I checked twice

#

okay it's working fine on the support server but not working at all in any server it's in, odd?

quartz kindle
dusky idol
#

even tho the bot can see the channel and everything

wispy frigate
#

my bot stopped showing external emojis, is there permission issues going on?

dusky idol
#

It's working fine at support server. Not in my other server, not at any server it used to work properly. I reloaded it, but it didn't help.
The bot's in about ~3000 servers now

dusky idol
quartz kindle
#

does the invite link have both bot and command scopes?

dusky idol
#

yes I believe so

#

I even gave it a role with "admin" perms

#

at my own server

#

but that did not help

dusky idol
#

i don't get why out of all servers it working absolutely fine at support muidead

#

could it be a discord rate-limit

quartz kindle
#

does disnake provide any way to log the http request data?

dusky idol
#

And it's an autosharded bot btw, i sharded it like a week ago if this helps the case by any chance

lyric mountain
dusky idol
#

i checked there are 3 shards now and it's an autosharded bot as I said before, im uncertain if this is anywhere linked to the error but id just throw this info in

quartz kindle
dusky idol
#

makes sense

quartz kindle
#

can you log the channel ids the messages are being sent to?

dusky idol
#

i tried removing autoshard but it doesn't run the bot

quartz kindle
#

and confirm the ids are correct

dusky idol
#

so the message should go in the channel the command got ran in

#

it works correctly at support

#

but then it doesn't work at my other server, i even gave it the highest possible role

#

at a partnered server something similar happened, it worked once and then stopped

lyric mountain
#

what error btw

dusky idol
lyric mountain
#

yes, I mean the message

lyric mountain
#

hm, what's ur current code?

dusky idol
#

i mean the help commad just throws a simple embed

#

no connections to database or anything

lyric mountain
#

the bot's code, from capturing the command till showing the embed

#

my guess is that you're trying to send a message or do something in a channel that your bot cant access, which is locking further commands

lyric mountain
#

did you try reducing your bot to nothing more than a single ping command that sends an embed?

#

like, literally just connecting to discord + the command

dusky idol
#

leme try making a command like that

lyric mountain
#

wont work for testing purposes

#

u need a clean slate

#

make a new project

#

if it does work, then it's what I mentioned earlier

#

in which case debugging with breakpoints could bring you to the issue

#

if it doesnt work...well, you'll need a priest

dusky idol
#

I made this command pretty much

#
    @commands.command()
    async def cute(self, ctx):
        await ctx.reply("hello")```
#

it works at support

#

but not at other servers

#

the pull command is working

#

but others are not in the same server muidead

lyric mountain
#

did you try with a clean project?

dusky idol
lyric mountain
#

btw what's in utility.py line 426?

lyric mountain
dusky idol
#

yeh gotchu

#

its this

lyric mountain
#

add a single embed command, dont need to be fancy

dusky idol
#

wait can i run the same token in 2 projects

lyric mountain
#

yes

#

just dont use the same prefix

#

I mean, it wouldn't matter, but just so you dont trigger both runtimes at once

lyric mountain
#

odd naming on that lib

#

oh also

#

do you have any links in your embed?

#

including thumbnails

#

because that requires another perm

dusky idol
dusky idol
lyric mountain
#

nvm then

dusky idol
#

it sometimes work

#

wait

#

it fixed automatically

#

for now at least

#

i havent checked all servers

lyric mountain
#

better to still chase the issue nonetheless

dusky idol
#

yes

lyric mountain
#

the worst bug is the one that solves itself automatically

dusky idol
#

yeh it happened in multiple servers i havent checked all of them yet

#

it'd work for a few commands and then stop workin and throwing the same error

lyric mountain
#

try the clean slate test, to see if it works 100% of the time

dusky idol
#

do you mind if I invite you to the support server for once

lyric mountain
#

if it does, you'll need to follow the execution with a debugger

lyric mountain
#

to see where it stops

quartz kindle
#

its hard to pinpoint the problem without http logs

#

but my guess is either discord is fucking up, or disnake is

dusky idol
#

could this be it? I mean seems so

lyric mountain
#

that'd make sense

dusky idol
#

yeh, it was a pretty odd error

quartz kindle
#

yeah

dusky idol
#

Ah okay it was actually a discord side error then

dusky idol
real raven
#

is it normal that after some days of uptime, my bot's CPU usage increases a lot?

First day i have like 60% CPU usage
After 7 days it is like 300%

quartz kindle
#

how many guilds?

dusky idol
quartz kindle
#

ye usually ram is the first thing to solve

#

its always caching

#

most libs are very cache heavy

low orbit
#

Tim do you still maintain that light djs?

quartz kindle
#

ye but its pretty much abandoned right now, only works for djs 13

dusky idol
#

ye even tho we have a 7gb ram hosting it fills upto 4gbs after 3-5 days or running the bot and makes it slow, i just reload it once and it solves everything so I never botheredxd

craggy pine
quartz kindle
#

:^)

craggy pine
#

r00d

#

But true.

quartz kindle
#

tiny-discord has also been abandoned for like a year now

#

but i will get back to it i promise

#

good thing it doesnt really need any updates to keep working

lament rock
#

ever since they yeetus deleted Structures from djs, my light djs lib has been unmaintained

#

could inject into the prototype chain

quartz kindle
#

rip

#

it was a pain indeed

dusky idol
#

But there's one issue I'm going to face in future, it's the database
When I first started the bot, I didn't know it'd outgrow this much. I mean it just went gas gas and now has tons of users muidead
I used mongodb while making it, and that's legit the only database I know how to use so far I'm no extremely experienced developer
As it's on free plan of mongodb which comes with 512MBs, it's often slow when there are too many requests or etc and the bot's overall data coveres around 30mbs of storage so far which is too much considering it only stores text.
Soon enough I'll have to either upgrade the database or move to a different one. Well that's one thing I'm always worried about for now.
What possibly is the best solution here? Right now everything is fine but in future changes will be more than needed

quartz kindle
#

i did manage to workaround it tho in v13

#

but it was pain

lament rock
#

oofer gang

quartz kindle
#

but otherwise you can do the same with mongo community edition i think

dusky idol
#

hm

#

but how hard is it going to be to move the data and make it work properly in sql

quartz kindle
#

get another vps from the same provider so they are in the same network, so requests between both vps's should be 1ms max

dusky idol
#

id have to re-write the entire code i believe, that's shit ton of work

quartz kindle
#

ye moving from mongo to sql is not that simple

#

you're gonna be fine with mongo

#

it just needs a lot of power, so a dedicated vps for it is a good idea

#

i believe mongo is configured by default to use as much ram as possible, or at least thats the recommended configuration

#

so its pretty much made to run in a dedicated vps

#

also, if you dont have any complicated systems and commands, check if your bot would be compatible with a slash-command-only webhook interactions mode

#

that would singlehandedly eliminate all cpu/ram/sharding issues from the bot itself lol

wispy frigate
#

was using mongoose for anything mongodb

quartz kindle
wispy frigate
#

it made concurrent transactions a big deal faster

dusky idol
dusky idol
digital swan
#

if youre with digitalocean they do managed databases starting at $15/month and itll make the setup and getting started way easier for you

quartz kindle
#

it uses 100-150mb ram

dusky idol
#

Interesting

#

What's your bot about overall

craggy pine
quartz kindle
#

astrology charts and calculations

dusky idol
#

Oh interesting

quartz kindle
craggy pine
#

Oh?

quartz kindle
#

all commands are sent via webhook and return an http response, like a webserver

#

there is no websocket at all

dusky idol
#

For now I'm just learning web development, once I finish it off I can get back to sql

#

And I do plan on making a lot of projects while I'm at that

quartz kindle
#

nice, keep it up

radiant kraken
#

serenity or twilight

harsh aspen
#

MongoDB FTW!!!!

quartz kindle
#

yes, mongodb fuck the what

radiant kraken
#

mongodb ftw until you get ransom'd

lament rock
#

mongodb Fucks The Web

quartz kindle
lament rock
#

sounds like freenom

eternal osprey
#

I changed my dashboard

#

it;s still a sensory fuckton overload

#

but i like it more compared to the previous one

#

i mean it's gotta be an upgrade right

sharp geyser
#

Sqlx

#

It’s what me and null use

eternal osprey
#

shitlib trying so much to deviate from sql for no reason, while in the end it still uses sql itself under the hood.. shitty and hypocrite how bout that

#

i don't even know why peole are trying to invent no-sql databases? Like isn't it good to have one database language that can be used for almost all database libraries as sql does? If you learn mongo, that's all you can use. Such a specific syntax etc, you can only stick with mongo.

real raven
# quartz kindle how many guilds?

Just thirteen

The embed upside is the uptime of five days
The embed downside is the uptime of 1 minute

Idk if its weird that im not having too much increase of RAM usage past the days but im having too much increase of CPU

quartz kindle
real raven
quartz kindle
#

your measurement is incorrect, so the 200% cpu value is not the real value

#

process.cpuUsage() is not so simple to use, it does not return any usage values

#

it returns cpu "time"

#

and measuring cpu time requires waiting

#

check this

lyric mountain
eternal osprey
#

Works awesome

eternal osprey
#

@lyric mountain

#

Call me mister responsive the way i make my designs responsive at all times

past field
#

i want to get the steps correct for using better sql3 for database, i have a “schedule post” command.. i would create a new table and have the rows “message” “time to post” “date to post” to save them right?

craggy pine
#

It's also pretty normal to have a column called "id" with an incrementing value as a primary key

eternal osprey
past field
#

ok, i’ll try when i get home

lyric mountain
#

also make them all NOT NULL, having the least amount of nullable fields impact positively on your query speeds

#

bonus point if any of them can be UNIQUE (as that prevents the query from searching for more matches, since it's guaranteed there wont be any)

#

tho with the columns you mentioned u wont be able to make any of them unique

#

aside from the PK, that is

eternal osprey
#

Spark RDD's + coalesce = 😭

#

I once had to work with a commoncrawl crawl that contained 5tb data. We had to shift all data around to spread it evenly over our machines to reduce workload on some machines that were really imbalanced compared to the rest.

#

Took me a day to execute that coalesce command and it still did not balance it, maybe even increased the imbalance.

neon leaf
#

how and why is this using 16gb ram on a 10gb file

sharp geyser
#

it just is

#

ty come again

lyric mountain
neon leaf
#

that .compress currently is a placeholder

#

it does nothing

lyric mountain
#

not what I meant

neon leaf
#

uh

#

what did you mean then

lyric mountain
#

for example, let's say you have a 100x100 png file

#

let's say it occupies 1kib for the sake of simplicity

#

when you uncompress that to bitmap (24 bytes per pixel (8R 8G 8B 8A)) it'll occupy 240000 bytes, or ~234kib

neon leaf
#

I mean

#

I get that, however the file is just zeroes

lyric mountain
#

matters even more

#

as a file full of zeroes will have like 99% compress ratio

#

since it's a long repeating pattern

neon leaf
#

but why would it be compressed, and why would node uncompress it without me telling it to

lyric mountain
#

cuz you cannot do anything with a compressed file

#

you HAVE to uncompress it into ram

#

tho you should be able to transfer the file without uncompressing it by sending the bytes directly

#

ik I can in java at least

quartz kindle
#

maybe you need to do it yourself, not sure if all streams do it automatically

neon leaf
#

I think they do, however

#

the issue may be bun

#

its doing its weird code caching again

#

my abort listener didnt work

#

I add a console.log above it

#

it works fine

quartz kindle
#

the read stream is reading faster than the write stream is writing

#

if backpressure is not done correctly, there will be no read limit

neon leaf
#

why would it read 2gb on a 500mb file if that was the case tho

#

I need to test if this works fine in nodejs

#

wow nodejs

Error: Cannot find package '/home/robert/projects/rjweb/runtime-generic/node_modules/rjweb-server/package.json' imported from /home/robert/projects/rjweb/runtime-generic/test/index.js

quartz kindle
#

lmao

neon leaf
#

(I can cat it fine)

#

bruh

#

why is it even trying to read

#

its literally embedded in the bundle

neon leaf
#

ok so had to rewrite my build process

#

anyways so aborting works fine now

#

and the memory leak is gone

#

wow...

#

and my headers are fixed

#

@quartz kindle bun moment

quartz kindle
#

are you using bun-specific code? or nodejs code in bun?

#

bun has their own specific webserver stack

neon leaf
#

because nodejs likes complaining I used bun to test my generic runtime

#

I have 2 runtimes

#

bun and generic

quartz kindle
#

then same issue happens when using bun's http and bun's webstreams?

neon leaf
#

nope

#

buns http is fine

quartz kindle
#

then the problem is bun's nodejs compat

neon leaf
#

ye

quartz kindle
#

i heard their nodejs compat has a lot of issues still

#

since the beginning

neon leaf
#

also funny thing

#

the generic runtime is faster than the bun one

quartz kindle
#

generic as in what? running jsc/v8 directly?

neon leaf
#

generic = using the http lib in nodejs

quartz kindle
#

ah

#

so node http is still faster than but's own http lmao

neon leaf
#

I mean from my tests yes

#

but I have an abstraction layer above both

#

so it may be that the bun one is coded bad

#

(their fault for having a shitty http api)

quartz kindle
#

well, the uws maintainer did say that despite uws being embedded into bun, its still slower than running uws in node

neon leaf
#

yeah

#

their api uses new Response() basically

#

nothing manual

#

so I basically buffer all the data until I can write

quartz kindle
#

so essentially, bun failed at everything it promissed to excel in

neon leaf
#

probably

#

the ws api is fine though

#

same as uws pretty much

quartz kindle
#

ye

neon leaf
#

their bundler also still does not support cjs

#

so im using ttsc,

...which is faster for some reason

#

idk either my system is cursed or bun is

quartz kindle
#

xD

neon leaf
#

what the fuck

#

@quartz kindle are you familiar with the ws library

hidden gorge
#

someone explain is it possible to get a null status code?

wheat mesa
#

I don’t think so no

#

Unless the status property is part of the actual data object returned by the request

#

If it’s a header then I think it has to be present

hidden gorge
#

LMAO I SEE WHY NOW

wheat mesa
#

Yeah you didn’t await anything

hidden gorge
quartz kindle
quartz kindle
neon leaf
#

i think ur a magician

#

u said lmfao

#

and my code started working

quartz kindle
#

oh?

#

xD

neon leaf
#

beautifully awful

quartz kindle
#

oh you're making ws with http?

neon leaf
#

yeah I need to implement abstractions for websockets and http to my library

quartz kindle
#

nice

#

at this point making your own ws/http is some sort of rite of passage to graduate from djs

#

lmao

neon leaf
#

yeah

#

idk if im gonna make an uws runtime too

quartz kindle
#

uws abandoned their ws client afaik, so they only have a ws server

neon leaf
#

did they ever have a client? xd

quartz kindle
#

they did, long ago

#

djs even used it at some point

neon leaf
#

wow

quartz kindle
#

as an optional addon

neon leaf
#

didnt know that

quartz kindle
#

but apparenlty it gave problems, so they stopped recommending it

#

then removed it altogether

#

the uws maintainer also removed the client from uws at some point

neon leaf
quartz kindle
#

because a websocket client is like, whatever, just throw anything at it and it will work alright

#

a ws server is where the problem is

neon leaf
#

yeah

quartz kindle
#

because scaling and shit

#

i only made a ws client for my discord lib, didnt make a server

neon leaf
#

its not too hard, just too annoying for me to do from scratch

#

like I need to write my own types smh

quartz kindle
#

the problem with a ws server

#

is that there are a shit ton of specs variations and extensions you need to support, if you wanna be compliant

#

there's the whole autobahn test suite

neon leaf
#

yeah, a http server is way simpler

#

(atleast http1.1)

quartz kindle
#

ye

#

i wouldnt wanna mess with http2

#

http3 is even worse

#

the whole http3 draft has been experimental for like 5 years now

#

lmao

#

theres like 30 versions

neon leaf
#

I think uws also still barely supports 3.0

quartz kindle
#

ye

neon leaf
#

and its not even in the type definition i think

#

gonna love releasing a major update to my webserver tomorrow and 5min later noticing a billion issues

quartz kindle
#

xD

#

the terror of lib devs

neon leaf
#

yeah