#development

1 messages · Page 94 of 1

rustic nova
#

yeah

quartz kindle
#

if it does, then thats how you do it

rustic nova
#

webhooks are the most reliable and most efficient way on doing it

#

using the check endpoint: will end up you getting ratelimited at some point
using the votes endpoint: up to 1000 votes

#

oh nvm was referring to servers only

#

yeah only way is webhooks

quartz kindle
#

nah man send votes by letter

#

:^)

rustic nova
#

yes

lavish dirge
#

Hi im getting reports that my bot is disappearing from servers where it is installed. It never shows up in the integrations list and then the slash commands stop working after a few days. These servers do not have over 50 bots installed so I dont think its because of too many bots.

Does anyone know what can cause this? i have no idea where to look

lyric mountain
#

Anything there?

lavish dirge
#

where can i see this log?

lyric mountain
#

Where are u hosting the bot?

lavish dirge
#

its stateless. its just an interactions API hook

#

so i have a rest API for interactions

#

thats it

lyric mountain
#

Yes, but it still need to be hosted somewhere

lavish dirge
#

oh yeah i have some servers. theres no errors in the logs

#

nothing like that

lyric mountain
#

Did u request the affected owners to check the audit logs?

#

If it got removed it has to be listed there

lavish dirge
#

oh right

lyric mountain
#

Else it's a discord issue

lavish dirge
#

ok thankyou! i will ask for the audit logs

lyric mountain
#

Yw

burnt blade
#

@dusky idol here’s your solution. Thanks Timmy

surreal sage
#
    /**
     * @param {string} cookie
     * @returns {object} session
     */
    getSessionInfo: function (cookie) {
        console.log(sessions);
        let filtered = sessions.filter((session) => session?.cookie === cookie);
        if (filtered.length > 0) {
            if (filtered[0]?.cookie) delete filtered[0]?.cookie;
            return filtered[0];
        } else {
            return null;
        }
    },```
Getting something smelly
#

The issue is at if (filtered[0]?.cookie) delete filtered[0]?.cookie;

#

The issue is:

#

The cookie gets deleted from the sessions array as well

#

I make a new array that is filtered from sessions
I check if the cookie property exists, if that's the case; delete it

#

But it deletes it from the sessions as well

#

Even if I did it like this

#
    /**
     * @param {string} cookie
     * @returns {object} session
     */
    getSessionInfo: function (cookie) {
        let session = sessions.find((session) => session?.cookie === cookie);
        console.log(sessions);
        if (session) {
            if (session?.cookie) delete session.cookie;
            return session;
        } else {
            return null;
        }
    },```
#

My goal:
Remove the specific property called 'cookie' before returning it

#

