#development

1 messages ยท Page 279 of 1

spark flint
#

people are just waffling

prime cliff
# spark flint people are just waffling

It's half-half really, the new CEO was part of activision management and also a company called King with a lot of micro-transaction games, plus Discord is trying to go public so there's a lot of uncertainty as to which direction Discord is going on

wheat mesa
#

Blizzard has been known to make interesting decisions that affect their softwareโ€™s future poorly

#

Hence why people are nervous about a blizzard exec stepping up

sharp geyser
#

discord 2.0 in the works ๐ŸงŒ

#

corddis

eternal osprey
#

ah ehll nooo

#

please not

#

i like discord

lament rock
#

Im prepping the "It's Time To Ditch TeamSpeak Discord" ad campaigns

sharp geyser
#

Lmao

sharp geyser
#

Are password confirmation fields in websites becoming obsolete? I am seeing a lot less of it in web designs and I am wondering if its because they are too lazy to include it, or if thats just a new trend

wheat mesa
#

Itโ€™s a UX thing. People can accidentally type the wrong password, youโ€™re much more likely to not type the password incorrectly twice in a row without realizing

#

Iโ€™d say itโ€™s a must for every website

sharp geyser
#

I see

#

I am just noticing in a lot of mockup designs they fail to include it

#

Thought I was using some outdated shit

scenic kelp
#

i prefer that tbh

sharp geyser
#

So instead of having 2 fields just let them check over it themselves

#

smart

wheat mesa
#

Users are stupid; treat them as such

quartz kindle
#

just spent a few hours implementing a password confirmation thingy a few days ago lol

#

rate design

#

ignore cloudflare captcha, testing on localhost, so its disabled

#

wondering if i should get rid of the password requirements, people hate that stuff

#

im eager to see 1234 passwords in the db

pearl trail
sharp geyser
#
# SERVER_ERROR:  [AggregateError: ] { code: 'ECONNREFUSED' }
 POST /api/auth/sign-up/email 500 in 494ms

Gotta love this error

#

I wonder whats wrong exactly

pearl trail
sharp geyser
#

Is there a way I can get proper logs

#

cause this is bs

#

wtf am I supposed to do with AggregateError

#

Idek where its coming from

#

Woah no way @clear plinth check this thing out

pearl trail
sharp geyser
#

I found the issue

#

Wish it was more descriptive

#

but turns out my SSH tunnel to my vps with postgres running on it closed

pearl trail
sharp geyser
#

YOOO

#

Arifureta got a season 3

#

sorry off topic

#

W fuckin anime tbh

sharp geyser
#

How does Crowdin work? I am noticing I am making a lot of mistakes, and polluting my commit history due to it.

It requires you to set a source path and translations path, but then whats the point in keeping the old source file if it just generates a new one.

For example say I support english (en), spanish (es) and french (fr). I have en.json, es.json and fr.json. Crodwin expects me to set a souce (base) language, okay so lets set it to en.json. Now I set the translation path to be /messages/%two_letter_codes%.json well, turns out that is a conflict cause en.json already exists, and crowdin doesn't like that, so it wants me to do something like /messages/%locale%/messages.json or something different.

Now lets say I do all my translations, I commit them to github using its integration, and now it has /messages/en-US/message.json file, so then whats the point of the old en.json file? It's not longer the source anymore no?

rugged dawn
sharp geyser
#

My question is mainly, is there a need to keep the old files if it just generates new ones

rugged dawn
#

no its temporary im sure, it'll be replaced

#

so i don't thnk there's a need to keep the old files

delicate zephyr
sharp geyser
#

I mean if I delete en.json then the source is no longer valid

#

and then I have to set it to en-US which then just starts the whole issue of Crowdin complaining of conflicts

#

so im confused on what Crowdin expects me to do

rugged dawn
#

im not on the dev-side of this but i've worked and seen this before, since you're approaching /messages/%locale%/messages.json that forms a local directory and eventually as you said it'll turn into /messages/enUS-/message.json , i suggest just removing the original one

sharp geyser
#

Right

#

So I should just ignore Crowdin complaining about possible conflicts and overwrites

rugged dawn
#

now /en-US/message.json is your original source file

rugged dawn
sharp geyser
#

hm ok

rugged dawn
#

there was a transifex to crowdin migration, shit was hard to watch but i know devs did a great work backend

sharp geyser
#

Implementing the changes from crowdin is being a pain in the ass already

rugged dawn
#

crowdin might be a bit of pain in the ass but once u go through the initial setup it;s smooth af

sharp geyser
#

Yea

sharp geyser
#

Finally got crowdin to work for me :D

sharp geyser
sharp geyser
#

The problem is Idfk what to name em ๐Ÿ˜ญ

rugged dawn
#

so this is fine

sharp geyser
#

First time translating

sharp geyser
rugged dawn
#

but as the complexity increases

#

you have to give contexts to some things that might sound too generic

#

refer to few strings from crowdin/top-gg youll have an idea of hoe snippets are handled in translations

lament rock
#

Honestly, I forgot almost all of the keys I named in my translations for my bot. Even if I don't remember, I have a script generate .d.ts files off the english version .json and use the string I wrote so I know what its english value is in editor. Plus I can also just re read the translations. Most of the files are just command stuff like names, desc, arg names and desc

sharp geyser
#

Oh yea I know

#

I was just confused on what I should be using for the source if its not going to be updated

lyric mountain
#

in crowdin you localize the raw

#

the source is supposed to be the base

sharp geyser
#

like it generates a new translation file

lyric mountain
#

yes, it's normal

#

you get the raw file and fork it into several locales, one of which might be the same language as the original

#

but the source must be kept

sharp geyser
#

I just ended up deleting the original source and making the generated en-US one the new source

#

๐Ÿ’€

lyric mountain
#

they were supposed to be the exact same file

sharp geyser
#

Is what I did bad

#

Cause I dont see a reason to keep a copy around if im just going to modify it and it be the exact same

#

