#development

1 messages ยท Page 1 of 1 (latest)

sharp geyser
#

These are the things I am worried about though. Designing the entire lib in a way it is able to be used easily is my challenge here

earnest phoenix
#

If you can't figure out a design principle for some parts, just let it be, it's probably for the best

plain talon
#

1000001742022389780

#

new digit

sharp geyser
#

Should I go straight for handling the gateway or should I build up other parts first

earnest phoenix
#

Always go for the important parts first, AKA handling the gateway, caching, ratelimits, etc etc

sharp geyser
#

Alright

#

I am starting from scratch again

#

so lets go

#

I kinda wanna experiment with decorators in this project

earnest phoenix
#

DiscordAPIError: Invalid Webhook Token

#

I am trying to edit my interaction with interaction.editReply({})

#

printing interaction gives me SelectMenuInteraction object

#

like what the hell my interaction just worked perfectly fine 20m ago

rancid tulip
#

Discord's side is having issues with those responses since 19 digit snowflakes have hitted.

earnest phoenix
#

ooohhh makes sense

plain talon
#

yeah it seems like discord hardcoded 18 length on interactions

#

silly!

earnest phoenix
#

oh right when I was doing some memey stuff I noticed it would hit 19 length

sharp geyser
#

That doesn't make sense

plain talon
#

idk just guessing i dont work for discord

#

but some stuff is broken since the change

#

the only explanation is field length

#

because snowflakes dont change programatically just cuz its gotten longer

sharp geyser
#

Discord is aware of the situation it seems

#

Someone said an employee responded to the situation in the large bot dev channel in the discord api server so hopefully it gets fixed soon

plain talon
#

hang on

earnest phoenix
plain talon
#

even mee6 is broke

earnest phoenix
#

I was taking pictures of my cool bot embeds ( as a preview on the site ) to upload it on my top.gg bot page ๐Ÿ˜ญ and then...bam.....interactions boing..

plain talon
sharp geyser
#

Seems like discord wasn't prepared for the 19 digit ids after all

plain talon
earnest phoenix
#

I always worshipped them

#

thought they were ahead and professional in what they do

sharp geyser
earnest phoenix
#

but honestly anyone can contribute it is hilarious

sharp geyser
#

only certain people can see it

plain talon
sharp geyser
#

icic

earnest phoenix
#

send invite

plain talon
#

sam is in it cuz of tempo

#