Fixed it by adding session = { ...session }; after if (session) {
Credits to ChatGPT

lavish dirge
# lyric mountain Yw

Hi @lyric mountain I got the audit logs. I can see that the log <user> added an integration for <my-bot> but I never see the second log <user> added <my-bot> to the server which I see on successful installations for other bots

lyric mountain
lavish dirge
#

yes

lyric mountain
#

interaction-only bots are never added to servers

lavish dirge
#

oh ok

lyric mountain
#

there's a separation between the terms "interaction" and "bot", they aren't mutually inclusive

lavish dirge
#

got it

#

so if this log is showing but the interaction doesnt show up in the list of integrations then its a problem on the discord side?

lyric mountain
#

does it have 50 interactions already?

#

interactions, not bots

lavish dirge
#

maybe? you mean - its installed on 50 servers?

#

or the server has 50 interactions installed?

#

im pretty sure the server has less than 50 interactions

#

actually my bot does have send message permission

#

so i think it should add the bot user

#

even though I dont use the permissions currently

lyric mountain
#

since there's no member to be given perms to

lyric mountain
#

there's a hard limit of 50 interactions, after that you cant add any more

lavish dirge
#

i dont think its the 50 interaction limit. Even after I revoke the bot scope and leave only applications.commands the installation link still adds a the user

#

i have application.commands

#

does that mean its a bot

lyric mountain
#

no, it means it uses interactions

#

not all bots use interactions, not all interactions are bots

#

the only thing they share in common is that both require some code processing events somewhere

lavish dirge
#

i understand

#

so if my integration is interaction only then why does it still add the user when i install via the link

lyric mountain
#

because the invite url still has bot scope in it

#

else it'd not add an user

lavish dirge
#

i had to update the default authorization link, even though i was using a link without the bot scope, it didnt stop installing a user until after i did that

#

sorry - i know a lot of these are dumb questions but youre really helping me

lyric mountain
#

don't worry, happy to help

lament rock
#

recently had a 9 hour downtime with no customer support from Contabo. Just switched to Galaxy Gate

#

reinstalling Postgres and RabbitMQ was a nightmare

lyric mountain
#

what region?

#

never had such long downtime

lament rock
#

us west

lament rock
#

other VMs I had in the same datacenter were still accessible, but the main VM with the database had 2 major outages since the start of 2023

solemn latch
#

👀 all of galaxygate had three incidents since late 2021, one was a part failure and another was a disk space issue so it only affected one node.

crazy their reliability.

lament rock
#

im so hype to not have to worry about downtime and I hope the customer support is competent

#

I took the liberty of writing my own blog post about my contabo experience. Was just :(

#

their vms were so good for so cheap

rustic nova
#

always a bad idea to have one provider for everything, so called vendor lock-in

solemn latch
#

thats true 👀

rustic nova
#

always have your app, database etc for each on different providers

#

even though I dont because I'm crazy and dont run important apps

#

also, if your budget does match it

#

have 2 different hosts that just have mirrored databases

lament rock
#

$$$

#

Im not made of cash atm

rustic nova
#

same lmao

lament rock
#

$20 for an 8GB node from GG is already steep for me

solemn latch
#

redundancy gets so expensive quick 👀

lament rock
#

My db only takes 9MB

#

thats with schema and entries

solemn latch
#

I was working on making something high availability(two of everything all the way down) and it was more than double the cost notlikenoot

wheat mesa
#

Oracle has had 0 downtime in the last year I’ve used it 😎

solemn latch
#

I had oracle downtime yesterday

#

👀

#

lmao

lament rock
solemn latch
#

I got like 4 emails about it

wheat mesa
#

Only problem is they may give you permanent downtime for no reason according to some other people that have had experience with it

lament rock
#

I was just gonna get me a pi

wheat mesa
#

Might’ve just been for your data center, I haven’t gotten any emails from oracle

lament rock
#

my wifi has unmetered data anyways

#

I have my own server pc, but no rack and shit sounds like airplane

#

2 xeons

rustic nova
#

I used to actively have 2-3 backup servers when I used to run critical, important apps

#

was cool stuff to setup ngl

wheat mesa
#

I’ve got a server pc with 2 xeons as well, only problem is that it’s from the early 2000s and still runs windows vista

lament rock
#

install linux

#

windows vms suck

wheat mesa
#

It’s not worth actually setting up

rustic nova
#

got my old laptop that is entirely airgapped through a firewall and only allows connections from my vpn or local network

#

pog

wheat mesa
#

I’ve got no use for it and the specs are actually kinda horrendous for today’s standards

#

It has like 8x less ram than my rpi 3

lament rock
#

rabbitmq is literally sv_cheats 1

rustic nova
#

You don't believe how much cool crazy microservice shit I'd do if I had the budget

#

like, a bunch of stuff with rpis or other microcontrollers, deploying them with ansible, rabbitmq too yes

lament rock
#

I'm gonna be working on audio processing shit sooner rather than later

#

but no money to hire

quartz kindle
#

managed to further improve it lmao

lament rock
#

is that for tiny discord

quartz kindle
#

yes and no, its gonna be a separate lib, but the improvements will be merged into tiny discord

#

thats the performance for the packer tho, which tiny discord almost doesnt use

#

discord needs a beefy unpacker, not a packer

rustic nova
#

Tim just make tinyjs already

quartz kindle
#

im still gonna work on the unpacker later

rustic nova
#

js you could even deploy on an ESP32 if you really wanted to

quartz kindle
#

lmao

#

i still didnt finish by serializer

#

i have a big issue with finishing things @_@

#

sort first, map later

#

actually, first sort, then slice, then map

solemn latch
#

Looks like you might be using sort wrong

earnest phoenix
#

Replace a < b with b - a

solemn latch
solemn latch
earnest phoenix
#

Ah yeah, access the points property and then subtract

lament rock
quartz kindle
#

it will probably serve you well then

quartz kindle
#

no idea

rustic nova
#

ez

#

just create a dockerfile, maybe docker-compose

#

done

#

you can either use the docker desktop on windows

#

or docker run IMAGE_NAME

jaunty basalt
#

Hey can anyone plz tell me how to make a schema in such a way so that I can show a user's warnings in this way-

await interaction.reply({ content: `${user.tag} has ${data.warnings}.` });```
jaunty basalt
#

Visual Studio code

#

Bruh
Visual Studio code.
Search on Google, it's very common between developers

wheat mesa
#

This

#

You cannot use this on android

#

mobile code editors in general usually suck

#

because you haven't made a bot that is verified on top.gg

sharp geyser
#

you put index that you need?

#

Arrays are 0 based indexes so first entry in an array is 0 second is 1, third is 2 and so on

somber ridge
#

Heyya @quartz kindle I’ve been trying to implement discord ratelimits from scratch but the docs are documented in a way where I’m having trouble trying to wrap my head around it
Do you mind if I ask more questions regarding this to you? Would really appreciate it!

surreal sage
#

I'm trying to cover an image with a gradient

#

But it isn't working quite well

#

I have a container div

#

Where in an img and a div

#

The div has a gradient

#

And then the image is common sense

#

I want them to stack on top of each other, which hasn't worked out yet.

crystal wigeon
#

hey, anyone using flask? python

earnest phoenix
#

(._.)

#

(·_·)

winged linden
#

hi i have a question

#

related to mongodb

#

how tf can i pull an index in an array

#

const result = await Account.updateOne(
{ server_id: serverid },
{ $pull: { roles: { $eq: [role_index] } } }
);

it removes some and some it doesnt any idea why?

#

basically i wanna remove a specific index for example index 1

dusky idol
#

I don't really use $pull tho

winged linden
#

bruh it works for index 0 but not other indexes

#

all good brother!

#

tryin to figure it out with chatgpt now

dusky idol
dusky idol
winged linden
winged linden
dusky idol
#

i see

#

you can use $set maybe

winged linden
#

i wanna remove it though, set doesnt pull out data

#

sometimes chatgpt is stupid lol, done it like that and it didnt work

dusky idol
#
database = await Account.find_one("server_id": serverid)

roles = database["roles"]
roles.pop(index) #put the index which you want to remove

Account.update_one({"server_id": serverid}, {"$set": {"roles": roles})```
solemn latch
#

chatgpt is wrong a lot

winged linden
#

1 sec

#

but i got a problem lol

    if (acc.admins.includes(req.user.id)) {
      console.log("Got Inside acc.admins.includes(req.user.id)");
      const role = acc.roles[role_index];
      if (role[0] == roleid) {
        console.log("Got Inside role[0] == roleid");
        const result = await Account.updateOne(
          { server_id: serverid },
          { $pull: { roles: role_index } }
        );
        console.log("Role removed successfully");
        console.log(result);
        res.redirect("/guilds/" + serverid);
      } else {
        res.redirect("/access");
      }
    } else {
      res.redirect("/access");
    }

i wanna check if its a valid id in the database first

dusky idol
#

oh

winged linden
#

it did find a match

#

{
acknowledged: true,
modifiedCount: 0,
upsertedId: null,
upsertedCount: 0,
matchedCount: 1
}

#

but didnt modify any

dusky idol
#

well I can't really understand it ze_catcry

winged linden
#

pretty sure

              { server_id: serverid },
              { $pull: { roles: role_index } }
            );```

smth is wrong in here idk what though lol
dusky idol
#

oh well what basically is the program

winged linden
#

finally made it work

dusky idol
somber ridge
# quartz kindle sure

Let’s say I have 3 requests
GET /guilds/1234/channels
GET /guilds/4567/channels
GET /guilds/80882/channels

These routes all stay in the same bucket, let’s say abcd

These routes calculate ratelimits independently (when I make 2 requests to the first route, 8 remain while the other two still show that 9 requests remain)

Im really confused on whether to map every endpoint including the top level resources (guild/channel id) to its ratelimit info
OR
map the literal string /guilds/:id/channels to a single bucket like how the libs do it

I’m confused on how to go ahead from there with both approaches

quartz kindle
#

honestly i havent done much regarding rate limits yet, but i would probably go for the way most others do it

#

however i also want to investigate how the bucket header actually works at some point and see if i can use it

#

instead of hardcoding all rules

winged linden
#

anyone good in html and can help me with something really quick?

quartz kindle
#

post your question and see

winged linden
#

but aint sure how i can do it lol

lyric mountain
#

actually

#

just put the label as a child of the field, then set top to a negative value

#

then u can set the label background to be the same color as the parent's background color

#

this will create a "hole" around the label

oblique sky
oblique sky
#

Why? It works for me
flex + flex-direction: column
margin-bottom can be a negative number

lyric mountain
#

because they want it merged, not aligned

#

basically this

#

easiest way is negative top, with the label being child of the field

oblique sky
#

Yeah, why don’t use flex for the container of inputs?

lyric mountain
#

cuz it'll break if u have more inputs in the same div

oblique sky
#

Oh ok

lyric mountain
#

a children label will guarantee it follows the field around too

winged linden
winged linden
#
            <h3>Add a Role</h3>
            <form>
              <label for="role">Role:</label>
              <select id="role" name="role" required>
                <option value="" disabled selected>Select an option</option>
                <option value="option1">Option 1</option>
                <option value="option2">Option 2</option>
                <option value="option3">Option 3</option>
              </select><br>
              <label for="amount">Needed Amount:</label>
              <input type="number" id="amount" name="amount" min="1" max="100" required><br>
              <input type="submit" value="Submit">
              <input type="button" value="Cancel" onclick="document.getElementById('popup').style.display='none'">
            </form>
          </div>```
#

what could i do?

lyric mountain
#

put the label inside the input

#

set negative top

#

set background color to match the parent

oblique sky
#

Basically using css (I use React)

winged linden
lyric mountain
#

...

#

how u don't know how to put something inside another thing?

winged linden
#

sorry lmao, dont know much about html i just know the basics

lyric mountain
#
<...>
  inside
</...>
winged linden
#

bro i can place it inside but what then

lyric mountain
#

if ur beginning in html, don't try to make something more complex

winged linden
#

true but i wanna make it nice if you know what i mean

lyric mountain
#

yes I know, and you shouldn't

#

don't put the horse in front of the wagon

#

go slow, improve your skills along the way

winged linden
#

true true

craggy pine
#

Lot of people tend to start developing with a high goal by creating something over the top which is beyond their skill. Start slow, take some HTML / CSS courses which for the most part are free and start with basic projects to get an understanding of how html / css works. 🙂

lyric mountain
#

yes, there are lots of html courses around the net

#

actually I think it's the subject with the most courses among all

winged linden
#

do u suggest any? i already know the basics so i wanna learn more now

lyric mountain
#

well, if it's regarding web pages w3schools/mozilla are good places to search for

#

don't watch videos, videos never update together with the languages

lyric mountain
#

to test what u learn, simply open a new blank page and press f12

#

u can test html/css/js directly on the browser

winged linden
#

yeah ik that, thanks though 🐐

#

for discord dashboard should i just stick with the path of using ejs or should i convert to react later on the long run?

oblique sky
#

react is pretty useful, I usually recommend using it with Next.us for the best performance

#

Their eco-system is the most powerful along all the alternates

lyric mountain
#

honestly, as someone who used react a lot, I'm starting to ponder whether react is really that better than pure html

#

like, the only advantage are the libs

oblique sky
#

React helps you to maintain the project and reusing components
But you might spend some time for understanding how to improve the performance such as reducing re-render

lyric mountain
#

cant u make custom html components?

sudden geyser
#

react is really about reacting to change in state

oblique sky
#

Of course, that is why it “helps”, not the only one way

lyric mountain
#

hm, state, forgot abt that

sudden geyser
#

though personally I don't think react handles state well since it couples it to the ui

#

but the idea/model is certainly good

oblique sky
#

Yeah, vue is much better at this part

pine nova
lament rock
#

delete frameworks

winged linden
#

in ejs we can use ajax but it isnt as efficient as react

oblique sky
#

the developer experience of web dev is really incredible nowadays

quartz kindle
#

really annoying too

#

the amount of tooling there is makes me stay away from frontend

winged linden
quartz kindle
#

cant do anything these days without having a shit ton of frameworks, packers, bundlers, mappers, converters, minifiers, etc...

winged linden
#

feels weird knowing tooo much backend and little frontend

quartz kindle
#

well i've done enough frontend

#

i hate having to setup all those tools

#

so if i have to, i'll just write raw html+css+js instead

rustic nova
#

at least you take the effort to try

#

I dont

#

I hate frontend

#

Like I'd wanna do some extremely cool dashboard shit if I would know how to do frontend like @civic scroll does

civic scroll
#

a stinky has summoned me

civic scroll
#

there's a difference between "i want a functional and usable ui fast" and "i want an absolute unit hand-crafted experience"

rustic nova
#

Like

#

its not the thing that I cant

#

its literally the layout shit I give up on

civic scroll
#

well layout is annoying

#

i get it

#

just render on canvas mmLol

rustic nova
#

done bootstrap, am capable of like, expanding an already existing layout

#

but

#

yes lmao

winged linden
civic scroll
#

i'd argue there are uniquely and equally hard challenges on both sides

winged linden
sudden geyser
#

Well i am building a dashboard related to nfts
opinion discarded

civic scroll
rustic nova
#

https://roadmap.sh/frontend if anyone's interested in actually starting to learn frontend, just found this recently, definitely not ads

roadmap.sh

Learn to become a modern frontend developer using this roadmap. Community driven, articles, resources, guides, interview questions, quizzes for modern frontend development.

civic scroll
#

stinky ads 111!!!1@!1

rustic nova
#

ban me

solemn latch
quartz kindle
#

🔨

civic scroll
solemn latch
#

mods are on the way

quartz kindle
#

the FBI too

#

pov mixing classes with binary encoding stuff

oblique sky
#

Scary

civic scroll
quartz kindle
#

this

#

uvebio

civic scroll
#

reminds me of "can-i-use"

quartz kindle
lyric mountain
#

why do they still list ie

quartz kindle
#

baidu browser

#

@_@

lyric mountain
#

tf is kaios

quartz kindle
#

apparently an android-based OS for old phones

lyric mountain
#

and obviously, of course safari doesn't support it

quartz kindle
#

neither does firefox

lyric mountain
#

never met anyone who uses firefox on mobile

#

oh, regular firefox doesn't too

quartz kindle
#

i use firefox focus

#

on my phone

lyric mountain
#

what's TP?

#

toilet paper?

quartz kindle
#

no idea

#

lmao

#

safari toilet paper

#

next big thing trust me

sudden geyser
#

i.e. canary / beta for safari

lyric mountain
#

ah

hallow shell
#

Can I remove my bot from top.gg?

rustic nova
#

sure, use the delete button on your bot page

hallow shell
#

Ah, looks like I have to leave edit mode and go to the info panel for some reason

#

Hmm

#

Is it possible to just make it not "live" instead of completely deleting it?

rustic nova
#

Nope

eternal osprey
#

hey in js, i created a set and added an element to it using set.add()

#

is there any way to store like an array into the set?

#

I ultimately want to store: user : number combo

lyric mountain
solemn latch
#

this sounds like something youd want a map for

lyric mountain
#

oh wait, what u want is ```
[
[a, 123],
[a, 123],
[a, 123],
[a, 123]
]

eternal osprey
#

yessirr

lyric mountain
#

yes, u can, but as woo said, better to use a map

eternal osprey
#

i see, maps are in java as well if i recall correctly?

lyric mountain
#

java or js?

eternal osprey
#

I once saw a package for it but i might be mistaken

#

no just out of curiosity

#

java

lyric mountain
#

java has all collection types built-in

eternal osprey
#

i kinda get why the names of java and javascript are similar, they share lots of functions

lyric mountain
#

that's mostly inherited from C actually

eternal osprey
eternal osprey
lyric mountain
#

js is only called "java"script because it used to be a layer between browsers and applets

lyric mountain
quartz kindle
#

you can add anything to sets, so yes an array can be added to a set

lyric mountain
#

while langs like rust, python, lua, pascal, etc didn't

eternal osprey
#

Yeah i see. Quite strange as i thought c++ was closer to c instead of java/javascript. And c misses lots of inbuilt functions like replace, replaceall, split etc

#

or my teachers just fucked me really hard into not allowing to use them, also a possibility.

lyric mountain
#

c++ is as close to C as is java, but c++ stood in the "minimal" side of the wagon

#

that's why it feels so barebones

eternal osprey
#

i see, so c++ would be easier to compile and assemble right than java/js right?

#

As it has less 'human code' to convert

lyric mountain
#

well, java doesn't compile to assembly

eternal osprey
#

owh

lyric mountain
#

java was made to be highly maintainable even in huge enterprise projects, while c++ kept performance as its main priority

eternal osprey
#

ahh i see!

#

Also, just out of curiosity... c++ is usually used for security right? But why is that? I mean, c++ is the main language for buffer overflows etc

lyric mountain
#

js was made to be used in browsers

#

which is also why it's so lenient regarding datatypes

eternal osprey
#

while other languages have built in catches, c++ doesn't and yet it still is highly used in security programs

lyric mountain
eternal osprey
lyric mountain
#

tho C is even more used for the latter

eternal osprey
lyric mountain
#

it can be, all languages can

#

c++ gives freedom, if u want to shoot yourself in the foot it wont prevent u

quartz kindle
#

security stuff uses low level languages for performance and integration into other low level systems mostly

#

nobody wants an operating system calling a nodejs process to calculate some security keys lol

eternal osprey
#

aha i see, this shit is quite interesting aint gonna lie

lyric mountain
#

also usually such code is done with minimal processing, so it doesn't need to be very maintainable

eternal osprey
#

the more i fuck around the more i get to enjoy this

quartz kindle
#

fuck around and find out

#

:^)

eternal osprey
#

yessir definitely

#

thanks for all the help tim, kuu, and woo. Can't appreciate it more for all the things yall are doing 🙂

wheat mesa
#

JIT compilation

#

Most compilers use JIT nowadays

lyric mountain
#

that's just JVM blackmagicfuckery

eternal osprey
#

in djs v13, don't we have a property to check whether a user can get banned, muted and kicked?

#

it was member.kickable, member.bannable, and....? I forgot the one for timeouts/mutes.

wheat mesa
#

Look at the docs perhaps

eternal osprey
#

honestly i have tried to find it but couldn't

wheat mesa
#

I believe there’s some sort of function that does that but I could be wrong

#

I know it was a thing in detritus but not 100% sure about djs

eternal osprey
wheat mesa
#

Mutability in this message is not what you think it is

quartz kindle
#

mutability here refers to the data being mutable, like you being able to edit message.content and then send(message)

hushed robin
quartz kindle
#

timeout should be included in moderatable

#

same thing for voice mutes

neon leaf
#

does anyone have an Idea how to design this? id like to make everything a modal

rustic nova
#

use bootstrap modals

neon leaf
#

I already have modal components, idk how to arrange the page

#

i cant make stuff look good

#

I got this concept but its horrible

wheat mesa
# eternal osprey

Also keep in mind that you want to be looking at the properties/methods for the type that you want, not the search feature

eternal osprey
#

Yeah i got it working

eternal osprey
#

yeah i am pretty stupid with these docs

#

Is there any way to work around this

#

Why the fuck is there a max on it.. doesn't make sense??

lyric mountain
#

it's a pretty big amount tho

eternal osprey
#

5 isn't much right..

deft wolf
#

Depends on what your bot does

rustic nova
#

or whats that

eternal osprey
#

application commands

wheat mesa
#

I don’t think that’s what that number means

rustic nova
#

how tf is it only on 5

wheat mesa
#

Cus max command amount is much higher than that

rustic nova
#

yeah doubt thats slash commands

eternal osprey
#

tf is my console saying then

rustic nova
#

how many slash commands do you have

deft wolf
#

These are context menus, I believe

lyric mountain
#

^

eternal osprey
#
    data: new ContextMenuCommandBuilder()
    .setName('ban')
    .setType(ApplicationCommandType.User),```this is the type
#

i got: 6 in total

lyric mountain
#

yep, context menu

eternal osprey
#

Strange that the max is capped at so low

#

I will just remove one app i guess..

lyric mountain
#

why are u even making a ban context menu command?

eternal osprey
#

it;s fun

#

clickin on a person and banning them trhough there

#

convenient

lyric mountain
#

there's already a ban button

eternal osprey
#

owh damn

#

i didn't know

lyric mountain
#

...

deft wolf
#

True

#

Also, if I'm not mistaken, it would be impossible to add any arguments to such a command without using buttons or waiting for a message from the user so slash command seems like a better choice for this kind of command

lyric mountain
#

u can get the author of the message u clicked

#

and I think it also appears if u right click on an user

deft wolf
#

Yes, but I mean some kind of temporary bans or reasons/cases

hushed robin
#

well

#

you could use a modal i think

lyric mountain
#

which is already what ban button does anyway

quartz kindle
#

anyone here knows erlang? how the heck do lists work lol

#

does the list tail count in the list length?

solemn latch
#

tim asking a question? what is this?

lament rock
#

erlang is just way too confusing tbh

quartz kindle
#

indeed

#

tbh im just asking for the etf encoder, i have the gist of it but some things are unclear

#

lists can be either proper or unproper, they can include a tail, or not include a tail, the tail is normally an empty list [] but can be any value as well

lament rock
#

a list with a list?

quartz kindle
#

so when encoding it, idk if i should add a tail at the end or not, and if the added tail should count towards the list length or not lmao

lament rock
#

ordered myself an SBC so that I can host my own stuff. Has a pcie slot, so I might abuse my 1050ti collecting dust

eternal osprey
#

when providing choices for a user

#

instead of getting the actual value can we also try to get the name?

deft wolf
#

There should be such an option

eternal osprey
#

i have read the docs

#

i don't think that you can actually get the name

earnest phoenix
quartz kindle
#

the choices api is a piece of shit

#

not only do they not provide it, but they type it for the user

#

which is misleading

#

when the user choses it, it autocompletes the query with the name, but what is actually sent is the value

#

if the user presses backspace, the name gets edited, which causes the value to be lost

#

if the user re-types the character they just backspaced, the value will not come back, making the query invalid

lament rock
#

having only 25 options is also dumb

#

I have to make multiple commands for radio stations

quartz kindle
#

or use autocomplete

#

which has the same issues

lament rock
#

im good

#

autocomplete with amqp would be a challenge

eternal osprey
#

Right now i have 14 choices... and it's telling me it's exceeded it's size

earnest phoenix
#

The max is 25 choices

oblique sky
#

What is the length of their names or values?

lament rock
#

100

#

Limits are per choice

rustic nova
#

BLÅHAJ

lament rock
#

blåhaj

spark flint
#

BLAHAJ

lament rock
spark flint
earnest phoenix
#

how do you make something happen after a specific amount of time happens with a bot

#

for example with giveawaybot someone specifies an amount of time and after that time they announce the winner

#

how do you do the timer thing

wheat mesa
#

setTimeout and/or a database

solemn latch
#

giveaway bot would use a database.

timeouts wouldnt persist between bot restarts, which is a major issue

earnest phoenix
#

i created a poll bot

#

4 customization options

lyric mountain
#

U definitely need a database

earnest phoenix
#

i hope the 4 customization options + the about command meets the requirements

lyric mountain
#

Requirements for what?

earnest phoenix
lyric mountain
#

Ah

#

Well, I think it's enough, but add a few more just in case

earnest phoenix
#

I keep getting "invalid string format" here: option.setName('iconurl')

lyric mountain
#

Show full code

#

And the error ur getting

midnight owl
#

Yo

hushed robin
#

what's the best way to run something every 5th minute?

frosty gale
hushed robin
hushed robin
sharp geyser
#

google cron job for whatever language you use

hushed robin
#

well

sharp geyser
#

you could also use setInterval which will run every x amount of time you set

#

but it depends on your use case

hushed robin
#

I've tried two but

sharp geyser
#

You use js right?

hushed robin
#

yes

sharp geyser
#

then ye setInterval could also work

hushed robin
#

could

sharp geyser
#

cron jobs are just a way of doing the scheduling on a separate process (might be other benefits but I hardly used them to know)

#

One other thing about cron jobs, they allow you to use the full spectrum of time, e.g hours, minutes, seconds, days, months, years

hushed robin
#

well i tried node cron and node schedule but they both break for some reason

sharp geyser
#

You are likely using it wrong

hushed robin
#

how

sharp geyser
#

Idk

#

What are you doing

#

I am not a mind reader

hushed robin
#

with node cron after a day or two it starts offsetting

#

and with node schedule after a day or two it started running the job twice (and possibly offsetting i forget)

#

it works fine at first though

sharp geyser
#

Interesting

#

I dont see why that would be happening

#

Maybe something around it could be affecting it

#

If you run the cron job more than once it will end up happening more than once as well

hushed robin
#

it's not that

#

it only schedules when my client is ready

#

will try setInterval but i'd prefer for it to happen at every 5th minute

sharp geyser
hushed robin
sharp geyser
#

Its not guaranteed that ready will fie only once.

#

Unless you have code interfering with the cron job itself, I dont see how it is running twice, that or your updateTrackers() is doing it

#

As for the offset I am not really sure why that would happen, In my time of using cron jobs never had it happen without me specifying it to

misty chasm
#

hi

eternal osprey
#

Hey could anyone tell me the benefits of using a dlatch over a sr latch? Because in my understanding they work exactly the same, just the d latch got the data inputs and enabling separated while the sr latch requires direct changes of s and r to either perform the set, reset or hold actions.

#

I know the d latch can set the e to false or true to either hold or perform an action and that the output is then dependent on the d input, but why is it better instead of an sr latch? Could it be because the data and enabling functions are separated? Accessibility?

#

Omg wait hold on i might be cookin here

#

Would it be correct that a d-latch cannot get into the forbidden state? So s= 1, r = 1 (race conditions occurs)

#

so thats why a d latch should be used over a normal sr latch??!

rustic nova
#

tbf

#

I'm glad I'm not going to go through the topics in my apprenticeship what you're doing right now

#

I'd die inside ngl

eternal osprey
#

i am for sure dying ngl

#

but yeah, i knew computer science at the university would be rather logic than coding so gotta see it through now KEKW

cobalt dew
rustic nova
#

?

quartz kindle
earnest phoenix
carmine magnet
#

hello, does anyone know how to setup these buttons at the botton of the window view with electron?

rustic nova
#

I think these are called Thumbar Buttons?

#

Thumbnail Toolbars

carmine magnet
#

my hero

#

thank you Yui chan

rustic nova
#

unsure if thats correct tho lmao

#

yw lmao

eternal osprey
#

Do logical gates have a standard delay?

#

and if so, what's their delay?

rustic nova
#

they dont iirc

eternal osprey
#

how the fuck should i calculate the delay based on a path

#

literally got nothing but the path (from input a to a nor gate(

lyric mountain
#

resistance perhaps

eternal osprey
#

i just got a logical circuit and he said calculate the progpagtion time

lyric mountain
#

yes, but gates still have some kind of resistance

#

even if negligible

#

that said, I still have no idea how ur even supposed to calculate propag time

#

a thing I remember tho, is that current has a certain speed

eternal osprey
#

for example this

#

they told us we needed to give the propagation delay

#

so i thought for example the delay from a to sum is:

#

| A --- norgate --- norgate --sum |

#

would that be any correct?

rustic nova
#

Istg too brain stuff for me

lyric mountain
#

Not an electrician too, didn't u learn how to calculate that in ur course?

#

Teachers don't usually throw questions that were never taught before

eternal osprey
#

only thing we got about delays

#

see what the teacher wrote that |-gate-gate-gate|

#

that's the delay i think

#

what doyou think?

lyric mountain
#

idk

eternal osprey
earnest phoenix
#

Can someone help?

spark flint
#

Not really

#

You need to provide some context / code

sudden geyser
earnest phoenix
hushed robin
lyric mountain
#

Drag there or click it

safe summit
#
const Discord = require('discord.js');

const Schema = require("../../database/models/economy");

module.exports = async (client, interaction, args) => {
    const type = interaction.options.getString("type");

    if (type == "money") {
        const rawLeaderboard = await Schema.find({ Guild: interaction.guild.id }).sort(([['Money', 'descending']]));

        if (!rawLeaderboard) return client.errNormal({ 
            error: "No data found!",
            type: 'editreply'
        }, interaction);

        const lb = rawLeaderboard.map(e => `**${rawLeaderboard.findIndex(i => i.Guild === interaction.guild.id && i.User === e.User) + 1}** | <@!${e.User}> - ${client.emotes.economy.coins} \`$${e.Money}\``);

        await client.createLeaderboard(`🪙・Money - ${interaction.guild.name}`, lb, interaction);
    }
    else if (type == "bank") {
        const rawLeaderboard = await Schema.find({ Guild: interaction.guild.id }).sort(([['Bank', 'descending']]));

        if (!rawLeaderboard) return client.errNormal({ 
            error: "No data found!",
            type: 'editreply'
        }, interaction);

        const lb = rawLeaderboard.map(e => `**${rawLeaderboard.findIndex(i => i.Guild === interaction.guild.id && i.User === e.User) + 1}** | <@!${e.User}> - ${client.emotes.economy.bank} \`$${e.Bank}\``);

        await client.createLeaderboard(`🏦・Bank - ${interaction.guild.name}`, lb, interaction);
    }
}

#

@lyric mountain

lyric mountain
#

I don't see u replying anywhere

safe summit
#

its up

lyric mountain
#

Up what?

safe summit
#
const Discord = require('discord.js');

const Schema = require("../../database/models/economy");

module.exports = async (client, interaction, args) => {
    const type = interaction.options.getString("type");

    if (type == "money") {
        const rawLeaderboard = await Schema.find({ Guild: interaction.guild.id }).sort(([['Money', 'descending']]));

        if (!rawLeaderboard) return client.errNormal({ 
            error: "No data found!",
            type: 'editreply'
        }, interaction);

        const lb = rawLeaderboard.map(e => `**${rawLeaderboard.findIndex(i => i.Guild === interaction.guild.id && i.User === e.User) + 1}** | <@!${e.User}> - ${client.emotes.economy.coins} \`$${e.Money}\``);

        await client.createLeaderboard(`🪙・Money - ${interaction.guild.name}`, lb, interaction);
    }
    else if (type == "bank") {
        const rawLeaderboard = await Schema.find({ Guild: interaction.guild.id }).sort(([['Bank', 'descending']]));

        if (!rawLeaderboard) return client.errNormal({ 
            error: "No data found!",
            type: 'editreply'
        }, interaction);

        const lb = rawLeaderboard.map(e => `**${rawLeaderboard.findIndex(i => i.Guild === interaction.guild.id && i.User === e.User) + 1}** | <@!${e.User}> - ${client.emotes.economy.bank} \`$${e.Bank}\``);

        await client.createLeaderboard(`🏦・Bank - ${interaction.guild.name}`, lb, interaction);
    }
}
#

here i sent again

lyric mountain
#

I mean replying to discord

#

Not replying to me

safe summit
#

;-;

#

wha

lyric mountain
#

interaction.reply or smth

#

Is that code yours?

safe summit
lyric mountain
#

...buddy

#

I already saw both of your messages

safe summit
#

ok

lyric mountain
#

I'm referring to the code itself

safe summit
#

oh

lyric mountain
#

Were those code written by you?

safe summit
#

yea by me and my friend

lyric mountain
#

Ok, by your friend then

safe summit
#

if you want i can re write whole

lyric mountain
#

Where are you sending a reply?

#

Like, replying to the user

safe summit
#

wait

#

on that interaction.channel

lyric mountain
#

...I don't think u understand what I mean

safe summit
#

yea i just woke up

#

seeing discord

#

with million of pings

#

my head not working

lyric mountain
#

But well, supposing those client.errNormal are your error replies, you have a lot of processing before sending something back to discord

lyric mountain
#

You must defer if you're gonna be doing ANY processing at all

safe summit
#

ok

#

now my brain is working hard with my last 2 brain cells

civic scroll
#

where's the handler

#

at line 116

#

oh

jaunty basalt
#

is it necessary to use require('dotenv').config(); in every file we use process.env
?

lament rock
sudden geyser
#

You only need the config when you want your env vars to be loaded

#

So if you load it in your e.g. index.js first, you won't need it elsewhere

grizzled orbit
#

totally noob on html here, how do i make images get aligned with text on a heading for the bot description? BigThonk

<h2 style="vertical-align:middle; display:inline;">
<img style="vertical-align:middle;" src="link here">
title here
<img style="vertical-align:middle;" src="link here">
</h2>

on my personal testing it works, but on top.gg the images are in a second line no matter what i try, is it something of the page or like that?

rustic nova
#

then the display used by top.gg's description doesnt support whatever vertical-align is used on

boreal iron
#

vertical align is only supported in boxed layouts or table cells anyways

#

also don't use the image element inside your header, as it being the child element won't do what u wanna do anyways

boreal iron
tender gale
#

Hey, uhm, is there anyone of you who added a bot created in Discord Bot Studio?
I'm just trying to add bot stats (I mean the code from the documentation) to bot.js but it seems I can't find a solution and I hope someone of you managed to do it so that I can ask for help in solving this situation... I installed autoposter and even sdk, then I tried to replace client (because it is not defined in DBS) with DBS.Bot but nothing has changed on the website and there is no information in the console whether the statistics were sent or not pleading

deft wolf
#

If there is no error in the console then most likely the code didn't even start working

tender gale
#

oh please... im so dumb -.- uhm, so now i added the same code (which i added to bot.js) to Code Block and now it worked FacePalm I'm sorry for wasting your time reading this Prayge
Have a nice day ❤️

earnest phoenix
#

I forgot what the hell prsence intent can do on bots can someone help me-

lyric mountain
#

it allows you to track status changes and retrieve whether an user is online or not

rustic nova
#

please

#

I beg to god

#

dont use chatgpt for actual dev help

viral badge
#

my first time using chatgpt ever 😎

deft wolf
#

I don't know how that's supposed to help you with your problem, but if it does, that's cool

viral badge
#

yeah it didn't really help

#

i just sent a suggestion/question to my router manufacturer instead 💀

eternal osprey
#

i have 2 dates written like: 2/20/2023

#

how do i calculate the passed days/years/months between the two dates?

rustic nova
#

days: calculate the sum of days on each month, then sum together
months: divide by 30 (unless you want to be really precise, still suggest letting a library handle it)
years: divide by 365

viral badge
#

you can always use js and run new Date('2/20/2023') if you are lazy 😎

rustic nova
#

its not the lazyness tbf

#

and I dont want to get started on different calendars

viral badge
#

💀

rustic nova
#

where the first day of week is sunday

rustic nova
#

and where there's not the 28 days on february

eternal osprey
#

lmao

rustic nova
#

it would

eternal osprey
#

and i would then do date1 - date 2?

#

to get the difference timestamp in ms?

viral badge
#

.getTime()

rustic nova
#

other way around

#

but essentially yes

#

you wanna subtract from the larger number

#

aka the one more into the future

blissful coral
#

Does anyone know the package that moderation bots use to change 30d to the date 30d later or 30s to 30 seconds later?

wheat mesa
#

wdym?

#

Like <t:1676919294:R>?

#

That sort of thing?

blissful coral
#

like if someone does *ban 30d <reason>

#

And 30d later it will unban

#

I am saying how do they convert 30d to a date object to find the date to unban them by

#

I coulda swore I saw a npm package for it so I don't have to do it manually

wheat mesa
#

I'm sure something like moment could do that

blissful coral
#

It was moment, thank you

#

I forgot the name LMAO

wheat mesa
#

But honestly it probably wouldn't be too hard to write that sort of thing yourself if you really wanted

blissful coral
#

yeah I figured but it would be easier cuz im lazy

blissful coral
#

@wheat mesa any idea the correct method for that

wheat mesa
#

Haven’t used moment in a moment so can’t say

deft wolf
#

I'm sure you'll find something on the internet

sharp geyser
#

who uses moment anymore

#

its all about dayjs

spark flint
#

its all about Date

sharp geyser
#

What you know about dates bun

spark flint
#

nothing

#

i am a single pringle

earnest phoenix
#

Since Moment itself is no longer maintained, that's what they recommend

sudden geyser
#

when will the js gods release temporal

earnest phoenix
#

Once that's done there will be no need for additional date & time libraries

sharp geyser
#

dayjs is better than luxon

tired panther
#

@earnest phoenix Can I dm you, have a super complicated project idea and what to know if you have any suggestions for the tools being used in the project...

dusky idol
#

Can someone tell me how do I get my bot verified (for discord)? It’s in 75 servers now, I’m at the developer portal & can’t really locate the verification button

I assume that it’s due to the fact that my bot isn’t in 75 servers if I exclude servers owned by me. Guess we’ve to wait for it to join 2-3 more servers.

deft wolf
#

You should get an email

#

Also an official message from Discord

dusky idol
hushed robin
#

your able to when its in 76 guilds

dusky idol
#

Let’s hope that I wake up into that message xD

hushed robin
#

so if its in 75 you need one more

deft wolf
#

Prepare a photo of your ID card or driving license and download some recording software

silver jackal
#

Hi

silver jackal
#

Will they do something if bot steals users data or what?

deft wolf
#

Am I from Discord?

hushed robin
#

so you can be held accountable if your bot does something illegal

wheat mesa
#

They need it so you don't abuse data. It's accountability

#

And to also verify that you're not someone that has previously abused data before

earnest phoenix
#

They need a legible document that can truly identify you, such as an ID, driver's license, passport, etc etc so they can verify it's truly you, and that you can be held accountable if you do something bad

silver jackal
#

hell no im deleting my bot

hushed robin
#

☠️

#

wwhy

deft wolf
#

Good luck

earnest phoenix
#

And besides, Discord doesn't see any of these documents, Stripe does

hushed robin
#

yeah ^

wheat mesa
#

should only be scared if your bot does something fucked up

#

just sayin

hushed robin
#

discord will likely only get access to them if your bot does something fucked up which requires legal action

wheat mesa
#

I suppose that's your choice to make

silver jackal
deft wolf
#

Anything against their rules

silver jackal
#

hell no this is too much for me

deft wolf
#

Seriously though, I haven't heard of anyone going to jail for discord bots

#

Okay, I wanted to look for something on this topic, but I didn't expect it

dusky idol
deft wolf
hushed robin
sudden geyser
hushed robin
#

what is bro doing

dusky idol
deft wolf
#

ID card, driving license or passport

dusky idol
hushed robin
maiden tiger
#

what is your bot name?

dusky idol
maiden tiger
dusky idol
#

I might can but again I don’t have one

rustic nova
#

You fan

#

Can

#

At least here in Germany

lament rock
#

passports cost money

#

which nobody has

quartz kindle
#

@lament rocksuggest a name for my etf lib

#

not so happy with tinyetf

#

what about wetf? can stand for "what external term format?" or "what even the fuck?"

lament rock
#

was literally about to pull a wtf joke

quartz kindle
#

lmao

#

or wtetf for "what the etf"

#

but looks weird

lament rock
#

hm

quartz kindle
#

how about

#

wetf - pronounced "wet F"

lament rock
quartz kindle
#

took me all day to figure out how UMD works today lmao

lament rock
#

whats that

quartz kindle
#

universal module definition

#

makes stuff compatible with other platforms, like browser

lament rock
#

thonking about names

#

I got nothing

#

Was thinking about ET being extra terrestrial

quartz kindle
#

discords's erpack lib doesnt even work when decoding bigint wtf

quartz kindle
#

extra terrestrial format

lament rock
#

could work imo

#

erlang is basically gibberish to me

quartz kindle
#

im testing and benchmarking like 5 different libs

#

and they all have weird quirks and issues

#

lmao

#

one of them encodes doubles in big endian format for some reason, while the elang docs specifically state it should use little endian

#

the format itself is a mess indeed

#

omg jesus christ

#

i tested encoding a uint8array using discords erlpack

#

and it encodes Uint8Array([1,2,3,4,5]) into an object like this { 1:1, 2:2, 3:3, 4:4, 5:5 }

#

instead of using the native etf binary data type

lament rock
#

gross

quartz kindle
#

also, out of them all, discord/erlpack is the second slowest one

#

jesus christ, talk about unoptimized

lament rock
#

jesus

solemn latch
#

More efficient then what I write!

quartz kindle
#

x doubt

#

:^)

solemn latch
#

Oh man you should see this code I have for a single api endpoint.

Like 150 lines is just database stuff.

#

Prisma was a mistake

quartz kindle
#

not that bad

quartz kindle
#

:^)

solemn latch
#

Yeah

quartz kindle
#

and he managed to make it almost 5 times slower than other libs

solemn latch
#

It's literally caused the project to be delayed for months.
And I'm too stubborn to just rewrite it.

#

And I'm too frustrated to finish kek

quartz kindle
#

the reason is that he creates new buffers everywhere

#

he basically does stuff like this in his code ```js
const input = [1, 2, "34242", 234.2352];

// his code (sort of)
buffers = []
for(const item of input) {
const buffer = bufferAlloc(encode(item))
buffers.push(buffer)
}
buffers.unshift(bufferAlloc("header"))
return Buffer.concat(buffers)

#

creating tons of small buffers in js is a really bad idea

lament rock
wheat mesa
#

The last bot I made sent these whenever it encountered an HTTP error lol

#

Loved it

radiant kraken
low orbit
#

Using discord.jsv14 when i attempt to login using my extended client i get an error "InvalidArgumentError: invalid User-Agent header", however when i use discord.js's client constructor to login i dont. this only occurs on v14 and works perfectly on different versions, anyone know why? (The error comes from undici which is used by djsv14)

I’ve not found anything regarding this issue (e.g fixes or people who’s had it before) on either the internet or discord.js server

lament rock
# low orbit

either you might want to see if you're overriding something of the super classes up the chain that would interfere with options or if you're setting your own User-Agent somehow since Discord expects a very specific format for the header

low orbit
dusky idol
#

Hey there, can someone assist me a little real quick? So, there's a webhook of a website called discadia. Whenever someone votes for my server at their website, their webhook sends a message in one of my text channels which is basically an embed with a mention inside it.
Well, you can ignore the context I provided above & simply help me with getting the id of the mentioned member inside the embed.
https://prnt.sc/MY_K1_xC8O1t

Lightshot

Captured with Lightshot

#

In this case, I want to define an on_message function which reads the description of the embed & takes the ID of mention'd user. (Zeksy in this case) How do I achieve it

solemn latch
#

You'll need the message content intent.

#

But if you place it in its own channel no one else can send messages and just check if the message is in that channel. Then you can pull the user ID from the description

dusky idol
#
embed = message.embeds[0]
description = embed.description
#

I assume this would get the content inside the description

deft wolf
#

Do you use python?

solemn latch
#

Id use regex personally

#

To get the id from the string

deft wolf
#

You can also use substring

dusky idol
#

I'm not so sure about extracting the member's id out of embed's description

#

but let me try printing the description, gimme a second

rustic nova
#

Yeah you'll need to regex the member id out, some libraries would have the luxury of providing you the mentioned users if it is just message content

earnest phoenix
#

Yo

#

is it possible

#

for checking when a role got given to a user
and handle it

#

with node js

#

with discord.js?

#

and handle it

#

yeah

#

i have an idea

deft wolf
#

There's probably a guildMemberUpdate event or something

earnest phoenix
#

there's this guildmemberupdate event

#

Yes

#

Yes

#

Yes

earnest phoenix
earnest phoenix
#

it returns old user

#

and new user

#

i mean member

#

thanks man

#

lemme test

deft wolf
#

There you can compare old and new roles, thanks to which you can check which roles have been assigned to the member

earnest phoenix
#

so basically what i wanna do

#

is mark a specific role

#

so administrators with this role cannot assign roles with admin to other users

#

lemme test

#

Yo

#

is there a way to read user bios with discord js?

hushed robin
#

no youd need to use oauth

earnest phoenix
#

im sure

#

other bots like bleed n shit have that and u dont have connect anything

rustic nova
#

Theres not

deft wolf
#

You can read their custom status, what game they're playing and they're online/offline status, but their bio cannot

rustic nova
#

The only profile related data is activity, status, avatar and name

earnest phoenix
#

worked

rustic nova
#

Daily tos encouraging chat

hushed robin
#

woah

#

i do not encourage breaking discord tos

#

just saying

earnest phoenix
#

me neither

#

i was joking by the way

deft wolf
#

XD

hushed robin
#

i meant they're probably using a selfbot, not to use one yourself 🙏

earnest phoenix
#

ofc ofc

latent rapids
hushed robin
#
const regex = new RegExp(...)

if (Boolean(data.body.match(regex) === true) {
  ...
}
wheat mesa
#

Tf is this 😭

sharp geyser
#

Yes

hushed robin
sharp geyser
#

Supply the most useless thing ever

solemn latch
sharp geyser
#

you have a question about regex so supply the regex

hushed robin
#

oh

wheat mesa
#

Just wanna say that your code snippet here tells us literally nothing

hushed robin
latent rapids
#

I don't know how to make my own webhooks so.

sharp geyser
#

Also why are you using Boolean()

#

just use .test on the regex

wheat mesa
#

And === true

sharp geyser
#

it supplys a bool

hushed robin
wheat mesa
latent rapids
hushed robin
wheat mesa
#

I assume you want to match globally

hushed robin
wheat mesa
#

Not just the beginning of the string

hushed robin
#

thats the entire thing

wheat mesa
#

Well that that’s probably the problem

hushed robin
#

oh

wheat mesa
#

Use /g at the end

radiant kraken
wheat mesa
#

Global match

wheat mesa
hushed robin
#

ok

#

ty

#

lemme try it

wheat mesa
#

. is a reserved character in regex

radiant kraken
#

also you forgot a )

#

also imagine using Boolean()

#

when truthiness exists

hushed robin
#

yes

sharp geyser
#

go easy on them null

hushed robin
#

im going to change it

radiant kraken
hushed robin
radiant kraken
#

:)

wheat mesa
#

Me when you could just use string.contains instead of jumping straight to regex

sharp geyser
#

Isn't regex slower as well?

radiant kraken
#

yes

wheat mesa
#

Regex is slow as hell

radiant kraken
#

my package got extremely fast after switching from regex to rust binary search

wheat mesa
#

Caching it is a little faster (I believe v8 does that for you behind the scenes) but it’s still pretty slow

radiant kraken
#

using regex for that is pretty overkill tbh

sharp geyser
#

I haven't programmed anything in months

#

I feel rusty

radiant kraken
#

good

#

become a rustacean

wheat mesa
sharp geyser
#

no

radiant kraken
#

wtf

wheat mesa
#

Yes

sharp geyser
#

regex is O(infinity)?

wheat mesa
#

Fundamental algorithm to know

radiant kraken
#

no

wheat mesa
radiant kraken
#

O(n!)

sharp geyser