I'd rather make the newly generated en-US the new source and just modify it

lyric mountain
#

well, there's always a chance it might glitch out

sharp geyser
#

How come?

lyric mountain
#

like, when you add new keys you'd do it in the source file

#

so every other locale also receives them

#

if the source file is also a target it might bug if they didn't treat it

sharp geyser
#

I mean I guess I can make a base.json and copy and paste the en-US to it and make it the new source

lyric mountain
#

to put it simply, the base is where you add stuff, the targets are where you translate

#

dont add in targets and dont translate in base

sharp geyser
#

right

#

Just made a new base.json file, copied en-US to it, set it as my new source in the github integration app

#

and should be all good now

#

All good now

rugged dawn
#

crowdin is really weird when it comes to some things, if you want to disable QA for a separate language it;s not possible, you either have QA for all languages or don't have AT ALL

sharp geyser
#

I think I accidentally just did something

#

I was messing around and started a pre-translate job using Crowdin Translate thing

#

๐Ÿ’€

#

Dk what its going to do

rugged dawn
#

it'll just translate every language u support through it's machine translate and translation memory

#

for some languages it's good, for some languages there isn't even 30% accuracy

sharp geyser
#

Well

#

Now I have stuff for people to proof read

#

๐Ÿ’€

rugged dawn
#

it's not a bad thing at all, they can just simply click on delete button or not approve it

#

my suggestion is to enable DeepL through apps

sharp geyser
#

DeepL?

#

that supposedly super fuckin accurate translator?

#

@rugged dawn So I invited null as a proofreader

#

how da fuq does it work

rugged dawn
rugged dawn
# sharp geyser DeepL?

DeepL is one among the best translators, but nothing is more than 90% accurate, DeepL is the best among the ones which exist

sharp geyser
#

I guess you just select a language (you should have access to indo and english) and you can proof read / edit translations for strings

#

or can they only read and approve / deny them

rugged dawn
radiant kraken
#

yup

#

there's no dropdown for it

rugged dawn
#

dropdown for?

radiant kraken
#

approve translations

#

or some kind of button to proofread

#

i don't remember, i haven't proofread translations in so long

rugged dawn
#

you should get a tickYes

sharp geyser
#

Yea there will be a check mark next to the translation you recommend

#

just click it

radiant kraken
sharp geyser
#

Click Save

#

when you are done

#

and it will pop up in the Indonesion Translations section

rugged dawn
sharp geyser
#

They should

#

I gave them proofreader

rugged dawn
#

then null try relogging in

#

it should look like this

sharp geyser
#

Nvm

#

Looks like crowdin wanted to ignore me giving them proofreader

#

and gave them translator instead ๐Ÿ’€

rugged dawn
#

lol

sharp geyser
#

@radiant kraken try refreshing

#

should be all good now!

radiant kraken
#

it works

sharp geyser
#

๐Ÿ‘

#

I got to make a support server for this project now that I think of it

#

Gotta gather minions proofreaders

radiant kraken
#

<@&842556283450425344> <@&1353254053962055723> come here

sharp geyser
#

Ayo?

#

Dont tell me thats pingable for you

radiant kraken
rugged dawn
#

it's not lol ๐Ÿ˜ญ

sharp geyser
#

Thank god

#

I was about to become the most hated person here cause of null

#

๐Ÿ’€

radiant kraken
#

HAHAHAHAHA

pearl trail
neon leaf
#

before:

TotalSeconds : 136,9656257
TotalMilliseconds : 136965,6257

after:

TotalSeconds : 31,1562804
TotalMilliseconds : 31156,2804

๐Ÿ”ฅ more speed

#

file content now multithreaded instead of just individual files

lyric mountain
neon leaf
#

ye rayon handles the annoying stuff for me

#

i tested 1000 iterations comparing the hash of all files in the directory

#

always a match

lyric mountain
#

nice

neon leaf
#

still very cursed tho

quartz kindle
#

no idea what that does, but i know anything you make is cursed by default

#

you are the curse itself

#

:^)

sharp geyser
#

dang

eternal osprey
#

hey in css, how do i create a grid that contains 2 different sizes?

#

so the first column has a 2fr:1fr ratio

#

second column an equal ratio like 1fr:1fr

neon leaf
#

its for my deduplicated backups

#

aka store once reference how many times you want

quartz kindle
#

the grid itself is equal sized, but the items can occupy different amount/aspect ratio of cells within the grid

eternal osprey
#

yup! i got it! Thanks!

#

I was able to set the grid-columns to repeat 6, 1fr

#

and then define how much span each item took.

neon leaf
sharp geyser
#

No idea what that is

prime cliff
#

Hi Robert HeheGif

neon leaf
#

hi

amber rose
quartz kindle
neon leaf
#

hi tim

amber rose
#

Tim ๐Ÿฝ๏ธ๐Ÿฅ˜๐ŸŽ

quartz kindle
#

hi

eternal osprey
#

hey guys

#

no matter what i do:

client.on(Events.PresenceUpdate, async (oldPresence, newPresence) => {```
this simply never emits
#

eventhough my bot has presence intents

lament rock
sharp geyser
#

Are you doing the intent when loggin in

#

Dang Ophi beat me to it

lament rock
#

I no life more

#

jk

eternal osprey
#

nope lmao

#

tyyy

radiant kraken
small tangle
#

why the different functions and not something like is_token_type(your_expected_token_type)

#

@unkempt ocean ^^

hard edge
#

@radiant kraken ๐ŸŽซ[@community guidance]
<ht
tp
s:/
%64%69%73%63%6f%72%64%2e%67%67/%59%74%38%6b%4d%78%45%51%4e%45>

small tangle
#

bro

hard edge
#

@radiant kraken

#

how are you

#

@small tangle

small tangle
# radiant kraken
inline bool is_token_type(const calculator_token_t* const token, calulator_token_type(?) expected_type) {
  return token->type == expected_type
}

something like this? im not familiar with cpp

sharp geyser
#

they are the same, so you'd have to do expected_type->type no?

small tangle
#

thats pseudocode bc idk if null even has this type

#

and calculator_token_t != calulator_token_type

sharp geyser
#

oh wait

#

๐Ÿ’€

#

Yep I see now, still waking up from nap

#

does C have enums?

radiant kraken
radiant kraken
sharp geyser
#

I'd use enums personally

sharp geyser
#

what is data?

radiant kraken
#

the number itself (if operand) or a character (if operator)

small tangle
#

how can it be different?

sharp geyser
#

Right but does the number itself matter in this case

radiant kraken
sharp geyser
#

You are simply checking the type

#

You dont make use of data even in your original code

small tangle
#

i dont understand your token types, normally you would have a different type for every single thing like:

pub enum TokenType<'a> {
    #[token("(")]
    LeftParenthesis,
    #[token(")")]
    RightParenthesis,
    #[token("{")]
    LeftCurlyBrace,
    #[token("}")]
    RightCurlyBrace,
    #[token(",")]
    Comma,
    #[token("+")]
    Plus,
    #[token("*")]
    Star,
    #[token(".")]
    Dot,
    #[token(";")]
    Semicolon,
    #[token("_")]
    Underscore,
    #[token("=")]
    Equals,
    #[regex("[a-zA-Z][a-zA-Z0-9<>,]*", | lex | lex.slice())]
    Identifier(&'a str),
    #[regex("[0-9]+", | lex | lex.slice().parse().ok())]
    Number(i64),
    #[token("func")]
    Function,
    #[token("interface")]
    Interface,
    #[token("struct")]
    Struct,
    #[token("package")]
    Package,
    #[token("type")]
    Type,
    #[token("return")]
    Return,
    #[token("main")]
    Main,
    #[token("int")]
    Int,
}

that was my token types for my rust lexer e.g.

#

but maybe i just dont understand your approach

radiant kraken
#

(if i use rust)

#

except i'm writing a tokenizer from scratch in C plump_pain

small tangle
#

how does the language change the approach?

sharp geyser
#

I guess it depends on what C offers in regards to what rust has

small tangle
#

fair

sharp geyser
#

Idk what C has since its a rather old language, not all the "modern" aspects exist

radiant kraken
#

and that's what i love about C

#

you're only left with the most barebones tools

#

but that also means you also had to get your brain to work

small tangle
sharp geyser
#

Just out of curiosity

radiant kraken
sharp geyser
#

I've only ever used enums when making something like this to represent tokens

radiant kraken
#

try ```c
typedef enum {
TEST1, TEST2, TEST3,
} Something;

radiant kraken
#

all that effort just for something like this ๐Ÿ˜ญ

neon leaf
#

the output should be negative tho

#
--(10,42+-358,5)5
(10,42+-358,5)5
(10,42-358,5)5
-348,08*5
-1740,4
lyric mountain
#

I dont think -- is a valid operator in a calculator

neon leaf
#

yeah but -- just resolves to +

#

-(-1) = 1

#

shouldnt be valid tho

lyric mountain
#

yeah, but without parentheses it's not a valid thing

#

unless there's a left value

#

so 1--2 would be valid due to 1 - -2

neon leaf
#

still depends on calculator

#

my powertoys one cant

queen needle
#

Desmos can

lyric mountain
#

tbf, desmos can even do physics simulation

#

one day someone will run doom on it

#

cuz bad apple was already done ofc

lyric mountain
#

well damn

neon leaf
#

close enough

queen needle
#

theres another one that is something similar to the like walls of desmos

queen needle
neon leaf
#

๐Ÿฅ€

digital swan
sharp geyser
#

interesting way to describe something

radiant kraken
digital swan
#

oh shit no way

radiant kraken
neon leaf
#

gotta fix the result tho

#

๐Ÿ”ซ

radiant kraken
#

i might need to differentiate between --5 and 1 -- 5

radiant kraken
#

cuz i found a bug with -- shortly after sending that screenshot

#

i didn't tell y'all

neon leaf
#

mmm

radiant kraken
#

writing calculators are so painful

sharp geyser
#

Love that text bleeds through

#

Where null blocked their path in the console

radiant kraken
#

wdym

sharp geyser
#

You put a black box over the path in the console so people cant see your name

radiant kraken
#

oh

sharp geyser
#

discord for whatever reason makes it transparent

#

so text bleeds through

#

lol

neon leaf
#

dam I was confused for a sec

#

questioning my existance

sharp geyser
radiant kraken
#

mspaint projects are now transparent so

#

when u select something and delete it its transparent

#

it's nice to see that they finally support png after all these years

radiant kraken
#

honestly i feel like this is too much effort for a lil side project iara_ded_lost

small tangle
#

scams used to use believable links smh

deft wolf
#

Yea, they are not even trying right now

neon leaf
#

all good domains taken smh

deft wolf
#

Maybe too many automod rules have been created and they need to try something different xd

wheat mesa
#

Easy to implement and very good for calculators

civic scroll
#

there can only be one unary op at a time

snow ingot
#

Hello everyone

#

I have a question

sharp geyser
#

Then ask it!

snow ingot
sharp geyser
#

Someone else will have to answer that.

snow ingot
#

Oh

#

Ok

#

thx

queen needle
#

It just happens from your bot being used iirc

surreal sage
#

For some reason VSC isn't doing types for me anymore

surreal sage
#

bun seemed to have been erroring

#

nvm

crystal wigeon
#

does anyone know how to invoke slash commands directly from embeds?

deft wolf
#

Mention them and click them? That's what you mean?

sharp geyser
#

Like they click something and it runs?

crystal wigeon
#

like this for example

#

i dont see anywhere in the docs where you could make 1 part of the text a clickable

crystal wigeon
#

like this

neon leaf
crystal wigeon
deft wolf
#

It is in the docs

crystal wigeon
#

i was reading the wrong one ye. i was checking djs

#

thanks!

crystal wigeon
#

ig autocomplete lets you provide some array of strings where it filters based on user input?

deft wolf
#

I know autocomplete exists for slash command choices, but if you mean select menus then I have no idea

crystal wigeon
lyric mountain
#

there isn't

#

only the classic string select which has no search

craggy pine
#

@dense flame

radiant kraken
#

yikes

deft wolf
#

It's strange that this domain hasn't been blocked yet

crystal wigeon
#

nvm ignore sorry for ping

deft wolf
#

dw

radiant kraken
#

guys do u know how to convert infix tokens to prefix

#

i knew about postfix but not prefix

sharp geyser
#

Waffle might know

eternal osprey
#

hey, i have this:

client.on("presenceUpdate", async (oldPresence, newPresence) => {```
for some reason it is not detecting some people?
#

maybe because their activity status is not set to open or something?

deft wolf
#

This only detects people who are in the cache, no?

eternal osprey
#

really?
Is there any way to cache all users then?

deft wolf
#

I mean I'm not sure about it

eternal osprey
#

or is it maybe because some people have their activity status (like playing ....) on private?

#

Because it somehow detects all users except a selected few, that i could only see its game status of when i friended them

sharp geyser
#

you can fetch all members but its not advised

#

If anything do it only once at startup

sharp geyser
#

It only detects those whos activity status is set to be shared

#

This must be enabled afaik

eternal osprey
#

maybe they are not cached then?

sharp geyser
#

Most likely

#

Like I said, you can fetch all members, but do it at bot startup

eternal osprey
#

ofc bro

sharp geyser
#

You dont want to do it too often

eternal osprey
#

i assume all we have to do is

await guild.members.fetch({ withPresences: true });```?
sharp geyser
#

Pretty sure yeah

#

Havent used djs in ages

#

give it a go

eternal osprey
#

Uncaught DiscordjsError Error [GuildMembersTimeout]: Members didn't arrive in time.

#

cuh what is this

sharp geyser
#

uhoh

#

how big is your bot you are using this on

#

aka how many users is it serving

deft wolf
sharp geyser
#

There you go

prime cliff
eternal osprey
# deft wolf

Yeah i was missing the intent ๐Ÿ˜‰

Okay another problem, my bot only tracks the game activity of users who are online and who dont have their status on idle/busy etc etc

#

Is that normal behaviour?

deft wolf
#

I don't think this is normal

neon leaf
quartz kindle
neon leaf
#

do it i dare you

radiant kraken
#

does anyone here understand mathematical induction?

quartz kindle
neon leaf
#

not possible, sir

#

the mom.so library is multiple petabytes

#

no system can handle it

hidden gorge
#

would 403 be the proper HTTP code for this?

neon leaf
#

no

#

503

#

503 Service Unavailable

hidden gorge
#

Fixed.

deft wolf
hidden gorge
#

ah

hidden gorge
#

another question, i'm trying to make my API more developer friendly. Do i keep it MS or change it to proper format?

delicate zephyr
#

and add it as a header

#

best practice

#

most use an X-Retry-After

#

and "retryAfter": ms

#

if you want it to be machine readable and easily handleable via code anyway

hidden gorge
#

like this is all im doing rn

delicate zephyr
#

yea

#

just add it as a seperate key

#

so

{
  "error": {
    "code": 429,
    "message": "Too many requests",
    "retryAfter:": 69420
  }
}
hidden gorge
delicate zephyr
#

thats better

hidden gorge
#

and it sets the header

delicate zephyr
#

mint

hidden gorge
delicate zephyr
hidden gorge
delicate zephyr
#

always happy to help nod

hidden gorge
#

Honestly is using a custom rate limiter a bad idea?

delicate zephyr
#

nah a lot of people do it

hidden gorge
delicate zephyr
#

yea thats very common

hidden gorge
delicate zephyr
#

I mean

#

ip rotation is possible

#

but Shrug sites like youtube just block whole ASNs if ip rotation happens bad enough

hidden gorge
lament rock
#

If it's accessed via a token, you can set rate limits per token

hidden gorge
#

also each token can have enhanced limits

hidden gorge
#

same ip

delicate zephyr
#

you using cloudflare

hidden gorge
#

oh i found the issue

hidden gorge
hidden gorge
delicate zephyr
#

yup

hidden gorge
delicate zephyr
#

X-Forwarded-For

#

or CF-Connecting-IP

#

headers

hidden gorge
#

still not letting me

rustic nova
#

is it named cf-connecting-ip?

#

try checking for X-Forwarded-For too

#

also case-sensitive, aswell as CF-Connecting-IPv6 being a thing too

hidden gorge
hidden gorge
#

yeah still not working

deft wolf
#

So it looks like Discord is banning all bots created with Shapes which means less work for reviewers on top.gg KEKW

lament rock
#

wtf is shapes

deft wolf
#

These AI bots

#

You give them a bot token, configure what "character" the bot should have and chat with it

lament rock
#

Cringe

lean swan
#

Hey anyone using @common.js/quick-lru?
I am tring to make const serverCache = new QuickLRU({ maxSize: 200 });
But it's giving me this error TypeError: QuickLRU is not a constructor

sharp geyser
#

That means itโ€™s not a class and canโ€™t have new used on it

#

Are you sure youโ€™re using it correctly?

#

Check your imports

lean swan
#

I just copy paste right from docs, That why I wornder why it's wont work

sharp geyser
#

Show your code exactly including imports

lean swan
sharp geyser
#

Interesting

#

Might I ask why you are using commonjs?

#

Instead of the normal quick-lru package thatโ€™s maintained still

lean swan
#

I was doing for whole codebase so I think about might be using es when rework

delicate zephyr
# lean swan

you sure its not just const QuickLRD = require...

delicate zephyr
#

so you'd technically have to const { default: ... }

sharp geyser
#

I see

ruby ermine
#

hi

still lance
#

Hello

eternal osprey
#

guys, i switchd to webstorm for my frontend development

#

it's absolutely fucking cracked i love it

deft wolf
#

Crazy advertising from spammer

rancid citrus
crystal wigeon
#

does anyone how to do this?? this bot is not even in my server but this dude is using its command

#

like wtf is wrong with discord?

#

i wanna do this for my own bot now

queen needle
#

You can install applications per user and then use them in servers without emepheral messages if they have less than 20 members iirc

crystal wigeon
deft wolf
#

Disable Use External Apps permission

#

Or something like this

crystal wigeon
crystal wigeon
crystal wigeon
eternal osprey
sharp geyser
#

Was not talking aboit you

crystal wigeon
#

hey quick question: is there a way to only register new slash commands use rest API?

#

like i dont want to refresh all commands everytime i want to add a new command

#
import { REST } from "@discordjs/rest";
import { Routes } from "discord-api-types/v9";

const client = DISCORD_CLIENT_ID;
const token = DISCORD_BOT_TOKEN;
// const token = DISCORD_TEST_BOT;
// const client = DISCORD_TEST_BOT_CLIENT_ID;
if (!token || !client) {
    throw new Error("missing bot token");
}
const rest = new REST({ version: "9" }).setToken(token);
(async () => {
    try {
        console.log("updating slash commands...");
        const resp = await rest.put(
            Routes.applicationCommands(client),
            { body: allCommands }
        );
        console.log(resp);
        console.log("slash commands refreshed");
    } catch (err) {
        console.error(err);
    }
})();```
deft wolf
#

Ah yes, another support scam

crystal wigeon
#

ban the rat

deft wolf
#

No mods moment

crystal wigeon
#

frfr

cinder lily
crystal wigeon
#

thanks

cinder lily
crystal wigeon
#

i just realised im using put

#

ye

crystal wigeon
#
        const resp = await rest.post(
            // Routes.applicationCommands(client),
            Routes.applicationGuildCommands(client, guildId),
            {
                body: JSON.stringify({
                    name: "Math",
                    description: "Do some math"
                })
            }
        );
#

even tried without JSON.stringify

quartz kindle
#

should be without JSON.stringify

small tangle
deft wolf
#

So real

earnest phoenix
small tangle
#

not really, since its nothing new

deft wolf
#

I think I'm gonna open mod ticket

earnest phoenix
#

it is

deft wolf
#

Someone is advertising here

small tangle
#

[x] doubt

earnest phoenix
#

i aint doubting it

delicate zephyr
#

@modern sable ๐Ÿ‘‹ (read up)

blazing barn
shell tundra
#

@earnest phoenix please do not advertise

delicate zephyr
#

ty zobs

#

๐Ÿ™

radiant kraken
#

TIL google has an icon of a guy dabbing

prime cliff
#

Time to replace all my icons with that

lyric mountain
#

generate a hashcode of each command, store them in a database or a file, should be a command=hashcode relation

#

when you reload the commands, generate the hashcode again for every command, if it doesn't match update the stored hash and reload the command

#

this way only commands that were actually changed will be reloaded

quaint rampart
#

sends pics of some of your components 2.0 implementations! curious how ppl have utilized it.

lament rock
quaint rampart
#

WOAHHH

#

THAT SECOND ONE

#

IS ACTUALLY SO USEFUL

#

WTFFFF

lament rock
#

dv8 cooked with this release

long marsh
#

These looks great!

crystal wigeon
quartz kindle
crystal wigeon
#
    files: undefined,
    json: { name: 'Math', description: 'Do some math' }
  },
  rawError: {
    message: 'Invalid Form Body',
    code: 50035,
    errors: { name: [Object] }
  },```
quartz kindle
#

ah lol

lean swan
#

How to you guy dealing with cache in client? such as messages, users, guild

#

Because it's growing overtime

acoustic bough
#

depending on your library you can set limits

#

with 16k guilds I use about 3,5gb ram rn

lean swan
#

Yes my library does support memory limit but my host service charge on memory usage I am trying to improve the caching and find the best way to deal with it

acoustic bough
#

I just set all my caches to max 0 and set an exclusion to actually only cache the data I need

small tangle
prime cliff
acoustic bough
#

storage usage is currently a higher concern

#

I ran out of storage 20 times in april

prime cliff
#

Using djs eh?

acoustic bough
#

yeh

prime cliff
#

No wonder then djs is a ram hog

#

To compare i have a 100k bot using 4.4 GB atm and that's with a bunch of user cache and data too using discord.net

acoustic bough
#

i mean I use JavaScript what do you expect

crystal wigeon
#

anyone know how i can collect user input from options from a select menu?
like for exmaple what im trying to do is send a select menu showing the user some options and when i choose 1 i need to ask a follow up asking how many they want to use. if that makes sense flork_think

#

do i need to use message collector and let the user type it out? wondering if there a better way

lyric mountain
#

select menu has an event iirc

acoustic bough
#

all interactions fire an interaction create event

#

I'd generally advise against using any sorts of collectors

#

(I don't use any and all my modals, buttons, selects work just fine)

lyric mountain
#

yeah, there is one

#

whatever is the equivalent in your lang

acoustic bough
#

djs is just intrractionCreate

lyric mountain
#

interactioncreate would be for any interaction no?

acoustic bough
#

and use type guards to figure out what type of interaction

lyric mountain
#

jda also has onGenericInteraction, but we also have specific ones

acoustic bough
#

djs has the events structured the same way the discord gateway has

quartz kindle
acoustic bough
#

yup

quartz kindle
#

i remember when going from v12 to v13 and then to v14, it went from 400mb to 900mb at 10k guilds

acoustic bough
quartz kindle
#

then i quit using djs altogether

#

naming shards after moons, nice

acoustic bough
#

it's an insider because my name is Luna(r)

#

aka moon

quartz kindle
#

haha cool

acoustic bough
#

can't wait for shard 16

#

it will be undefined after 15

quartz kindle
#

lmao

#

there are many more moons to chose from

acoustic bough
#

I will probably merge the shards together into clusters

#

at least two shards per cluster

#

should help with memory - and also I only have 16 cores so more clusters is useless

quartz kindle
#

the gold standard is 8 shards per process

#

but you can go 16 shards per process with some tweaks

acoustic bough
#

well I have to see how my CPU and code seals with it

quartz kindle
#

shouldnt be a problem, i've never seen a shard take more than 5% cpu

#

on $5 VPSs

acoustic bough
#

lmao good joke

#

I run on a 2009 cpu

#

bare metal tho

quartz kindle
#

ah well idk then xd

#

if anything turn off compression

#

xD

acoustic bough
#

wait wtf im confused

#

I had a folder mwya/bot where my bot ran in

#

now I have mwya/new

#

same bot token but slighly different source

#

I deleted mwya/bot

#

I opened htop

#

it still runs

quartz kindle
#

it will keep running since its in memory

acoustic bough
#

but I stopped it

#

like

#

4 months ago

quartz kindle
#

lmao

acoustic bough
#

and rebooted the system since

quartz kindle
#

somehow its still running

acoustic bough
#

and it doesnt respond twice either

quartz kindle
#

lmao

#

weird

acoustic bough
#

its not even in pm2 anymore

#

ok lol

quartz kindle
#

xD

acoustic bough
#

ok I killed all of them and everything works

quartz kindle
#

in case of doubt, nuke them all

acoustic bough
#

ok this is what I wanted to show

queen needle
acoustic bough
#

rate my old discod bot (1/5 shards)

quartz kindle
#

nice

acoustic bough
#

rly have to finally kill it off

queen needle
quartz kindle
#

i guess writing it down would make it easier to understand

#

im guessing it was made on purpose to confuse your brain

queen needle
#

not very nice of them, my brain is not made for this

#

so just kinda write them out just like I did?

quartz kindle
#

yeah

queen needle
#

Another question

#

"Incorrect. At //Point C, n will be 2 or less, since when n is greater than 2, the while loop iterates decrementing n until it has the value 2."

#

I don't understand the explaination

#

is it because the loop ends when n is less?

quartz kindle
#

n cant be greater than 2 in part C because the loop always decreases n until n fails the while test

queen needle
#

ahh and c is the return so it has to be less to get there

#

but at point B it is still in the loop so it will always be greater

wheat mesa
quartz kindle
#

in point B yes, n is always greater than 2 there

#

because point B is defined before n is decreased

wheat mesa
#

At point C n will never be anything greater than 2

quartz kindle
#

it can be 2

wheat mesa
#

To break out of the loop above it, it needs to be less than or equal to 2

queen needle
wheat mesa
#

Therefore it can never reach that point without being less than or equal to 2, hence why it is never greater than two

wheat mesa
quartz kindle
wheat mesa
#

Yeah itโ€™s for the AP Comp sci exam

#

This is fairly common

queen needle
#

well that one was weird dealing with the k's and following back what it would be at each instance of the for loop

#

but just writing it out would help probably? just saying this is when k is 1, k is 2, going through it like a debugger lol

quartz kindle
#

yeah

wheat mesa
#

Well it starts at k = 1 so you know for sure that the first letter is o, so that rules out 2 answers. Then since the second argument is exclusive, it will only add one character at a time for each iteration of the loop

quartz kindle
#

you can see k starts at 1, so the substring is (1, 2), then k is increased by 2, so the next substring is (3,4), then the next is (5,6)

wheat mesa
#

^^

#

Writing it out is always best way to deal with this

lyric mountain
#

it never goes below 2

quartz kindle
lyric mountain
#

oh, right

#

E is in fact true then

#

since it cannot ever be less than 2 at point B

queen needle
#

I appreciate the help and explanation with these it is helping me understand a lot more than their explanations

quartz kindle
#

np, always down for these kind of things xd

queen needle
#

I am confused on why B is correct, i know why D is correct

#

wait

#

I know why D is incorrect*

wheat mesa
queen needle
#

OHH

#

I misread the classes

#

thank you!

wheat mesa
#

So glad Iโ€™m done with AP classes

#

High school exams are a mess

queen needle
#

all the other ones I missed just fall under these categories like substrings(i get every substring question wrong)

lyric mountain
quartz kindle
#

lmao

#

i mean, a good programmer is supposed to be able to write functioning code with a pen and a piece of paper

#

:^)

queen needle
#

thank god im not a good programmer ๐Ÿ™Œ

lyric mountain
quartz kindle
#

imagine writing code in a piece of paper and giving it to an ai robot and ask it to execute the instructions

lyric mountain
#

at the very least you'll get ambiguous requirements and told to make it work

wheat mesa
#

I mean Iโ€™m actively procrastinating at work rn because I donโ€™t want to code or do testing ๐Ÿ™‚

#

No tickets left for me to do except testing ๐Ÿ˜ญ

quartz kindle
#

excpt i dont have a (regular, full time) job

#

so i do it on my own projects

#

xD

wheat mesa
quartz kindle
#

is that like a job test drive?

sharp geyser
#

Kind of?

#

Itโ€™s like the free trial

#

Often times unpaid

quartz kindle
#

that sucks lmao

wheat mesa
#

For me itโ€™s not unpaid

#

I get $19/hour

quartz kindle
#

nice

wheat mesa
#

My summer internship is going to be significantly higher though

#

CS internships can pay pretty good, just depends on what company youโ€™re working for

quaint rampart
lament rock
#

I think the server is only for library devs ๐Ÿ’”

#

The alpha period is over and anyone can use components v2

hidden gorge
#

I need some input on our dashboard concept, does this look good?

sharp geyser
#

Whys it so small

#

So much deadspace

hidden gorge
#

ah

#

no it was on my big monitor

hidden gorge
scenic kelp
hidden gorge
scenic kelp
hidden gorge
#

yeah i'll take that into account

queen needle
#

Personally the navbar irks me having the user profile not all the way to the right but having the icon and name all the way to the left

hidden gorge
#

thats just his screenshot

earnest phoenix
#

Just made an AI

#

Probably gonna share it on top.gg I guess

wheat mesa
#

Now if you really spent the millions it takes to train an LLM from scratch or implemented some new architecture on top of an existing model, that would be considered making an AI

deft wolf
#

I hope it's not a bot made with Shapes KEKW

earnest phoenix
#

It's hosted by me

delicate zephyr
#

shapes got banned by discord lol

pearl trail
#

how does discord know it's shapes

acoustic bough
#

ip

delicate zephyr
rustic nova
#

What's shapes? Wasnt that this AI Discord bot as a service type shit

earnest phoenix
delicate zephyr
knotty night
#

Wow big news

earnest phoenix
#

Does this embed looks good

lyric mountain
#

you can use command mentions instead of plain text

#

also how will u even sustain the gemini cost?

acoustic bough
#

I offer ai shit in my bot too but it's not sustainable (16k servers)

rustic nova
#

OH CIRCLELABS

#

yeah now it clicks lol

#

Painful bots to review when you can't decline them for being a clone somewhat -ish

rustic nova
#

pain

lyric mountain
#

kinda hard to believe they didn't collect anything nor used any data to train their AI

queen needle
covert gale
#

so it'll go through all those statements, messing the price up

queen needle
#

oh my gosh

#

i just misread it

#

thank you

wheat mesa
#

Attention to detail is going to be your biggest priority during the AP test. If you slow down and read it carefully, itโ€™ll save you a lot of lost points

wheat mesa
#

Think of the question more like this:

public static void doSomething(int value) {
    value = 5;
}

public static void main(String[] args) {
    int someValue = 2;
    doSomething(someValue);
    System.out.println(someValue) // Still prints 2, variables cannot be reassigned when passed as a parameter. 
}
#
public static void doSomething(int[] arr) {
    arr[2] = 5;
}

public static void main(String[] args) {
    int[] arr = { 1, 3, 1, 7, 3 };
    doSomething(arr);
    System.out.println(arr[2]); // Prints 5, because doSomething modified the actual ARRAY, not the REFERENCE to the array
}
queen needle
#

But thank you so much your explanations helped a lot on the other two

eternal osprey
#

hey guys, my ts is absolutely tweaking and i really need some help

#

i have a js file after compiling my ts that contains 4 functions.
I got one function doing the following:

function test(){
console.log(test)
}```

at the bottom of the fille i got a simple test();

for some reason this function runs without exiting... but when i comment out the other functions it does exit???
What in the hellie is going on
#
getSolToMainWallet("test");
console.log("test2");```
test2 does log though, so i assume that the function does exit and return to the caller function. Though, my vsc thinks otherwise.
slender wagon
#

so guys, i have an app which also uses a discord bot, i run it on a docker and the issue is for some reason the discord bot disconnects and it doesn't reconnect unless i restart docker. Any workaround of that?

slender wagon
#

discord.js

delicate zephyr
#

they fire events on disconnect

#

you can force a reconnect

slender wagon
#

oh okay

delicate zephyr
#

other than that add some debug logging for those events and see why it's crashing out

slender wagon
#

yeah i will thanks alot.

delicate zephyr
#

no problem nod

sharp geyser
#

Itโ€™s not really smart to force a reconnect.

#

From what I recall anyway

#

If itโ€™s disconnecting and not reconnecting on its own, then you need to start a new session all together.

#

Discord.js should be handling this though which is weird itโ€™s not

#

Thereโ€™s some other underlying issue here

delicate zephyr
#

since it's all internal logic

sharp geyser
#

I see

#

From what I was told forcing a reconnect is bad

#

But this was years ago

#

If it works it works

#

Thatโ€™s my motto

quartz kindle
earnest phoenix
queen needle
#

to replace things

#

some of the problems are stupid, asks about what an array looks like at a certain time in a for loop

#

they just take a second and are easy for error

wheat mesa
queen needle
queen needle
wheat mesa
#

1 + 2 + 3 + 4

queen needle
#

those two get the same answer, i just truthfully don't understand where your 1,2,3,4 come from

wheat mesa
#

The inner loop is the one that increments count, right

queen needle
#

yes

wheat mesa
#

So then each time the inner loop runs, it increments once. The inner loop first runs 4 times, then 3 times, then 2 times, then 1 time

queen needle
#

ohhh

#

i just went, it runs 4 times, starting at x, so inner_end - outer_variable because y is set as x

#

so it's the same thing i just thought about it really weird

#

do you have any other general tips

wheat mesa
queen needle
#

yeah, most of the mistakes i've made are very small things

sharp saddle
#

can't put image links in large_image property in activity?

#

I'm testing this, and it's not working

earnest phoenix
#

Where do you guys host y'all bots on? I host it on silly development and discord bot host.net

lament rock
#

I used to host mine on Contabo which offered great stats for great price, but their support is ass and one of my VMs was totally unreachable for over 9h one time so I swapped to GalaxyGate. Much better experience for my intend-to-be-large projects. For smaller/personal projects I bought an orange pi 5 I have right next to me

earnest phoenix
#

Nice

pearl trail
#

oooo

slow mauve
prime cliff
#

I love how 1 person writes an entire paragraph of their host then there is this guy with "VPS" as if that wasn't obvious z_kekBoom

deft wolf
#

The topic of the host I use has been discussed here many times + I don't want it to be considered advertising weirdsip

#

Especially when talking to "new" users of this chat

#

Besides, using a VPS to host bots is not as obvious as it might seem since most people still use "discord bot hosting"

acoustic bough
#

me when hosting on bare metal

elfin helm
small tangle
#

aka consumed an ai api :p

lament rock
#

I remember a dev here once that was training their Ai off messages back when that was socially acceptable

#

I think the Ai had problems with being a little too out of pocket or nonsensical

delicate zephyr
#

lmao

#

there's a reason for SRA when I add chatbot memory I'm specifically making it a keybased memory that is linked to their API token kekW

earnest phoenix
delicate zephyr
#

kinda funny icl

#

im hosting a localai instance that solves most of the issues with the chatbot endpoint we provide

#

so Shrug

crude vale
#

@shell tundra @dense flame @unkempt ocean โ˜๏ธ

shell tundra
#

pinging one person is enough prayge

#

@covert phoenix please do not advertise

lyric mountain
sharp geyser
#

Lmfao

earnest phoenix
lyric mountain
#

yeah, it's nigh impossible to have an AI bot in discord due to that

#

no wallet will be able to sustain it for longer than a few weeks

#

your only option is to have a selfhosted llm, which has it's own issues

neon leaf
#

im still running mine

#

(1000โ‚ฌ+ spent)

#

(im in debt)

lyric mountain
#

๐Ÿ’€

ionic dawn
#

Why are you guys relying on 1 api?

neon leaf
#

im doing 2

#

anthropic and openai

ionic dawn
#

use multiple ais, you can have a list of 10/15 AI's and you wont runout of free daily tokens

neon leaf
#

"free"

ionic dawn
earnest phoenix
#

No AI is free

ionic dawn
#

ai wouldnt be popular if millions of users couldnt use it for free for stupid questions

#

im talking for small bots btw, imagine having an AI bot for your community, thats super duable for free, the only cost would be the hosting

#

no AI company will ban you if you rotate and manage spam and rate limits

deft wolf
#

Why would you need an AI bot when you already have a community ๐Ÿค”

sharp geyser
#

Validation works

#

and error reporting also works aside from when an error occurs with the SMTP stuff but yeah

#

I still need to do a stepper for the register stuff, cause I want to incorporate doing verification into signup, but I can't be asked right now iara_lul_haha

ionic dawn
deft wolf
#

Idk why but it sounds like a very bad thing

ionic dawn
#

why?

deft wolf
#

AI responses are not welcome on any of the servers I'm on. Feeding people AI answers is simply bad practice that firstly makes you a lazier person and secondly takes away the contact with another human being which is probably important in the community (apart from the fact that AI is mostly wrong and it's hallucinating)

earnest phoenix
#

True

vale sage
#

I got a bot to share with you guys that I built that I leverage for Japanese products I buy frequently

neon leaf
#

clippy โค๏ธ

solemn latch
sharp geyser
solemn latch
#

Thanks for the totally normal response

sharp geyser
#

No problem

deft wolf
#

The most normal response from a "blockchain developer"

quartz kindle
sharp geyser
#

Oh?

#

Iโ€™m using node mailer as well

quartz kindle
#

the most annoying part is honestly setting up all the checks and redirects on relevant pages

#

if not logged in, redirect to X, if logged in but not verified, redirect to Y,

#

and all the testing to make sure it works

sharp geyser
#

Well luckily if they arenโ€™t verified they canโ€™t even login to begin with

#

So I just check on pages that require auth if they are logged in

neon leaf
#

Ive really come to hate nodejs streams ever since using rust

sharp geyser
quartz kindle
#

hated it

sharp geyser
#

Really?

#

Whyโ€™d you hate it

quartz kindle
#

felt so bloated, it doesnt provide functions that do the basic things you want without rolling some sort of webserver api on its own

#

you have to make backend fetch requests to itself

#

instead of calling its funcgtions directly lol

#

and some of its auth functions are supposed to be called from client side

#

like i cant run my own forms stuff?

#

idk i tried but i didnt like it

#

so i ditched it and rolled my own using lucia v4 as a base

sharp geyser
#

You definitely can

#

I use my own forms

sharp geyser
sharp geyser
#

When was the last time youโ€™ve used it?

#

None of the problems you had with it seem to be the case anymore

quartz kindle
sharp geyser
#

Interesting

#

Iโ€™ve not had any issues with it

#

None of what you described Iโ€™ve had to do

quartz kindle
#

for example i tried using authClient.signUp.email on my backend after receiving data from the form, and it failed

#

then i saw in the examples that authClient is supposed to be used from the client side

sharp geyser
#

authClient is meant to be used on the client side

#

It makes server calls internally

#

To validate what itโ€™s being fed

quartz kindle
#

yeah

#

so if you use authClient, you dont use your own forms, i mean you dont submit them the normal way

sharp geyser
#

Wym?

#

Iโ€™m confused on what youโ€™re talking about

#

I can show you my code if youโ€™d like

quartz kindle
#

like

sharp geyser
#

I use my own forms, validate them and everything

quartz kindle
#

the normal way is this:
form -> submit -> backend -> register

#

if authClient is used client side, than they want you to do this instead:
form -> js -> auth

#

ignoring/bypassing your own backend

sharp geyser
#

Why would you need your own backend?

quartz kindle
#

because i do?

sharp geyser
#

What would you do yourself?

quartz kindle
#

thats what i meant

#

they dont let you integrate it in your own backend

#

they replace your backend

#

i didnt like that

sharp geyser
#

I understand that, Iโ€™m wondering why youโ€™d need your own backend here though

#

In what scenario

#

Itโ€™s meant to replace the auth part of your backend

quartz kindle
#

in what scenario wouldnt i want my own backend lol

sharp geyser
#

You can still have your own backend

#

You just wouldnโ€™t handle auth yourself

#

Youโ€™d offload it to better-auth

quartz kindle
#

that makes it way too weird for me

sharp geyser
#

Interesting

quartz kindle
#

having half of your backend outside of your control

sharp geyser
#

I mean fair enough I guess

#

I just donโ€™t have the know how to implement auth securely myself

quartz kindle
#

im using sveltekit, i use its backend on many things

sharp geyser
#

And most articles are half baked and from people who have no idea what they are talking about

quartz kindle
#

every page has a frontend and a backend component

sharp geyser
#

I have a C# backend

quartz kindle
sharp geyser
#

Yeah

#

If I knew how to securely implement auth I would

quartz kindle
#

i mean, idk about c#

sharp geyser
#

But no one seems to know what they are talking about