i cant get in tho :(

sharp geyser
#

sadge

#

I guess that isn't the invitte

plain talon
#

we got a server for it anyway

sharp geyser
#

I forgot it

plain talon
#

all big bot owners/staff

earnest phoenix
#

let's see how many verified bots go offline due to not handling this error or catching any errors for the interactions at all

#

bam

#

I saw invite

sharp geyser
#

Omfg stupid bot

#

just use discord-developers

#

it is their vanity

earnest phoenix
#

bet

lyric mountain
#

and even that some devs cant do

sharp geyser
#

haku you ain't wrong

#

professional stackoverflower

earnest phoenix
#

and actually managed to learn smthing

#

if ur good at gooling ur good at coding, and thats super easy ๐Ÿ‘

sharp geyser
#

I just have @earnest phoenix spoonfeed me

#

:p

lyric mountain
#

like, I dont mean googling for copypaste solutions

#

but knowing what to google to find answers for your problem

earnest phoenix
#

ye

#

javascript docs and cool articles

#

๐Ÿคฉ

sharp geyser
#

I suddenly got lazy and no longer wanna work on my lib

#

๐Ÿ˜”

lyric mountain
#

that's where people fail, they think being a dev means memoing all words

sharp geyser
#

I google shit half the time

#

A lot of times I can remember what things do tho

#

Some people just don't get that there is no shame in googling and reading docs

plain talon
#

right lol

earnest phoenix
#

quality assurance goes brr

plain talon
#

imagine tryna learn react without docs

sharp geyser
#

tried that

#

and it honestly isn't that bad

#

react has a lot of built in docs

plain talon
#

thats still reading docs!!!!!!

sharp geyser
#

But you don't need to go to the web

#

๐Ÿ˜Ž

earnest phoenix
#

try learn by guessing all the methods and basics

plain talon
#

lmao

#

learning react was fucking hard

earnest phoenix
#

just try toWord() toSentence() maketextlow() ah damn doesnt work...gotta try more

plain talon
#

my biggest challenge at the beginning was just simply getting redux to work

sharp geyser
plain talon
#

and understanding how it actually worked

sharp geyser
#

I didn't follow no guide or course

#

I just did it

plain talon
#

same i come up with a project and dont stop till ive achieved it

surreal sage
#

Trying to collect some messages but .on("collect") isn't firing

        var response = interaction; if (editResponse) { interaction.editReply({ embeds: [embed] }).then((msg) => { response = msg }) } else { response = interaction.reply({ embeds: [embed], ephemeral: true }).then((msg) => { response = msg }) }
        const filter = (msg) => msg.author.id == interaction.user.id
        const collector = interaction.channel.createMessageCollector({ filter, time: 300000 })
        var collected = []
        collector.on("collect", function (message) {
            collected.push(message.content)
            console.log("True")
            if (one && collected.length == 1) {
                collector.stop()
                events.emit(interaction.id, { collected, response })
            } else if (message.content.toLowerCase() == "done") {
                collector.stop()
                events.emit(interaction.id, { collected, response })
            }
        })```
lyric mountain
plain talon
#

rn im working on a bot web music player that i have absolutely no idea how to build

#

just going to figure it out as i go along

lyric mountain
#

when I need to find all the properties of something, just type get and ctrl + space

sharp geyser
#

isn't all the java getters prefixed with get?

lyric mountain
#

ye

#

either get or is

sharp geyser
#

simple

lyric mountain
#

var -> let please

surreal sage
#

Tell me why

plain talon
#

yeah no one uses var anymore

#

let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used, unlike the var keyword, which declares a variable globally, or locally to an entire function regardless of block scope.

lyric mountain
#

it causes weird errors that are quite hard to debug

#

also use === for comparison instead of ==

surreal sage
#

yeah came back from lua coding, I keep switchin'

plain talon
#

it does me in having to use === in js and then == in php

lyric mountain
#

php also has ===

plain talon
#

yes but most the time when i am using it, it doesnt work

earnest phoenix
#

Ah yes, Discord broke their own API with their new ID snowflake growing a digit longer

plain talon
#

i have to turn it to ==

#

and then bam it works

lyric mountain
#

== is a type-casting equals

earnest phoenix
lyric mountain
#

like, it casts the right side to whatever the left side is

surreal sage
#

I'm here for help since my messagecollector isn't firing "collect"

#

oh wait

plain talon
#

that explains why then

lyric mountain
#

"1" == 1 is true, because 1 is casted to string before comparison

plain talon
#

lmao

surreal sage
#

I got it

#

nvm

#

Forgot to enable message intent ๐Ÿ˜ญ

lyric mountain
#

was going to ask whether collector requires the intent or partials

earnest phoenix
#

nvm just interactions i think

lyric mountain
#

also just as a note, u don't need function (message), u cant just message =>

plain talon
#

it took me learning react to do that change

#

LOL

lyric mountain
#

meanwhile me, using just { /* code */ } (groovy has auto-params)

surreal sage
#

Also y'all didn't really help me with my question sobglasses

#

Intents were the issue

lyric mountain
midnight brook
#

i can't reply to interactions or edit them with this error, normal MessageChannel.send() still works tho, anyone know why? didn't make any changes that should get me this error since this was working earlier

winter pasture
midnight brook
#

ohh welp

quartz kindle
#

snowflakes became 19 characters long exactly today

#

they will become 20 characters long in 2090

winter pasture
#

Snatch a low number 19char bot ID asap ๐Ÿ™ƒ

sharp geyser
quartz kindle
#

lmao

#

discord got y2k'ed

sharp geyser
#

Apparently they hard coded 18 digits

quartz kindle
#

y2k22

winter pasture
#

Wanted to get one earlier today but was busy at work
Snatched 1000011651191406692

sharp geyser
#

Lmao

#

Time to make a bot

#

and submit it

quartz kindle
#

i cant believe discord just let that happen

sick agate
winter pasture
#

Intern* engineer trying to be smart and adding validation without understanding the ID generation ๐Ÿ™ƒ

sick agate
#

lmao

quartz kindle
#

why would they ever need to hardcode snowflakes character lengths, when they should be storing it and manipulating it as long ints

sick agate
#

i mean why expect it to be persistent lenght

quartz kindle
#

theres no need to even think about that if you use long int everywhere

#

and just convert to string before sending

#

i also dont understand why they use iso timestamps instead of numeric

#

sounds like a giant waste of resources

sharp geyser
#

i am not entirely sure if it is true

quartz kindle
#

small indie company

sharp geyser
#

Fork discord but make it bettter

lyric mountain
#

Harmony

#

evil discord

sharp geyser
#

I renamed my discord lib

#

strife -> tranquility

dry imp
#

change back

sharp geyser
#

why

#

tranquility is better

quartz kindle
#

name it tranquility
make it hell to use
aaaahhhahgahgahaghag

sharp geyser
#

tim you can't expose all my plans

sick agate
#

LMAO

lyric mountain
#

ah yes, coconut.jpg

sick agate
#

mason.jpg

quartz kindle
#

discord developers chat going wild

#

they are planning a rave party with mason as the dj

#

while the relevant devs sleep

winter pasture
#

Dont they have any on call engineers that could escalate too? ๐Ÿ™ƒ

sage bobcat
quartz kindle
#

california devs

winter pasture
#

On call engineers should be there 24/7 tho ๐Ÿ˜ญ

sick agate
#

then shouldn't you be also sleeping or nvm

#

it is like 8 am there?

quartz kindle
#

who

#

its 10am for me

#

lmao the mods just deleted all messages about guilded

tired kiln
#

Imo guilded is a failed project

neat ingot
#

hey yall, anyone having 'interaction already replied' issues with their discord.js bots?

#

i've been getting reports this morning from clients that their unchanged bots have stopped working randomly

#

oh, guess its just a thing on their side lol

lyric mountain
#

see latest discord announcement

neat ingot
#

where? on this server?

lyric mountain
neat ingot
#

mucho gracias mi amigo โค๏ธ

sudden geyser
tired kiln
sudden geyser
#

I don't think we know how many people use it

tired kiln
#

Failed isnโ€™t meant as in the app is bad, barely any marketing and i never see it come by

tired kiln
sudden geyser
#

In terms of "marketing", they've actually done well enough that Roblox bought it

#

Though I personally wouldn't use it.

tired kiln
#

Maybe marketing for investments, but marketing towards the actual users, barely anything ๐Ÿคทโ€โ™‚๏ธ

#

Never saw any ads. Maybe they did do some advertising, but it apparently did not work

tired kiln
sharp geyser
#

I don't even know if the ratelimitting works

#

๐Ÿ˜”

lyric mountain
tired kiln
slender wagon
#

client.on('message', async (message) => {
is not working for me for some reason

#

has there been an update i am not aware of

sharp geyser
#

bud

#

you are like 3 updates behind

#

message -> messageCreate

slender wagon
#

wtf

sharp geyser
#

they opted sticking to discords docs

#

discord defines it as messageCreate

earnest phoenix
earnest phoenix
#

And also you seem to be using template strings without doing any interpolation at some parts

earnest phoenix
#

Example of the # modifier?

sharp geyser
earnest phoenix
slender wagon
#

still not working for some reason

sharp geyser
#

Do you have the right intents enabled

slender wagon
#

yeah i enabled them all

sharp geyser
#

Are you trying to look for messages in a DM channel?

slender wagon
#

oh waiiittt

#
const client = new Client({
    intents: [Intents.FLAGS.GUILDS],
});
sharp geyser
#

If so you need to enable the appropriate partial

slender wagon
#

i shall also define em all here?

sharp geyser
#

define all the intents you want there yes

sharp geyser
earnest phoenix
#

And try to update to v14 when possible

red jolt
#

Hello. I have a problem with my bot. I want to run a slash command but the bot code says missing access. I gave every single permission in every single way to my bot and reinvited it many times and changed the token too but it still says it doesn't have access to use slash commands. Any idea how to fix it?

earnest phoenix
slender wagon
#

@sharp geyser ty got it to work

sharp geyser
earnest phoenix
sharp geyser
earnest phoenix
sharp geyser
#

ok

#

time to regex it all again

#

Thanks

sharp geyser
#

Don't remember how to use eslint else I would

earnest phoenix
#

And finally run eslint . to lint your entire codebase

sharp geyser
#

do I have to install eslint package side

red jolt
#

I reinvited the bot gave permission again but the bot is just thinking when running a slash command and got the same error again.

sharp geyser
#

or can I do it globally?

earnest phoenix
#

You can do it globally

sharp geyser
#

discord has yet to fix interactions right now forgot to mention

sharp geyser
pine nova
sharp geyser
#

Also eslint fixed my code

#

๐Ÿ˜Ž

#

Actually I just realized something

#

If I go this route I wanna set writable and configurable to false since I never wanna change what client is after it is set

#

unless I read the docs for defineProperty wrong

quartz kindle
#

set it to enumerable:false

#

that should hide it from the logs

earnest phoenix
#

is discord still broken

quartz kindle
#

yes

earnest phoenix
#

ping me when fixed

sharp geyser
sharp geyser
#

just don't fuck with anything relying on webhooks

#

and u good

quartz kindle
sharp geyser
#

fack

#

also should I set configurable and writeable to false as well?

#

I don't really wanna change what client is after it is set

quartz kindle
#

sure

earnest phoenix
#

I wouldn't consider interactions traditional

sharp geyser
#

You misread what I said entirely

earnest phoenix
#

Right interactions use webhooks

sharp geyser
#

yup

#

how else will it be possible to make it ephemeral

earnest phoenix
#

๐Ÿคทโ€โ™€๏ธ

#

I'll just wait for the fix

sharp geyser
#

fuck got thatt word on my mind

earnest phoenix
#

If I go down with traditional commands so does everyone else

#

It'll be fun to see all bots rely on slash commands that aren't user friendly enough

#

why would you have slash command one after another lol imagine scrolling from top to bottom
Imagine this with 50 bots u get what I mean, and I don't wanna scroll down the bot icon list

sharp geyser
#

Honestly discord should enforce slash commands more

#

there is no reason for message based commands anymore

earnest phoenix
#

it's annoying and uncomfortable

#

not the best way to convince people

sharp geyser
#

The only way it would be an issue is if multiple bots have tthe same command names

sudden geyser
earnest phoenix
#

hell no

sharp geyser
#

but the commands get split between each bot in the view unless you're looking for a specific command

sharp geyser
earnest phoenix
#

how am I even supposed to get an overview on all commands and memorize them if I literally have to scroll up and down and do this for every bot

sharp geyser
#

don't complain about a UI issue if you're using it wrong

sudden geyser
#

I don't see why you wouldn't

earnest phoenix
#

I'm not gonna use it because it is already retarded

sudden geyser
#

Given you need to with traditional commands

sharp geyser
#

you're using it wrong

earnest phoenix
#

No

#

Im not gonna waste my time scrolling down to find commands or memorizing them all

sudden geyser
#

Then how would you find the command traditionally?

sharp geyser
#

typing just / will give you an overview of all commands in the guild but if you look to the left oh wow look at that, there is a navbar of bot images corresponding to those bots commands

earnest phoenix
#

go find a way to spare the scrolling while implementing subcategories as folders and having those in a row

sharp geyser
#

You are literally just using the UI wrong

#

stop complaining

earnest phoenix
#

because the UI is retarded, again

sharp geyser
#

It is very simple

earnest phoenix
#

no

#

It is not optimized

sharp geyser
#

you and itsokaybae love complaining

#

๐Ÿ˜”

#

Im not having another "optimized" argument with you

#

good bye

sudden geyser
#

I personally don't see what's wrong with the UI nor how traditional commands solve the issue you have with it.

earnest phoenix
#

You can neither add emotes to the UI nor can you scale the UI

#

nor do you have subfolders but instead have every single command listed up which is retarded

sudden geyser
#

define subfolder

earnest phoenix
sharp geyser
#

cringe

earnest phoenix
#

You can do this with any folder

sudden geyser
#

ah

earnest phoenix
#

It gives you more overview

sudden geyser
#

So just categorization

earnest phoenix
#

U can also add icons to the folders

#

To Visualize

sharp geyser
#

I see no reason for something that indepth

earnest phoenix
#

Which is more powerful than having to read all the commands

earnest phoenix
#

Don't make me write a HTML example to illustrate this

#

We can make a poll and see which version people prefer

#

You're annoying as fuck

sharp geyser
#

All your complaining is more annoying

sudden geyser
#

"Oh no, someone has a different opinion than me!"

sharp geyser
#

Either way, you say yyou want it to be optimized, yet you are listing things that would be harder to manage

#

They'd have to change the api to do everything you said

#

which would make it more annoying to manage slash command groups

earnest phoenix
#

"Stop using traditional commands, all you do is complaining! There are no issues when it comes to slash commands!"

sharp geyser
#

I never said there was no issues

earnest phoenix
#

fucking troll

#

Then shut your ass up

#

Easy as that

sharp geyser
#

Someones mad

earnest phoenix
#

nah I'm done arguing with trolls

sharp geyser
#

What you call a troll

#

I call having an opinion

#

this isn't north korea

sudden geyser
#

No, you're just being overtly aggressive for no rational reason.

sharp geyser
#

^

sudden geyser
#

I can imagine categories being useful (though I'd prefer to call them tags).

earnest phoenix
sudden geyser
#

But outside of that, I think the current UI is fine.

earnest phoenix
#

is it really

sharp geyser
#

I do as well

sudden geyser
#

that's their opinion.

earnest phoenix
#

are you implying the subfolder suggestion is any worse

sharp geyser
#

There is fundamentally nothing wrong with the UI

#

it can ofc be improved which we already said they had in the roadmap

earnest phoenix
#

Fundamentals aren't the only thing that matter to convince people

#

As you say "it's all about opinions"

#

Do acknowledge this and stop the trolling

sharp geyser
#

bro I am not trying to convince anyone

#

It is my opinion

#

Idc if you agree to it or not

sudden geyser
#

There's no "fundamentals" to this. There's only preference and what someone finds more intuitive.

sharp geyser
#

no one is forcing yyou

earnest phoenix
sharp geyser
#

No im not

#

I was stating mine and you started bitching

earnest phoenix
#

Okay so what did I just quote

earnest phoenix
#

You were saying my opinion is invalid

quartz kindle
#

guys, any suggestions for an uptime/status page like those discord and cloudflare use? preferably free

earnest phoenix
#

Retarded as fuck

sharp geyser
#

Wow you really hurt mmy feelings ๐Ÿ˜”

earnest phoenix
#

@zinc fable @wet dove can you stop this troll

sharp geyser
#

pings a mod after calling someone retarded makes sense

#

you're the only one being toxic here

earnest phoenix
#

yeah because I am confident in the real issue that caused the trigger in first place and thus has justification for my lil toxicity

sudden geyser
#

x to doubt

earnest phoenix
#

But you don't seem to acknowledge it

sharp geyser
#

God you must think the world revolves around you huh?

wet dove
earnest phoenix
sharp geyser
#

Brought up like a spoiled brat

wet dove
#

he isnt trolling?

earnest phoenix
#

he is

#

read the conversation before saying shit

sharp geyser
#

stating opinion != trolling

earnest phoenix
#

then you will get my core message

wet dove
#

and stop arguing or ur both muted

earnest phoenix
#

I don't mind if he doesn't seem to stop

sharp geyser
#

I will stop now

earnest phoenix
#

then do it

wet dove
#

this channel is for helping people out, and giving opinions

earnest phoenix
pale vessel
#

History repeats itself

sharp geyser
#

no but you seem to think only yours are valid

#

okay bye guys

pale vessel
#

Bye

#

I've learned that the hard way

wet dove
#

so if you don't like their opinion you can just stop chatting here

#

easy than that

earnest phoenix
sharp geyser
#

shhh stop the conversation here please

#

not trying to be muted

quartz kindle
#

uvuvwevwevwe onyetenyevwe ugwemubwem ossas

earnest phoenix
#

Classic

sharp geyser
sudden geyser
#

abalabalhaha

quartz kindle
#

eris

sudden geyser
#

yes!

earnest phoenix
#

Holy shit

sharp geyser
#

mini mod

#

also eris is on topic

earnest phoenix
#

We chat a lot like this here, nothing uncommon

sharp geyser
#

eris is a discord lib

quartz kindle
#

this is my channel so i can do whayever i want here :^)

sharp geyser
#

all hail tim

earnest phoenix
#

So I can just chat in support and say the same or what

quartz kindle
#

u gotta earn it

#

through years of hard work

earnest phoenix
#

the fuck

pale vessel
#

Support is legit stuff

#

The development channel is not part of the website

earnest phoenix
#

yeah so I can talk all day about anime in this channel I guess

pale vessel
#

Sure

earnest phoenix
#

general 3 huh

sharp geyser
#

we do

earnest phoenix
#

ok

sudden geyser
#

or you could just read the channel topic

pale vessel
#

Like few days ago OMEGALUL

wet dove
earnest phoenix
sharp geyser
#

Taf we literally talk about twhatever we want here

#

and no one says anything

sudden geyser
#

yeah, eris is a discord library

earnest phoenix
sharp geyser
#

This guy just trying to mini mod

#

๐Ÿ˜”

wet dove
#

tbh lets keep this channel a bit on topic

sharp geyser
wet dove
#

alright then ur fine!

#

@earnest phoenix btw i read ur message on top, dont mini mod ty

sharp geyser
#

sorry for people wasting ur time taf

wet dove
#

dww

earnest phoenix
sudden geyser
#

on to other news, has discord.py arisen from its grave yet

wet dove
sharp geyser
#

it has a while ago

sudden geyser
#

or is it still in development

earnest phoenix
sharp geyser
#

d.py has continued development again

wet dove
earnest phoenix
#

They are

#

I'll quote the messages for you

sharp geyser
#

my god shut up

earnest phoenix
#

All of them

sharp geyser
#

No one cares

wet dove
#

please stop arguing

sharp geyser
#

we are trying to talk about dev stuff now

earnest phoenix
earnest phoenix
wheat mesa
#

๐Ÿซข๐Ÿฟ

wet dove
#

-m @earnest phoenix

gilded plankBOT
#

upvote Kolonyaa#6419 was successfully muted

sudden geyser
#

oh thank god

sharp geyser
#

Now then

earnest phoenix
sharp geyser
#

About my discord lib, I so far have covered making heartbeats and invalid sessions and reconnecting, etc. As far as I know I only have to cover handling errors now, but I am still curious is there anything I am missing?

earnest phoenix
#

It has implemented some of the new important features, but most of them are still unimplemented

earnest phoenix
sharp geyser
#

I do that

#

Idk if it works

quartz kindle
#

they finally published the issue on discordstatus

sharp geyser
#

cause idk how to test

#

but

#

I do have it implemented

quartz kindle
#

what are you trying to test?

sharp geyser
#

ratelimitting

#
private _send(data: {
        op: number;
        d: any;
        s?: null | number;
        t?: string | null;
    }) {
        if (!this.#connection)
            throw new SocketError('No socket connection found.');

        let timer = this.#internal.ratelimit.time;

        if (!timer) {
            timer = this.#internal.ratelimit.time = setTimeout(() => {
                this.#internal.ratelimit.time = null;
            }, 6000);
            this.#internal.ratelimit.until = Date.now();
        }

        if (
            --this.#internal.ratelimit.left <= 0 &&
            ![1, 2, 6].includes(data.op)
        ) {
            const error = new SocketError('Socket was hit with a ratelimit');
            error.retry_after = this.#internal.ratelimit.until;
            return Promise.reject(error);
        }

        // handle encoding later

        this.#connection.send(JSON.stringify(data));

        return Promise.resolve();
    }
#

Lovely code

quartz kindle
#

just spam the api

#

or lower your rate limit

sharp geyser
#

I have never intentionally spammed the api

#

Time to do it now though

quartz kindle
#

you can lower the limit and spam until that limit

#

instead of the real limit

sharp geyser
#

I can easily remove the interval on my set interval when sending a heartbeat

sharp geyser
quartz kindle
#

no, but you need to have an id document

sharp geyser
#

My console got spammed with Sending new Heartbeat...

#

probably rate limited on discord's end

quartz kindle
#

lel

sharp geyser
#
#send(data: {
        op: number;
        d: any;
        s?: null | number;
        t?: string | null;
    }) {
        if (!this.#connection)
            throw new SocketError('No socket connection found.');

        let timer = this.#internal.ratelimit.time;

        if (!timer) {
            timer = this.#internal.ratelimit.time = setTimeout(() => {
                this.#internal.ratelimit.time = null;
            }, 6000);
            this.#internal.ratelimit.until = Date.now();
        }

        if (
            --this.#internal.ratelimit.left <= 0 &&
            ![1, 2, 6].includes(data.op)
        ) {
            const error = new SocketError('Socket was hit with a ratelimit');
            error.retry_after = this.#internal.ratelimit.until;
            return Promise.reject(error);
        }

        // handle encoding later

        this.#connection.send(JSON.stringify(data));

        return Promise.resolve();
    }
#

tf am I doing wrong

quartz kindle
#

where do you set ratelimit.left? where do yoi decrease it? why is ratelimit.until the current date and not the date + timer?

sharp geyser
# quartz kindle where do you set ratelimit.left? where do yoi decrease it? why is ratelimit.unti...

I decrease it in the if statement

constructor(id: number, client: any) {
        super();
        this.#internal = {
            ratelimit: {
                left: 5,
                time: null,
                until: 0,
            },
            lastAck: null,
            lastHeartbeat: null,
            readyAt: null,
            sequence: null,
            sessionId: null,
            heartbeatInterval: null,
            heartbeatTimeout: null,
        };

        this.#connection = null;

        Object.defineProperty(this, 'client', {
            value: client,
            enumerable: true,
            configurable: false,
            writable: false,
        });
    }

here is where I set it

#

and can you add a setTimeout to a Date.now()?

quartz kindle
#

Date.now() + the same number yiu put in the timeout

sharp geyser
#

alright

#

but yea, I set it there and I decrease this.#internal.ratelimit.left in the second if statement

#

if(--this.#internal.ratetlimit.left <= 0 && ![1,2,6].includes(data.op){...}

quartz kindle
#

ah didnt notice the --

sharp geyser
#

yea hard to see

#

I don't see why this shouldn't work though

#

It decreases the amount left

#

and I am not doing anything where the op is one of those 3

quartz kindle
#

did you set left back to 5 in the timer?

sharp geyser
#

ah no

quartz kindle
#

discord said they found the issue and are working on a fix

#

base64 decoding the token was throwing an exception due to incorrect padding, related to the snowflake rollover

sharp geyser
#

Man it takes abnormally long to send my first heartbeat

#

Also it still is spamming the api

quartz kindle
#

how long? its normal for first heartbeat to take 10-40 seconds

sharp geyser
#

Oh

#

then I might just be tripping

quartz kindle
#

assuming you are using the jitter according to the api

sharp geyser
#

Received Hello. First heartbeat in 33254ms. Heartbeat interval = 41250ms

#

this is what it said

#

33s

quartz kindle
#

if you copied the code from my lib then it should be correct

#

its what the docs say to do

sharp geyser
#

Yea

#

I am still wondering why it isn't stopping the sending and telling the user they are rate limited tho

#

๐Ÿ˜”

quartz kindle
#

first heartbeat should be sent after interval * random float

sharp geyser
#
#send(data: { op: number; d: any; s?: null | number; t?: string | null }) {
        if (!this.#connection)
            throw new SocketError('No socket connection found.');

        let timer = this.#internal.ratelimit.time;

        if (!timer) {
            timer = this.#internal.ratelimit.time = setTimeout(() => {
                this.#internal.ratelimit.time = null;
            }, 6000);
            this.#internal.ratelimit.until = Date.now() + 60000;
            this.#internal.ratelimit.left = 5;
        }

        if (
            --this.#internal.ratelimit.left <= 0 &&
            ![1, 2, 6].includes(data.op)
        ) {
            const error = new SocketError('Socket was hit with a ratelimit');
            error.retry_after = this.#internal.ratelimit.until;
            return Promise.reject(error);
        }

        // handle encoding later

        this.#connection.send(JSON.stringify(data));

        return Promise.resolve();
    }

this is my updated code

#

I reset left back to 5

#

Is there anything else I am missing

#

or is my if statement's logic just wrong

quartz kindle
#

left = 5 should be inside the timer

#

not outside

#

you want to reset it after the timer passes

#

also you added 60000 to until, not 6000

sharp geyser
#

or do you mean inside the set timeout

quartz kindle
#

yes?

sharp geyser
#

Okay my shit is just fucked

#

No matter what I do it just keeps spamming

nocturne dagger
#

What is the best way to do this

#

export default function getToken(id) {
   //encrypt the "id" with a secret key (can be decoded with secret key as well)

   return //encryped thing here

}
#

I want to encrypt a Discord ID to a "token"

#

and then be able to send it back into another function to get decoded, does anyone know of any tools already for this? I tried crpyot-js but it was adding some randomness to it

sharp geyser
#

What kind of encoding are you looking to do?

#

You can turn it into a base64 string

#

or you can encrypt it with the crypto module iirc

quartz kindle
#

if you want encryption, you can use something like aes cypher

sharp geyser
#

I didn't see that part tim handled it

quartz kindle
#

but if youre sending via https its redundant because https is already encrypted

sharp geyser
#

wait tim

#
        if (
            --this.#internal.ratelimit.left <= 0 &&
            ![1, 2, 6].includes(data.op)
        )
#

doesn't this tell it that 1,2,6 shouldn't be rate limited?

quartz kindle
#

yes

sharp geyser
#

No wonder the fucking thing isn't working

#

I am testing the rate limit with sending a heartbeat

#

heartbeat is ignored by the rate limit

#

or am I reading this wrong

#

Heartbeat's opcode is 1 correct?

quartz kindle
#

ah lel

#

test it using request guild members

sharp geyser
#

Ima just remove heartbeat from the array of opcodes

#
Received Hello. First heartbeat in 10913ms. Heartbeat interval = 41250ms
Sending new Identify Request.
{
  v: 10,
  user_settings: {},
  user: {
    verified: true,
    username: 'Dungeon',
    mfa_enabled: true,
    id: '997706195760578621',
    flags: 0,
    email: null,
    discriminator: '0637',
    bot: true,
    avatar: null
  },
  session_type: 'normal',
  session_id: 'a62a6817561d74814c967845f58caedf',
  relationships: [],
  private_channels: [],
  presences: [],
  guilds: [ { unavailable: true, id: '957867801119449109' } ],
  guild_join_requests: [],
  geo_ordered_rtc_regions: [ 'seattle', 'santa-clara', 'us-west', 'us-south', 'us-central' ],
  auth_session_id_hash: '4E20fsvcJ3q0tRFNFB3WYBbg3gjgwpgn0jaX+IX4B2I=',
  application: { id: '997706195760578621', flags: 2654208 },
  _trace: [
    '["gateway-prd-main-8m4c",{"micros":57258,"calls":["discord-sessions-green-prd-2-53",{"micros":54790,"calls"
:["start_session",{"micros":47063,"calls":["discord-api-7dcd4c9d86-hxclx",{"micros":41770,"calls":["get_user",{"
micros":8584},"add_authorized_ip",{"micros":1725},"get_guilds",{"micros":4112},"coros_wait",{"micros":1}]}]},"gu
ilds_connect",{"micros":2,"calls":[]},"presence_connect",{"micros":6385,"calls":[]}]}]}]'
  ]
}
Ready event fired
Sending new Heartbeat...
Sending new Heartbeat...
Sending new Heartbeat...
C:\Users\dyeaa\Documents\github\misty\typescript\tranquility\dist\ws\WebsocketShard.js:54
            const error = new util_1.SocketError('Socket was hit with a ratelimit');
                          ^

SocketError: Socket was hit with a ratelimit
    at #send (C:\Users\dyeaa\Documents\github\misty\typescript\tranquility\dist\ws\WebsocketShard.js:54:27)     
    at Timeout._onTimeout (C:\Users\dyeaa\Documents\github\misty\typescript\tranquility\dist\ws\WebsocketShard.j
s:131:35)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7) {
  retry_after: 1658506461443
}
#

Well no shit

#

Tim I am just fucking braindead apparently

quartz kindle
#

lel

lyric mountain
#

could anyone help me find better fonts to use with this?

Current:

  • name -> Arial
  • attributes & cost -> Staatliches
  • description -> Hammersmith One
sharp geyser
#

The bottom is very hard to read

lyric mountain
#

like, it's hard to find a good enough font that can be used with 11px text

#

ik

sharp geyser
#

use the same font you did for the name

lyric mountain
#

arial?

sharp geyser
#

Yea

#

give it a shot see how it looks

quartz kindle
#

aerial

lyric mountain
#

lemme see

quartz kindle
#

10px isnt good?

#

i like smaller fonts

sharp geyser
#

tim is it just me or does it seem like this is stopping before it reaches 5 tries

Sending new Heartbeat...
Sending new Heartbeat...
Sending new Heartbeat...
C:\Users\dyeaa\Documents\github\misty\typescript\tranquility\dist\ws\WebsocketShard.js:54
            const error = new util_1.SocketError('Socket was hit with a ratelimit');
                          ^

SocketError: Socket was hit with a ratelimit
    at #send (C:\Users\dyeaa\Documents\github\misty\typescript\tranquility\dist\ws\WebsocketShard.js:54:27)     
    at Timeout._onTimeout (C:\Users\dyeaa\Documents\github\misty\typescript\tranquility\dist\ws\WebsocketShard.j
s:131:35)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7) {
  retry_after: 1658506461443
}
#

Tries sending 3 and stops on the 4th

royal portal
#

because ratelimit

sharp geyser
#

Not like it really matters tbh as long as they don't hit the ratelimit

sharp geyser
#

but they should have 5 tries not 4

quartz kindle
#

identify is likely also being counted

sharp geyser
#

Ah

#

Wait why

lyric mountain
#

arial is too big

sharp geyser
#

Identify shouldn't be counted

lyric mountain
#

I lose about 10 characters or so

sharp geyser
#

should it?

quartz kindle
#

you are reducing the left value before checking the op type, so everything is counted

sharp geyser
#

Okay but should it be counted?

#

Even though it will be ignored in the rate limit

lyric mountain
#

lemme try reducing it by 1px and making it bold

quartz kindle
#

depends which limit you want to enforce

#

if youre gonna go for the official limit, it has to be counted yes

sharp geyser
#

Ima stick to discord's recommendations as much as possible

quartz kindle
#

if you make your limit a bit smaller, you can afford to not count them

sharp geyser
#

I was only thinking it didn't have to be counted cause you only really ever Identify once per session

quartz kindle
#

i made my limit a bit smaller so that there will always be some room reserved for important stuff

sharp geyser
#

mmm well now you are making a valid point here

quartz kindle
#

for example if you send 120 requests and then you need to send a heartbeat before the rate limit resets

#

the heartbeat will be rate limited

sharp geyser
#

I set the limit at 155

#

idk if that is appropriate

quartz kindle
#

the api limit is 120 per 60s lol

sharp geyser
#

Wait really

quartz kindle
#

plus an adicional limit for presence updates

sharp geyser
#

I thought it was 200

#

Damn I have bad memory

sharp geyser
#

cause I only see stuff about the rest api

#

not any gateway rate limits

quartz kindle
#

on the gateway page

sharp geyser
#

I missed that part completely apparently

#

or I just don't remember reading it

#

well ty tim

#

I almost made itt so the spam the api no matter what

#

kek

quartz kindle
#

xD

sharp geyser
#

forgot to put the interval back and was wondering why I was spamming the api

#

๐Ÿ˜”

lyric mountain
#

open-sans looks fine

#

at least more readable than hammersmith

#

maybe I could use the bold variant but idk

sharp geyser
#

Yes

#

Also haku you gave me a wonderful idea for my rpg bot

lyric mountain
#

?

sharp geyser
#

Ima make cards as well for the characters in it

lyric mountain
#

a

sharp geyser
#

Idk how ima do it as I suck at canvas

#

but it should be fun

lyric mountain
#

I'm currently migrating my cards to the new system

#

but adjusting font size to be visible while allowing enough characters is quite hard

#

especially when the battlefield is huge

sharp geyser
#

battlefield?

lyric mountain
#

ye, it's a tcg

#

(last image I could find from our testing)

sharp geyser
#

What are you making this on?

lyric mountain
#

discord

#

and java

sharp geyser
#

So it is turn based?

lyric mountain
#

yep

sharp geyser
#

okay good

lyric mountain
#

works just like heartstone or yugioh

sharp geyser
#

that'd be a pain otherwise

lyric mountain
#

I'm actually rewriting it, yk, some sanitization here and there

sharp geyser
#

I am planning on making cards just for visual display

#

Make it easier to display info on the character

#

I am going for a dungeon dive rpg bot

lyric mountain
#

nice

sharp geyser
#

yea but I am doing that later

#

rn I am focused on discord lib dev

lyric mountain
#

don't forget to add a global 10k request limit for all operations

sharp geyser
#

wait what

lyric mountain
#

cloudflare limit

#

don't remember the exact timeframe

#

but there's a global 10k request limit before u get ratelimited for a day

sharp geyser
#

10k/10m

#

it seems

near stratus
#

that seems like a lot

sharp geyser
#

Is that rest api only or is it also included in the gateway operations

lyric mountain
#

idk

sharp geyser
#

It seems only rest api

#

receiving status codes of 401, 403, or 429 should be counted to the global ratet limit

#

IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes. An invalid request is one that results in 401, 403, or 429 statuses.

All applications should make reasonable attempts to avoid making invalid requests. For example:

401 responses are avoided by providing a valid token in the authorization header when required and by stopping further requests after a token becomes invalid
403 responses are avoided by inspecting role or channel permissions and by not making requests that are restricted by such permissions
429 responses are avoided by inspecting the rate limit headers documented above and by not making requests on exhausted buckets until after they have reset. 429 errors returned with X-RateLimit-Scope: shared are not counted against you.
Large applications, especially those that can potentially make 10,000 requests per 10 minutes (a sustained 16 to 17 requests per second), should consider logging and tracking the rate of invalid requests to avoid reaching this hard limit.

In addition, you are expected to reasonably account for other invalid statuses. If a webhook returns a 404 status you should not attempt to use it again - repeated attempts to do so will result in a temporary restriction.

#

I have yet to touch the rest api so no need to worry about that yet

#

but I will keep it in mind

torn topaz
#

Is there a good way to to make a vote streak system for daily votes? I don't know where the voter is so idk how to properly check if a vote happened on the next day or if it's still the same day ๐Ÿ˜‚ (since you could vote 2x a day but it shouldn't count towards streak) but maybe it's easier to just count it ยฏ_(ใƒ„)_/ยฏ

sharp geyser
#

store votes for the user in a db

#

iirc you can only vote every 24h anyway

#

or is it 12 (can someone confirm?)

lyric mountain
#

12

#

and yes, storing into a db is the only reasonable solution

sharp geyser
#

Well if you want it to be a daily streak you gotta track votes

#

2 votes would be 1 days worth but that just sounds dumb way of doing it

lyric mountain
#

also remember to leave some window for the voter

#

like, if track streaks on 12-hour basis, allow up to 12 hours as a window

#

so like```
12 - vote (1)
24 - vote (2)
36 - novote (2)
38 - vote (3)
50 - vote (4)
...

#

tho it's unnecessary if u track daily votes

sharp geyser
#

Doesn't that require them to vote exactly on time?

lyric mountain
sharp geyser
#

Ah

torn topaz
#

tbh I think it's cleaner if I just count both votes to the streak

sharp geyser
#

Didn't see that part my bad

lyric mountain
#

like, u can vote twice on a day, so if u make only 1 vote, the streak is broken

torn topaz
#

I think I'm gonna count every vote and add +1 to the streak for each vote. And I'll give people 36 hours before their streak breaks. That's more chill ๐Ÿ˜‚

lyric mountain
#

36 is too much no?

torn topaz
#

Well, If I voted in the morning today and want to vote tomorrow in the evening the streak will be lost

#

so I think I'm even gonna do 48 hours to be on the safe side
ofc people could skip a day then but I don't mind

craggy pine
#

Is the goal with this just a daily vote tracker basically? Or do the individual votes including if both are done in the same day count?

torn topaz
#

My original plan was to make it a daily tracker but I couldn't come up with a great way so I'll just count both votes. I think that's fine too.

fossil bronze
#

Can sharded bots still .fetch channels and dm channels?

ancient nova
#

dawg

sharp geyser
#

you should be able to iirc

ancient nova
#

what kinda songs do yal like

sharp geyser
#

unrelated

ancient nova
sharp geyser
#

goodbye

ancient nova
fossil bronze
ancient nova
#

I used to have 16 shards on my old bot with only 200 servers joesmh

sharp geyser
#

why

#

talk about uselesss

ancient nova
#

don't really kno someone told me to shard for better performance n I kinda done a lil too much

quartz kindle
#

you can fetch anything from anywhere

ancient nova
#

Tim what kinda songs do u listne to?

sharp geyser
#

I don't remember the recommended limit for sharding but I think it is like 1500-2500

ancient nova
#

I'm curious

sharp geyser
#

1 shard per 1500-2500 servers

wheat mesa
#

Yeah

quartz kindle
#

lately ive been listening to a synthwave radio channel on youtube

sharp geyser
#

That is if you're using djs

wheat mesa
#

Maybe 1 shard per 1000 if itโ€™s a music bot

#

Thatโ€™s about the only exception

sharp geyser
#

you mightt be able to do a bit more with eris

wheat mesa
#

Youโ€™re forced to shard at 2500

fossil bronze
#

Im only at 2600 servers but I have maxed out a single CPU thread

ancient nova
#

forced?

wheat mesa
#

Yes

sharp geyser
#

Yes

wheat mesa
#

The API forces you to open more gateway connections at 2500 guilds

quartz kindle
fossil bronze
#

Well with the internal sharding feature you don't really have to do anything

sharp geyser
#

Isn't eris a better option when sharding for larger bots tho?

ancient nova
#

good to know although i doubt my bot will ever even reach 1k at the rate it's growing

#

it's at 68 I think rn

wheat mesa
#

Mine is at like 35 because I donโ€™t work on it

quartz kindle
#

im using internal sharding with 10k guilds and my cpu usage is pretty low

sharp geyser
#

Mine is at 1 cause I am not done with it

fossil bronze
quartz kindle
#

ah image and gif can be cpu expensive

#

if the images are too large

sharp geyser
#

What is the upload limit for bots?

quartz kindle
#

8mb

sharp geyser
#

Is it normal user limit or nitro

quartz kindle
#

normal

sharp geyser
#

sadge

ancient nova
#

lol will I also have to create separate dbs for each shard cuz I doubt the bot will be happy with 10k servers interacting with 1 enmap ElonLaugh

sharp geyser
#

bots should have nitro perks ngl

fossil bronze
#

Well I think game bots in general are going to be demanding because of all the spam compared to say, a moderation/utility bot

ancient nova
#

ofc I can

sharp geyser
#

No

quartz kindle
#

no you cant

stuck dawn
#

how can i know what is causing this error?

sharp geyser
#

Also that would be dumb even if you can

#

just do a thing called pooling

stuck dawn
ancient nova
#

alr

sharp geyser
stuck dawn
#

yes

sharp geyser
#

Did you forget to put a path

#

on one of your routes*

stuck dawn
#

i don't think so

quartz kindle
# ancient nova ofc I can

sharding is calculated based on guild ids and the number of shards. when you change the numer of shards, all guilds will be recalculated and will not be in the same shards anymore

sharp geyser
ancient nova
quartz kindle
#

nop

ancient nova
sharp geyser
#

So what happens if a shard goes down

#

do those guilds in the previous shard move to a new one?

quartz kindle
#

no

ancient nova
#

yes...

#

no?????

quartz kindle
#

those guilds will be down

sharp geyser
#

mmm

#

Makes sense tbh

ancient nova
#

I got even more confused

sharp geyser
#

It'd have to wait till the shard is reconnected

ancient nova
#

then they do stick to their shard?

fossil bronze
#

The sharding manager auto-restarts the shards right?

sharp geyser
#

and or re-identified

sharp geyser
ancient nova
sharp geyser
#

but if you change the number of shards you have they get recalculated like time said

ancient nova
#

I see

#

makes sense

quartz kindle
#

if you have 2 shards with 500 guilds each, if one goes down then those 500 from that shard will be down, until that shard reconnects

#

if you change to 3 shards, then you have 3 x ~ 330 guilds

#

so some guilds that were on shards 1 and 2 are now on shard 3

#

also some that were on shard 2 can go to shard 1, and vice versa

#

also yoi dont need to connect all shards, and you can use different total shards at the same time

#

but you will get duplicated guilds if you do that

#

you can also create a shard that only has 1 guild in it

#

and guess which guild is it from its id

#

so its possible to chose which guild

#

i do that for testing, for example i make a shard that only has my guild in it, so its super fast to connect

fossil bronze
#

It's kinda sad how in the beginning i was taught to never use fetch and only cache.get

quartz kindle
#

and i dont need a test bot token

fossil bronze
#

But fetch also checks cache..?

quartz kindle
sharp geyser
#

by default yes

#

you can use force which makes it skip cache checking and goes straight for the api

fossil bronze
#

Soo... It's unfortunate they taught it that way

sharp geyser
#

Now it is obsolete to get from cache directly tbh

#

fetch is better as it will check cache first and if it doesn't exist it will go to the api to fetch

quartz kindle
#

the lib was much more cached before

#

caching is now less connected to the lib, so its easier to control

sharp geyser
#

didn't they used to force cache members and such?

#

so members were always cached no matter what

quartz kindle
#

they had an option to fetch all members

sharp geyser
#

ah right

fossil bronze
#

Yeah ... ill say something next time I see a new person taught to use cache.get

#

Funny when I used eris, I always used fetch. But then for d.js, everyone said use cache.get, like fetch wasn't even an option

quartz kindle
#

djs community is a mess

#

too many people in there, so depending on whos there at the time you will get different answers

fossil bronze
#

Yeah...

quartz kindle
#

sometimes from noobs who think they know it all

fossil bronze
#

But support is soo much better than eris still

quartz kindle
#

yes djs is much bigger than any other js lib

fossil bronze
#

But they did add examples for interaction stuff to the eris github

quartz kindle
#

is abal still the sole dev of eris or does he have a team now?

fossil bronze
#

Even though I was told "no, you don't get any examples. examples are for beginners, and eris is not for beginners"

#

idk

quartz kindle
#

afaik djs is the only lib maintained by a full team

#

all other libs are done by sole developers

fossil bronze
#

eris isn't hard though

#

d.js has more ...stuff.. which makes it harder

quartz kindle
#

yeah they tend to overcomplicate stuff

sharp geyser
fossil bronze
#

but when I couldn't even get an example for how to make buttons, I switched

sharp geyser
#

how to make buttons in eris?

quartz kindle
#

who knows, i never used eris

#

only ran benchmarks on it lel

fossil bronze
#

There's examples on the github now

stuck dawn
earnest phoenix
#

what can we set as spam parameters .ie how many messages in how much time can be considered as spam ??

quartz kindle
sharp geyser
sharp geyser
#

Oh wait nevermind

#

That's per user

#

Thought you were talking about a global limit

#

I was fixing to question life

stable eagle
sharp geyser
#

He's talking about user spam

wheat mesa
#

Thatโ€™s a discord limit

#

I donโ€™t believe your bot is able to bypass that even with higher ratelimits

#

However interactions are a solution!!

fossil bronze
#

Okay so I have changed the DM functions to fetch

#

I've set the server count to broadcasteval

#

Other than the db, that should be it?

craggy pine
fossil bronze
#

Anyone ran (real) sharded bot with sqlite?

quartz kindle
#

i use sqlite on 10k guilds, but i use internal sharding

#

you shouldnt have any issues running it with the sharding manager

#

just enable wal mode

#

and use better-sqlite3

sharp geyser
pale vessel
#

WSL mode m8

quartz kindle
#

makes writes faster by writing to a separate append-only file instead of the main db file, and also frees the main db file for concurrent reads

boreal iron
#

Has that been your calculation?

#

I donโ€™t remember any more

molten halo
#

Why i use app.delete() it still shows the page

quartz kindle
boreal iron
#

Didnโ€™t we bet when you say based on your math skills? smirk

quartz kindle
boreal iron
#

So wanna place some bets ?

#

Good you never answered

sharp geyser
#

Didn't he say it would be the 22nd?

quartz kindle
boreal iron
#

Iโ€™m a poor boy, too

quartz kindle
#

you gibe me mรดney i gibe you food

#

๐Ÿฅซ๐Ÿฅ˜๐Ÿ”

boreal iron
#

How has the fish been I sent over?

quartz kindle
#

the codfish?

#

bacalhau

boreal iron
#

Tf

sharp geyser
#

We ate it

quartz kindle
#

with pepperonis and pepsi

wooden ember
#

so earlyer i had an idea, was messing about with fan speeds on my server and had the watch sensors comand on a terminal. then I thought that if I ran sensors with child_prossess and sent the stdout to discord for a handy host info command to check on my server when im away however it just spits out a bunch of numbers and not actual text when stdout is logged to console. how to i convert the output from raw data to and actual readable format?

red jolt
#

Uh guys can somebody help me how to create a normal invite link. And the applications command is necesarry and should I only create 1 or more redirect?

quartz kindle
#

or use .toString() on the data packets

sharp geyser
#

stdout

quartz kindle
sharp geyser
#

what does stdout stand for tim

quartz kindle
sharp geyser
#

thanks

#

you are like a miniature discord bot

wooden ember
#

same with stderr (exept thats for errors)

sharp geyser
#

that returns info on things

quartz kindle
sharp geyser
#

/tim What is the circumference of ur mother

red jolt
quartz kindle
#

then youre doing something wrong

#

in your code

#

not with the invite link

sharp geyser
#

tim bot non-functional

quartz kindle
sharp geyser
#

ayo

red jolt
#

In the morning the bot was good. But now it wont even show the commands.

wooden ember
#

restart it

#

it crashed

#

or the host is down

#

one or the other

sterile lantern
#

i want it so whenever the client is being ratelimited, it runs a kill command (switching its container) -- but this doesn't seem to work:

    process.kill(1) 
  })```
wooden ember
#

atm im just loging the raw output

#

mmm thats badly worded

#

i mean how would i convert it cuz the raw output is the stream im assuming

red jolt
#

Okay maybe I wait and try again tomorrow. I can't do anything on the phone.

wooden ember
#

cool

quartz kindle
wooden ember
#

yeah

quartz kindle
#

so stdout should have a .setEncoding method

wooden ember
#

i see

quartz kindle
#

otherwise the data you receive in the data event, you can use .toString() on

wooden ember
#

mmm ill try that

wooden ember
wooden ember
quartz kindle
# sterile lantern ?

the rateLimit event fires when the library protects you from hiting an actual rate limit

#

its not a real rate limit

sterile lantern
#

oh

quartz kindle
#

also process.kill() just quits node

sterile lantern
#

how would i know when its hitting a 429

quartz kindle
#

it doesnt do anything to tje container

sterile lantern
#

huh

#

but when i run

#

kill 1 in the shell

#

it seems to work

quartz kindle
#

process.kill is not a shell kill

sterile lantern
#

o

quartz kindle
#

process.kill is like doing ctrl+c on node

#

oh wait nvm, im confusing it with process.exit

sterile lantern
#

yeah that makes a lot more sense lol

#

how would i know when the app hits a 429

#

debug event?

quartz kindle
#

the problem is not a 429

#

its a cloudflare ban you are looking for