#development

1 messages ยท Page 2011 of 1

ancient nova
#

no

#
            let getResponseFromAPI;
            await fetch(`https://transparent-speckle-door.glitch.me/checkPassword?username=${Username}`)
                .then(res => res.json())
                .then(out => getResponseFromAPI = out);
``` this better lol
cinder patio
#

yes, but no

#
const getResponseFromAPI = await fetch(`https://transparent-speckle-door.glitch.me/checkPassword?username=${Username}`)
                .then(res => res.json())
civic scroll
#

NO

ancient nova
civic scroll
#

remove then 2nd .then

cinder patio
ancient nova
#

THE 2ND THEN IS WHAT MADE IT WORK

quartz kindle
neat ingot
#

I just got totally lost watching a clip of a random tear animation I made a while back ๐Ÿ˜„

civic scroll
ancient nova
ancient nova
civic scroll
#

i forgor

cinder patio
quartz kindle
civic scroll
#

but await awaits everythinf right

cinder patio
#

yes

neat ingot
quartz kindle
#

lmao

ancient nova
#

lol

#

okay I finally made it actually work

#

with customized error messages

civic scroll
#

@cinder patio imagine opening in webstorm and it starts throwing code quality warnings

lyric mountain
#

that's the good thing about jetbrains

civic scroll
#

let's also mention SonarLint

lyric mountain
#

it doesn't try to make your code look good, it doesn't try to make you feel less bad from writing shitty code

#

it'll tell you plain and simple that your code sucks and you need to fix it

lyric mountain
ancient nova
#

okay Imma dip

#

thanks to everyone who didn't immediately blocked me and went on with their lives

civic scroll
#

take a rest

#

istg

ancient nova
#

๐Ÿคฃ

#

bye

ancient nova
neat ingot
boreal iron
#

don't worry Tim doesn't block anyone who could possibly distract him from moving on developing his API

sudden geyser
cinder patio
civic scroll
#

"very nice"

lament rock
#

๐Ÿ‘

#

git merge

lyric mountain
lament rock
#

Time to add that to a Discord library. Discord sends you a list of voice regions on READY, so you can triangulate the user's approximate location and guess from there

wheat mesa
#

Time to install a node-ipc on a bunch of Russian VPSs mmLol

primal aspen
#

So why is "anonymous" voting done via reactions in a public channel instead of dm'd polls that are entirely anonymous?

sudden geyser
#

Who/what are you referring to specifically?

cinder patio
#

I think you have the wrong server

#

I have to write an algo which compares the differences between two files, if any lines have been added / removed and lines which are edited... but that sounds hard

ancient nova
#
let _amount = 5;
Amount = _amount;
var interval = setInterval(() => {
 Amount -= 1;
 if (Amount === 0) {
  clearInterval(interval );                                        
 }
}, 250);
```can anyone tell me why this loop never stops?
cinder patio
#

you have 3 different variables which are called amount lol

boreal iron
#

I see 3 different vars named amount

cinder patio
#

pick one

ancient nova
#

now there's 2

#

_amount is actually a variable that is picked by the CLI

#

I just put it there for reference

cinder patio
#

you need only one

#

ah

#

it should work...

#

also follow naming conventions pls

boreal iron
#

well you updated (amount === 0) to (Amount === 0) now which is correct

ancient nova
#

well I do have it correct in my actual script, I just wrote this quickly for reference as to ask why it never stops

#

could it be that the actual

 if (Amount === 0) {
  clearInterval(interval );                                        
 }
``` is inside request function?
cinder patio
#

It does stop

#

your code is correct

boreal iron
#

after he changed his typo

ancient nova
#

yeah but I don't have this typo in my actual code and it never stooooooooooooooops

boreal iron
#

well check amount then after reducing it by 1

#

aka. log it and see

cinder patio
#

yeah add a console log to see if it really stops

boreal iron
#

ah lol I see

#

like in his example above

ancient nova
cinder patio
#

ok

#

you're delusional babe

#

If that's the 100% exact code then it should stop

#

give us more to work with

ancient nova
cinder patio
#

yes

ancient nova
#
let amount = 5;
var checkWebsiteAliveInterval = setInterval(() => {
    amount -= 1; 
    req("https://google.com/", (error) => {
        if (!error) console.log(`WEBISTE IS ALIVE!`);
        if (error) console.log(`WEBSITE IS DEAD!`);
        
        if (amount === 0) console.log(`PINGING STOPPED`);

        if (amount === 0 && !error || error) {
            clearInterval(checkWebsiteAliveInterval);
            return recursiveAsyncReadLine();
        }
    });
}, 250);
``` this is basically what it is
#

I just removed _amount since it's not needed

cinder patio
#

Well color me surprised

#

!error || error this is always going to be true

ancient nova
#

I meant to say if amount is 0 and there isn't an error then true or if theres an error return true immidietly

ancient nova
cinder patio
#

You need to use await here. the code inside the req callabck doesn't get executed right away

ancient nova
#

where exactly?

cinder patio
#

so you're sending way more than 6 requests in reaility

ancient nova
#

how? is that why it never stops?

cinder patio
#

That's why it appears to you that it never stops

ancient nova
#

๐Ÿ˜ฎ

#

magic

#

how do I fix it though?

quartz kindle
#

once it goes beyond 0 you're fucked

ancient nova
#

(depending on where you execute the code, actually)

cinder patio
#
let amount = 5;
const checkWebsiteAliveInterval = setInterval(async () => {
    amount -= 1; 
    const resultOrErr = await req("https://google.com/").catch(() => undefined);
    if (!resultOrErr) console.log("Website is dead...");
    //...
    if (amount === 0) {
        clearInterval(...);
    }
}, 250);
ancient nova
#

.. and an await

cinder patio
#

... exactly.

ancient nova
#

that will fix it, really?

cinder patio
#

and the code is cleaner in general

quartz kindle
#

that can still break

cinder patio
#

how

ancient nova
quartz kindle
#

if the response takes more than 250ms to return, another interval iteration will run regardless, and set amount to -1

cinder patio
#

yeeeah

ancient nova
#

OMG

cinder patio
#

you need to amount -= 1 after the await

ancient nova
#

I had that issue

quartz kindle
#

how about not using an interval in the first place?

ancient nova
#

that's why I limited it to 250ms

quartz kindle
#

thats like so wrong for this type of thing

ancient nova
cinder patio
#

you can just do a for loop

ancient nova
quartz kindle
#

use a recursive function or a for loop

lyric mountain
#

also var

cinder patio
#

ugly

#

Also < 1

#

better

ancient nova
ancient nova
#

I don't want it to take place instantly

#

although asynchronous delay could do the trick

quartz kindle
#

you can add delays to a loop

cinder patio
#

you can create a sleep function which uses a setTImeout

ancient nova
#

ya that's what I meant by an asynchronous delay

lyric mountain
quartz kindle
#

another thing you can do, which actually makes sense for this, is add a time limit for the request, and if it doesnt return within the limit, assume offline

ancient nova
lyric mountain
#

I said respected IDE

#

not fancy text editor

ancient nova
#

and it's one of the most popular, if not the MOST popular idea actually

lyric mountain
#

there really is -1 reasons to use var instead of let

ancient nova
lyric mountain
ancient nova
#

then which editor is better than vsc

lyric mountain
#

for js? webstorm

cinder patio
#

vscode is ideal for js

ancient nova
#

never heard of that

cinder patio
#

shut

lyric mountain
#

he edited "ide" for "editor"

ancient nova
#

also @cinder patio so then I should use a for loop idead?

quartz kindle
#

idead

ancient nova
#

idead lol, me too

cinder patio
#

yeah

ancient nova
#

okay it looks actually kinda nice

lyric mountain
#

vscode is the best if you exclude IDEs

ancient nova
#

although it's primarily web based

cinder patio
#

bloat compard to vsc tbh

lyric mountain
cinder patio
#

VSCode is pretty much an IDE for javascript these days

ancient nova
lyric mountain
#

by what looks?

#

the name?

ancient nova
ancient nova
lyric mountain
#

what loops?

cinder patio
#

Yeah and I use it for Rust and C++. VSCode is pretty great.

lyric mountain
ancient nova
lyric mountain
#

kekw

#

but really, you shouldn't judge an IDE's purpose by the example images

cinder patio
#

Visual Studio is terrible for JS

#

disgusting

lyric mountain
#

js is mostly used for web, so they use web examples

ancient nova
lyric mountain
ancient nova
#

vsc is the good one

lyric mountain
#

this is the important part

ancient nova
cinder patio
#

For JS I am going to argue that it IS an IDE

ancient nova
#

you can make it into an ide with enough extensions

cinder patio
#

for JS only (and TS)

lyric mountain
#

well, you can consider a dog a mollusk as much as you want, doesn't change what it is

#

but back to the topic, change those vars

#

and use less risky boundary check

cinder patio
#

If it has all the core features an IDE has, then it's an IDE.

#

ยฏ_(ใƒ„)_/ยฏ

neat ingot
#

i kinda feel that way about vs code too

#

with a few extensions its basically a full ide

#

i write/build/run my c# code in vs code using dotnet

ancient nova
#

should I put the i === 0 check inside the for loop or inside the req function?

cinder patio
#

It has built in debugging and autocomplete for JS and TS. For other langs you have to install plugins

#

/ extensions

lyric mountain
#

well, it's useless to argue any further so I'll cut the discussion here

lyric mountain
cinder patio
#

you think I'm wrong?

neat ingot
ancient nova
lyric mountain
neat ingot
#

vs code is treating the boundary lines very much so imo

cinder patio
#

but how is it wrong though

lyric mountain
cinder patio
#

in your opinion

#

you can absolutely change my opinion

lyric mountain
#

as I said, I can't change your opinion, all this discussion will bring is a mod telling us to cut the topic

ancient nova
#

guys chill

cinder patio
#

I'm waiting

lyric mountain
#

for me (and microsoft), vscode is a code editor, you can put as many plugins as you want but that won't change what it is

neat ingot
lyric mountain
#

vscode is more feature-rich than lesser editors like sublime or np++, but less than an actual IDE

#

take eclipse (shitty one) for example

neat ingot
#

vs code can do the things defined there

lyric mountain
#

code editor != text editor

ancient nova
# neat ingot

you can build and test software in vsc with a bunch of extesions

#

which are free btw

cinder patio
#

What does an IDE have that VSCode doesn't, for JS at least?

#

built-in VSCode ^

ancient nova
#

yeah and for some languages those features are builtin

neat ingot
cinder patio
#

That is such a weird sentence. It's saying the same thin??

ancient nova
#

TypeError: req(...).catch is not a function

neat ingot
#

again imo, vs code treads the line between editor and ide very much

ancient nova
#

sorry for intruding on your guys' discussion but

#

I got an error

cinder patio
#

The definitions are so blurry that I'd say it can be considered both

neat ingot
#

kind of yea lol

lyric mountain
#

opinion

neat ingot
lyric mountain
neat ingot
#

at the end of the day, if you can write and run and debug your code, use what makes you happy on the inside ๐Ÿ˜›

ancient nova
sudden geyser
#

okay crazy idea but

lyric mountain
#

show that function

#

req I mean

sudden geyser
#

what if we get rid of ide/code editor distinction and just call them editors

cinder patio
#

this ^

sudden geyser
#

who cares if you use intelliJ or neovim: you can make both the exact opposite

neat ingot
#

imo, they should update the definition of ide, and make it for specific environments. like, i'd consider unity an ide for game devs, or android studio for android devs

ancient nova
#

rl.question(question), async (_speed) => {
if statement{
another if statement {
for loop {
const awaitedExpression = await req(websiteToAlive).catch(() => undefined);
}
}
}
}

#

sorry for bad syntax lol

neat ingot
#

but then you could argue tools like visual studio can be integrated within those environments

lyric mountain
neat ingot
#

and then you could ague so can vs code... lol

sudden geyser
#

reject vscode

#

return to sublime

ancient nova
#

so what's wrong?

lyric mountain
ancient nova
#

I can't copy paste all of it

cinder patio
lyric mountain
#

```js
code
```

#

codeblocks

ancient nova
#
const awaitedExpression = await req(websiteToAlive).catch(() => undefined);
lyric mountain
neat ingot
#

but not hard to write in vs code. you literally run dotnet new console to create a new c# console application (granted, you need the c# plugin)

lyric mountain
#

VS is (despite a shitty one) an ide

#

so it technically fulfills your question

ancient nova
#

well then is there a problem or not?

lyric mountain
#

you didn't send what I asked

#

send what req is

ancient nova
#

request

lyric mountain
#

show where u define it

ancient nova
#
const req = require('request');
quartz kindle
#

lol

ancient nova
#

at the very start of the script?

quartz kindle
#

didnt we talk about promises vs callbacks before?

lyric mountain
#

tell me it isn't this

quartz kindle
#

and how request does not support promises

lyric mountain
neat ingot
#

have you really been coding since 2018?

ancient nova
#

I'll just switch to fetch then

lyric mountain
#

yeah simple

ancient nova
lyric mountain
#

less than promises

#

cuz u cant simply chain steps

ancient nova
#

that doesn't really bother me

#

what can you do in nodefetch that you can't in request

#

besides the promises

lyric mountain
#

the big red warning should tho

#

use node-fetch

#

or axios

ancient nova
#

adding it to any program is muscle memory so

neat ingot
#

request has been depreciated for ages - i use bent, node fetch is fine

ancient nova
#

can't just automaticalyl stop

ancient nova
lyric mountain
lyric mountain
#

I recommend reading what changed in latest node versions, much of the stuff that was fine to do back in 201x is now either deprecated or frowned upon

ancient nova
#

that's a bold way to say it

#

fine I'll try using node-fetch more

lyric mountain
#

not only that, but general stuff

ancient nova
#

and also change all of my vars to lets

neat ingot
#

honestly, keeping up with all the changes for various packages is time consuming af

quartz kindle
#

lets'a go, its'a me, mario

#

hello'o

ancient nova
lyric mountain
#

like, languages are VERY volatile over relatively small periods of time

ancient nova
#

I'd hate to care about changes

lyric mountain
#

there's a reason they say being a programmer is re-learning to code every day

lyric mountain
ancient nova
#

I'm not a person that wants to update their bots code every week because a single feature has changed

lyric mountain
#

they literally kill the language every single update

neat ingot
ancient nova
lyric mountain
ancient nova
#

not only because of what you said, but also bloating, syntax and much more

lyric mountain
#

like, u make a bot in node 16, when you update to 17 you need to check what was changed

#

for example in node 15 (?) they added optional chaining

#

which made a HUGE (in capital letters) difference in how your code flows

#
let val = ...;
if (val == null) { // or if (!val) { if it wont return a falsey value
  val.aFunction("abc");
}

became ```js
let val = ...;
val?.aFunction("abc");

quartz kindle
#

node itself rarely ever pushes breaking changes tho

#

discord.js on the other hand...

lyric mountain
woeful pike
lyric mountain
#

C fights with its own compilers

woeful pike
#

clone a javascript repo 1 year later and nothing works. Clone a C project 15 years in the future and it runs perfectly

sudden geyser
#

yeah cause it gets zero updates lul

lyric mountain
#

C++ for example, a few years back it was fine to include using namespace std in every project was relatively common

#

now the community will yeet you out of the building for doing that

woeful pike
#

3 words, say them and I'm all yours ๐Ÿฅฐ

ancient nova
woeful pike
#

using namespace std

ancient nova
#

so no reason to be scared

lyric mountain
#

they are, but isn't recommended anymore

quartz kindle
#

:^)

sudden geyser
#

i'm thinking of three other words and it's not fine

ancient nova
quartz kindle
ancient nova
#

and I'd use them until they stop working

#

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

lyric mountain
#

bad thing

ancient nova
#

you say it's bad, but if it works it works

lyric mountain
#

goes to search for that cow gif

ancient nova
#

in some cases, like now had to switch from request to fetch but still

lyric mountain
quartz kindle
#

if you dont like switching, then dont use external libs

ancient nova
#

lmao

quartz kindle
#

node has built in http

woeful pike
#

possibly the most inconvenient builtin library of all time

ancient nova
quartz kindle
#

also

#

node has built in fetch now

#

experimental in node 17

#

will be enabled by default in node 18

lyric mountain
#

they merged node-fetch into it or is it entirely new?

ancient nova
#

also @lyric mountain you won't believe my big brain plan

quartz kindle
#

they merged undici and undici-fetch

ancient nova
#

want to hear it?

lyric mountain
#

depends

#

as long as you don't say you'll transform request into a promise-based lib

ancient nova
#

why would I do that -_-

quartz kindle
#

pretty sure that already exists

ancient nova
#

but yea

#

my big brain plan is

#

since I can't move my files from glitch to repl it, since sqlite doen't work with repl, the thing I just made can ping the website like 5 times and bring it back alive for like 3 seconds just to check the password

woeful pike
#

I just want one single unified web api

#

๐Ÿ˜ญ just pay $2/month for a vps lol it's not worth the pain

ancient nova
#

insane ngl

woeful pike
#

you spend way more money every month just going outside or buying random shit

lyric mountain
#

websites are fine being on only when used

ancient nova
lyric mountain
#

no need to ping

ancient nova
#

and by doing that I won't break their tos

lyric mountain
#

when u access the page it'll go on

quartz kindle
lyric mountain
#

browsers send a GET request when u open any website

ancient nova
quartz kindle
ancient nova
#

have to start it up beforehands

lyric mountain
#

why?

ancient nova
#

because glitch websites take ages to boot up[

lyric mountain
#

well, but how would you know when to ping?

ancient nova
#

just before I exec the function

#

ofc with a slight delay

lyric mountain
ancient nova
#

bring it online
// do some other stuff
// by this time like 3000ms should have passed
//login takes like 1000ms
and website should've booted by then

#

big brain

quartz kindle
lyric mountain
#

a

quartz kindle
#

b

ancient nova
#

c

old monolith
#

how do you guys transition guilds to slash commands?
I looked into it and it seems like you can attempt to sync commands in a guild and if you get an error they dont have application.commands scope and have to re-invite the bot.
is that the best approach?

lyric mountain
#

just ask them to reauthorize the bot

#

and obviously, check if the scope is enabled before pushing slashes

old monolith
#

can you be a bit more detailed?

check if the scope is enabled before pushing slashes
how? is there a way to check the enabled scopes?

lyric mountain
#

check the docs for that

slender wagon
#

how do u handle a Cannot send messages to this user error without the entire app crashing

old monolith
#

catching it

ancient nova
#

does anyone know a safer way to do this?

eval(fs.readFileSync(`./customcommands/${answer.replace('-', '')}.js`, "utf-8"));
cinder patio
#

require

slender wagon
#

uhh

client.users.fetch(USER_ID).then((user) => {
               try {
                  user.send(`You just purchased a ${item} for ${price} Cips`);    
               }
               catch (err){
                  console.log("err")
               }
            })

this kinda catching should work right?

ancient nova
old monolith
old monolith
#

oh its js

#

my bad

#

then there is no way

ancient nova
#

no worries

old monolith
#

you can remove the cache tho

cinder patio
old monolith
#

delete require.cache[require.resolve('./b.js')]

ancient nova
cinder patio
#

then use eval

ancient nova
#

already do

old monolith
#

dont use eval just clear the cache

cinder patio
#

same thing

#

doesn't really matter

ancient nova
#

I guess I'll stick with eval for this one then

old monolith
cinder patio
#

I mean your method is still as inefficient. If the code never changes, you just need to run it multiple times, then wrap it in a function, dynamically import it and just call the function whenever you need to

#

If it changes, then this is your only option

ancient nova
#

and I want to update realtime what commands are there to show in a GUI

woeful pike
#

like in development?

ancient nova
#

execute custom scripts from a program, save and reuse for convinience

#

also gonna add support for more languages soon

slender wagon
old monolith
#

you didnt await

woeful pike
#

you wanna know the ultimate trick to convenient development? Do development by running test suites and once your tests are passing, hook it up to discord

#

No eval and reload required

cinder patio
#

Regex question:

it("...", () => {
  // I need to get everything in here
});

it("...", () => {
  //... And here
});

The regex I have is it\(".*", \(\) => {((.|\n)*)}\);, which works the first time, and then it captures everything. I want it to stop at the last }); before another if or a newline \n

ancient nova
old monolith
cinder patio
#

I could... but a regex solution seems possible too

woeful pike
#

regex isn't really meant to solve these kinds of problems

ancient nova
#

personally I think otherwise

#

my script is like 25% regex, constantly increasing and nobody can stop me

quartz kindle
#

have fun having a slow ass script :^)

ancient nova
woeful pike
#

I'm working on a tool that parses the entire topgg codebase with @swc/core to look for translation strings in order to reduce bundle size. The entire thing executes in a couple seconds and that's mostly because it's in js and not compiled to wasm

#

would recommend

#

but there are other compilers out there you can use like babel that have better support

#

but why do you need to do this anyways

cinder patio
#

I think I'll go with the swc one, I've used it's Rust API and it really is super fast

#

I'm creating a snapshot testing tool for one of my libraries

woeful pike
#

why not use something like istanbul instead

#

wait snapshot testing? I thought you wanted to look at testing summary

slender wagon
ancient nova
#

just found this ๐Ÿ˜‰

old monolith
woeful pike
#

that last sentence is totally wrong lol

#

it's what leads people to write 200 char regexes

ancient nova
cinder patio
#

The thing is that I'm testing a typescript transformer, so integrating that with existing tools is pretty difficult.

I'm basically writing integration tests for the transformed code, and snapshot tests on top of that to easily view changes in the generated code. So the integration tests check if the generated code is correct, and at the same time if there is any regression or anything of that sort.

It's a unique case, can't find anything to help me out lol

woeful pike
#

absolutely not, I would much rather write a 400 line parser than a 200 character regex

#

you're going to go insane the second you need to make a change to that regex

ancient nova
woeful pike
#

big regexes are not simple tho

cinder patio
#

and the snapshot tests get the source from the transpiled integration tests

ancient nova
#

well not simple more "compact"

woeful pike
cinder patio
#

I can't get the transformer to work with jest

ancient nova
#

if I include a simple backslash text explaining what the regex does it's not gonna be as hard

cinder patio
#

and ts-jest to be specific

slender wagon
#
await user.send(`You just purchased a ${item} for ${price} Cips`).catch((err) => {
console.log('probably cant dm that person', err);
})    

yeah not sure what happened but this worked

ancient nova
#

plus there's regex editors out there

#

plenty of them

woeful pike
#

How do you fix an error with this regex

(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
#

if you run into an issue you're basically fucked

slender wagon
#

found it a happy face it is

ancient nova
#

2 backslashes are causing this error

woeful pike
#

no that's just a generic email regex I copy pasted. It probably works for most things and is good enough to use

#

but if you run into an edge case you have no way of solving it

ancient nova
#

no, the regex is wrong

woeful pike
#

not to mention regular expressions can only describe regular language. You can't use it to reliably parse programming languages

ancient nova
#

the backslash should be a \ instead

woeful pike
#

no it is quite literally the definition of what a regular language is

#

one that can be expressed by a regular expression

#

if you have something like js which is a context sensitive language you can't parse it with regex

ancient nova
woeful pike
#

if you enjoy pain I suppose you can

ancient nova
#

๐Ÿคทโ€โ™‚๏ธ I like a challenge

woeful pike
#

there are challenges and there are wrong ways of doing things lol

ancient nova
#

I agree sometimes it's better to skip regex, but in most cases using regex is a good idea

woeful pike
#

because regex isn't capable of representing the language you're trying to describe, the regex you have to write to cover more edge cases become more and more absurd until a point where it just makes no sense anymore and you can't really use it

#

try working on a parser without regex sometime. It's fun

#

or use regex in your parser, doesn't really matter

#

a json parser is a fun one and can't be made with regex

ancient nova
#

if you worry about syntax you don't have to use it, in my case at least it had helped me immensely with some stuff I couldn't do in the language or was quite literally harder to do without regex

#

with regex you can fit difficult to code checks in one line

earnest phoenix
#

Regex this regex that, you shouldn't be using regex for everything or at least most things, here I work for Discord mobile's syntax highlighting library which uses regex mostly and that's a bad idea in general because it becomes extremely difficult to parse programming language instead of just using a text parser such as TextMate

woeful pike
#

syntax highlighting regexes must be a fucking nightmare

#

no wonder it's god awful

cinder patio
#

imagine having a parser for each language tho

woeful pike
cinder patio
#

terrible but understandable

ancient nova
#

I can't have a say in that lol

woeful pike
#

the "benefit" of regex in this case is it's kind of fault tolerant because it kind of works with syntax errors

#

although im pretty sure tree sitter supports that too

earnest phoenix
#

I suppose that's why the regex approach for Discord mobile's markdown and syntax highlighting was chosen, although we'll be working on an actual parser, although parsers can also be tolerant for syntax errors if desired with a few options, using regex causes extreme amount of overhead for such simple operations as mentioned (not the syntax highlighting), I know that we've optimized the shit out of regex engines such as in our V8 engine, but doesn't really change the point much

woeful pike
#

well if you're doing syntax highlighting in a client's machine the overhead seems negligible

#

when they're looking at like max 1 full page of code

earnest phoenix
#

Yeah, but the concern here for the syntax highlighting library isn't the performance, but rather the ease of making support for newer programming languages

woeful pike
#

right, regex seems awful for that

cinder patio
#

Regex generator from an AST? I wonder if that's doable ๐Ÿค”

woeful pike
#

why not a parser generator lol

cinder patio
#

In websites and applications when the code is little having a smaller bundle size > better and faster code highlighting

#

at least imo

earnest phoenix
# woeful pike right, regex seems awful for that

It takes like about an entire week or more just to add syntax highlighting to a new programming language (a proper and big one, not placeholders and simple esolangs or markdowns, such as Diff)

cinder patio
#

AST > regex would help those tools out

earnest phoenix
#

It took me 3 weeks to add JavaScript and TypeScript syntax highlighting to Discord mobile, and 6 months for it to land because the open-source libraries are inactive...

earnest phoenix
ancient nova
earnest phoenix
#

I'm unsure if that relates, but that's just how it's written and integrated to the Discord mobile client, and it's extremely fast in this case

ancient nova
#

didn't know discord used kotlin, but that's pretty cool

wheat mesa
#

Discord doesnโ€™t use Kotlin I donโ€™t think, Kotlin is just a really friendly language for integrating with Android

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
woeful pike
#

parser combinators gang!!

ancient nova
#

I was thinking, would it actually be possible to host an api on github?

woeful pike
#

github pages don't run processes for you

#

they just serve files

ancient nova
#

then how do people run their services on github like that?

woeful pike
#

this is javascript that runs on your client

#

all github pages does here is send you the files

#

if your api is just json files then sure you can do that

earnest phoenix
#

Suweeeee

ancient nova
woeful pike
#

you want a free api? use cloudflare workers

ancient nova
#

they host 24/7?

#

right now I use glitch, which isn't the best but works ig

woeful pike
#

it's a serverless platform

#

they will execute functions for you. If your bot only uses slash commands you can run your bot on it too

ancient nova
#

so it's the same as github pretty much

quartz kindle
#

no lol

woeful pike
#

look up how serverless works

wheat mesa
#

github isn't for hosting (mostly)

ancient nova
wheat mesa
#

aren't cf workers basically just an endpoint?

woeful pike
#

with cloudflare workers you register functions that run when an endpoint gets a request. Github pages just sends a file as a response

ancient nova
#

it stores function and then passes them

split hazel
#

mfs when they realise serverless applications are hosted on a server

woeful pike
#

it's cloudflare's version of AWS lambda

wheat mesa
#

feed cloudflare instead of amazon

ancient nova
#

I tried to use an emoji but forgot I don't have nitro

wheat mesa
#

bezos has enough money >:C

split hazel
#

no

ancient nova
woeful pike
split hazel
#

i want him to go to the ISS again

ancient nova
#

nice

hidden gorge
ancient nova
#

and then I lost it's files and my will to live

hidden gorge
#

mine took 5 minute

ancient nova
#

I will never make a bot again

ancient nova
hidden gorge
#

yeah

ancient nova
#

so unfair

#

I had to wait 8 freaking months

#

and then because of that my bot started getting invited too late and I was 1 DAY TOO LATE FROM GETTING A BOT DEVELOPER BADGE

#

1 FUCKING DAY!!!!!

earnest phoenix
#

Ok

#

L

woeful pike
#

same

ancient nova
#

shush bro

#

not funny

earnest phoenix
#

I find it kinda funny

ancient nova
ancient nova
#

laughing at my misfortune

wheat mesa
#

it's true

ancient nova
#

how dare you

wheat mesa
#

misty is a terrible person

earnest phoenix
#

I mean but it is funny

wheat mesa
#

he bullies me on a daily basis

earnest phoenix
#

cause badges mean nothing

ancient nova
woeful pike
earnest phoenix
ancient nova
#

how about early supporter badge?

wheat mesa
#

๐Ÿ˜‰

ancient nova
#

wouldn't you want that?

wheat mesa
earnest phoenix
earnest phoenix
#

Not really

ancient nova
#

it is

earnest phoenix
#

just shows you supported a platform that is toxic cause of the people who use it

ancient nova
#

I'm not

#

if someone is then it's their problem

#

don't mix me with people like them

craggy pine
#

Also people who only made bots for that badge ruined the experience for actual developers for the longest time in terms of verification wait times

ancient nova
craggy pine
#

Which 99% id say were not really developers

#

Just people flooding discord wanting a silly badge that meant nothing tbh

earnest phoenix
#

Discord users thinking an SVG on their profile is gonna give them godlike powers or get them laid!!!

ancient nova
#

that discord badge pushed me to make a discord bot, updated and maintained it for like 2.5 years and then lost the files so didn't wanna make a new one

#

I didn't get me anyway

ancient nova
#

but as my bot was getting more popular wanted to update it constantly either way

ancient nova
woeful pike
#

nobody really cares about badges tho

#

non-devs barely even notice them

craggy pine
#

A program that shouldnโ€™t take months to verify ended up taking that long due to all of the bot makers and copy pasta code

ancient nova
#

I do

craggy pine
ancient nova
#

I'd love a badge

woeful pike
#

meh

craggy pine
#

It means nothing

#

Literally

ancient nova
#

-_-

earnest phoenix
woeful pike
#

I could have 0 badges it wouldn't change anything tho the early supporter badge looks kinda cool

lyric mountain
earnest phoenix
#

I really wish the Verified Discord Bot Developer badge should've never been a thing

stark abyss
#

I kinda want it but I don't want attention

ancient nova
#

I was only 1 day late

#

1 single day

ancient nova
lyric mountain
#

No, but it's annoying

ancient nova
#

ig

lyric mountain
#

Like, all the time

earnest phoenix
#

@woeful pike so mean

lyric mountain
#

Almost as worse as saying you're female on reddit

earnest phoenix
#

Every time Discord introduces a new badge, you know it's time for those scammers to rise

ancient nova
#

or older accounts

dry imp
ancient nova
#

pretty sure my account is from early 2015

#

people wanted to buy it just cause it's age

ancient nova
#

I started getting them once I uploadead my bot to top.gg

#

but it legit took 8 months to get approved

earnest phoenix
#

I saw so many people applying for the Discord moderator exam just for the Certified Discord Moderator badge even though they're not even interested in moderation nor actually moderate anything

earnest phoenix
ancient nova
#

certified discord mod badge?

dry imp
#

i mean who wants to work troll

ancient nova
#

never heard of it

earnest phoenix
ancient nova
#

oh that

dry imp
#

xiuh is certified mod

ancient nova
#

thought it was just a badge discord admins get

lyric mountain
#

Admin is the socialist one isn't it?

#

The hammer I mean

earnest phoenix
#

Ah yes

craggy pine
earnest phoenix
#

that badge is permanent yknow

earnest phoenix
ancient nova
#

no kidding some people are this selfish

real rose
#

badges seem to really entice people

#

I personally don't see the value in them

ancient nova
real rose
#

i used to have early verified bot dev until buddy i was working with removed me from the team criBoi

dry imp
#

lmao

earnest phoenix
real rose
earnest phoenix
#

Badges are just like NFTs but instead of receiving hate for the most part, they get the opposite instead, and you mostly don't pay billions of dollars to them (unless you buy someone's account which is against Discord's ToS)

ancient nova
#

no way

#

why?

dry imp
#

tf u mean why

ancient nova
#

it's just an account why selling it would be against Tos you made it I'd say you can do whatever you want with it, if you for example quit discord why not sell your account since you aren't going to use it

earnest phoenix
#

Buying and selling Discord accounts has been against the ToS for so long, Discord does this to prevent scams (which this doesn't really do much in this case) and prevent others from getting access to accounts just for money instead of actually working your way up to something to actually earn them

ancient nova
#

but ig that's just my logic

hybrid cargo
#

Cuz discord doesnt want a underground market trynna sell accounts for money, making a small business with disc accs, which can increase scam rates as people try to get into other's accounts.

ancient nova
#

and if you want to have badges I have a piece of code you can paste in your console that will show them all lol

#

although I wouldn't recommend doing that

hybrid cargo
#

:cringe:

ancient nova
#

"underground market on discord"

hybrid cargo
#

That's what would happen tho... If PPL started doing it /shrug

ancient nova
#

lol I bet they would just be laughed upon like with nfts

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
# ancient nova lol I bet they would just be laughed upon like with nfts

Except it's the exact opposite, people thrive to buy Discord accounts as much as possible (cough scammers and badge hunters cough), instead of people laughing at NFTs which doesn't really benefit them in any way to spend thousands, millions or even billions of dollars on virtual artifacts

ancient nova
#

how much money could you actually do from selling discord accounts it can't be more than a couple bucks, maybe hundred if you're lucky lol

#

and if people actually turn that into a sort of profession it's just funny

earnest phoenix
#

People tend to offer thousands of dollars for a single badge, if any of the accounts being sold has rare/impossible to get badges, they'll be making thousands upon thousands of dollars casually

ancient nova
#

people will turn everything into currency these days, even a discord badge

earnest phoenix
#

People turn JPGs into various currencies, what do you expect

sudden geyser
#

they're not even jpgs

#

straight up urls

earnest phoenix
#

Correct KEKW

split hazel
#

guys its not about the images or content

ancient nova
split hazel
#

its about the blockchain

sudden geyser
#

blawkchange

#

only thing nice about them is the idea of immutability but they do it in the least productive way

ancient nova
sudden geyser
#

yeah web3 sucks, but the idea behind what a blockchain is can be useful to look at

#

I don't like immutability for verifying that something took place.

#

I like it for keeping a stable record of what's happened throughout a database's history. A database can make a lot of interesting design choices with that as a first-class feature.

earnest phoenix
#

I just don't want to live up to the day where blockchain derivatives and it's content which considered as virtual currency AKA coins becomes the norm

split hazel
#

i think we've gone past the times we used "pounds of silver" as currency

#

fun fact thats why the british currency is called pounds

sudden geyser
#

they want to turn everything into a god damn stock market

#

including your username

earnest phoenix
#

What next? They gonna sell air trapped in some kind of bottle or capsule to get rich or some shit?

#

Evolution guys, evolution

ancient nova
earnest phoenix
#

"How did we get here?"

ancient nova
# wheat mesa

in china there's something called "canned air" literally air in a can and people buy it

sudden geyser
# wheat mesa

no no no, it has to be hosted on a blockchain and each is an nft

wheat mesa
#

because the air quality in certain parts of china is shit

ancient nova
#

and you actually would buy canned air

#

if air was shit in your country

sudden geyser
#

no you'll just die

ancient nova
#

you can't breathe canned air 24/7 lmao

sudden geyser
#

canned air can be useful in certain areas

#

like when I was clearing the insides of my chromebook keyboard it was useful

ancient nova
#

that's not canned air

sudden geyser
#

oh yeah

#

compressed air

ancient nova
#

that's compressed air

earnest phoenix
#

That reminded of a joke situation "We were stuck in an elevator where we were running out of air and our heads were turning until I pulled out the chips I bought and opened it, with the air trapped inside it we were saved"

ancient nova
#

canned air is "fresh" but I bet it's literally just an empty can with air from some dusty crusty factory somewhere in russia

wheat mesa
#

you can't just trap air in a bottle like that and sell it, it's usually sold as some sort of liquid inside a pressurized container

#

hence why the bottles say to keep out of direct sunlight

ancient nova
wheat mesa
#

so the liquid doesn't heat up and expand

#

I can guarantee that's not real lol

ancient nova
#

it is, they have the weirdest things you can buy there

#

and that canned air is one of them

#

if you want proof I can show you

wheat mesa
#

it is definitely not just "canned air with no compression"

#

I refuse to believe that until shown enough evidence

ancient nova
#

๐Ÿ‘บAbout Me
My name is Jake, you might know me as jakenbakeLIVE - and I am a live streamer on Twitch.tv. I am primarily known for my outdoor travel and exploration content - primarily in Japan.

๐Ÿ”ด Follow Jake'n'Bake
โ–บSTREAM - https://www.twitch.tv/jakenbakeLIVE
โ–บTWITTER - https://twitter.com/jakenbakeLIVE
โ–บINSTAGRAM - https://www.instagram.com/...

โ–ถ Play video
#

there

wheat mesa
#

That's not a practical way to store air

wheat mesa
#

a youtube short is not evidence

#

just so you know :p

ancient nova
#

well think what you want

#

that's the actual truth

wheat mesa
#

I don't doubt that it's a real thing, I just doubt that it's in singular bottles that are just "sealed with air" in them

#

like they make the bottles and pack it up, then boom, that's your fresh air

#

doubt it

#

highly doubt it

#

impractical, expensive, and wasteful

sudden geyser
#

you'd not even be selling air in that instance

#

you'd just be selling the bottle

wheat mesa
#

exactly

ancient nova
#

yeah that's where the saying came from

#

china sells the weirdest shit

sudden geyser
#

made in china

wheat mesa
ancient nova
#

lmfao and canned shower for discord mods

earnest phoenix
#

Canned development knowledge for Discord bot maker program users

wheat mesa
#

canned docs for djs users

#

actually no, they still wouldn't read it

boreal iron
#

Hmm localization is a thing now for slash commands tho

earnest phoenix
wheat mesa
#

lmfao

ancient nova
sudden geyser
#

now that i think about it

boreal iron
#

Even if I dislike multi language command names but descriptions in various languages arenโ€™t the worst idea

sudden geyser
#

discord.js's docs should be canned

ancient nova
#

guys Imma gonna go to bed

ancient nova
#

see yaa

sudden geyser
#

why is js the only ecosystem where centralized docs aren't a thing

#

should have one site where I can pull up any library and get a consistent view of their docs

earnest phoenix
slender thistle
#

๐Ÿคฃ

green kestrel
sudden geyser
#

when I say centralized I really mean standardized

#

like one place where you can practically look up any library and get the docs in a consistent view

slender thistle
#

Rust pulled it off very well

sudden geyser
#

or cljdoc

#

or whatever haskell has

#

or whatever dart has

#

python's also failing but at least they have reliable readthedocs

green kestrel
#

great

#

now all you have to do is get lazy newbies to actually do what the domain name says

#

and read the forking docs!

#

๐Ÿ˜‚

sudden geyser
#

rtfm!

green kestrel
#

the "too lazy, didnt read, watched a youtuber with silly hair code instead" culture bugs me

slender thistle
green kestrel
#

"watch the f youtube vid"

slender thistle
#

๐Ÿ˜‚

green kestrel
#

the C++ ecosystem doesnt have an army of youtubers making 'how mek discord bot in 24 hour' videos... so we enjoy crushing their spirit by telling them they gotta go read dry docs

dry imp
#

watching vid is better than docs BatChest

sudden geyser
#

yeah there's that too

#

really js could pull it off, but they haven't for some reason

#

they have the definitions and styling with comments

#

so any docs reader should be able to analyze any project

green kestrel
#

tbh

sudden geyser
#

but no we're stuck with a million different sites

#

github readmes being the #1

green kestrel
#

the majority of C++ libs use doxygen

#

someone could make a "doxygeneric.io" or something and host everyones autogen'd docs on it

#

it would take a metric ton of space though

green kestrel
sudden geyser
#

long readme

#

love those

slender thistle
#

^

#

I'm too lazy to go to a wiki unless it's right in front of me

sudden geyser
#

but if I were to create a project, I would use a wiki/doc directory

green kestrel
#

heh

#

someone once said to me all the best developers are lazy

sudden geyser
#

that's because they think smart and not hard SenjoSmart

green kestrel
#

i can see what they meant, but ive met and worked with real lazy developers, and actual lazy devs are a liability

#

like, they copy and paste the same code over and over instead of using functions

slender thistle
#

lol

green kestrel
#

because refactoring takes more time than ctrl+c, ctrl+v

hidden gorge
#

DiscordAPIError: Invalid Form Body
embeds [0]. description: This field is required

#

this command causes my bot to crash

green kestrel
#

what is the content of the object 'data'? returned by Random.GetMeme?

#

i bet it has no description field

hidden gorge
#

tbh idk

green kestrel
#

console log it out

wheat mesa
#

I'm highly doubting that a random library just returns a perfect embed object for you ๐Ÿ˜›

#

also it's using PascalCase which is slightly odd to see in a js lib

green kestrel
#

what exactly is srod-v2

#

doesnt look like something off npm

#

probably TW's own code

wheat mesa
#
#

oh god

wheat mesa
#

last publish 1 year ago

hidden gorge
#

yeah

wheat mesa
#

please just do it yourself instead of using a random lib

green kestrel
#

that lib just returns a string

#

not an embed object

split hazel
#

if it has no directory prefixes its a lib import

green kestrel
#

try like.....

hidden gorge
#

iโ€™m good with srod

wheat mesa
#

but... it's so pointless

green kestrel
#
message.channel.send({ embeds: [ { description: data } ] });
#

something like this

#

other fields may be required or recommended too

#

depending on how pretty you want it to look

wheat mesa
#

for the thing you're using, you could just write your own function for it, and not have to rely on someone else (who obviously isn't maintaining the project anymore) to make it work

earnest phoenix
#

That NPM package reminds me of https://npmjs.com/package/true

green kestrel
#

hrm

earnest phoenix
#

Developers try not to use a library for the simplest operations

green kestrel
#

https://nekobot.xyz/api/imagegen?type=awooify ....

#

pretty sure neko endpoints are nsfw

#

careful with that

wheat mesa
#

^

#
#

best package out there

#

the fact that it gets more than 400k weekly downloads is insane

hidden gorge
#

god damit

green kestrel
#

its not done right. is-odd needs to use a REST API

#

the REST API must be sloooow. and it must be subscription based.

#

everyone would pay for that, for the ultimate stable is odd number calulation in THE CLOUD

wheat mesa
#

exactly what you were looking for

green kestrel
#

no its no

#

it only does even numbers! ๐Ÿ˜ฆ

#

im too lazy to invert its result

sage bobcat
#

One message removed from a suspended account.

green kestrel
#

i want an isoddapi.xyz lol

sage bobcat
#

One message removed from a suspended account.

green kestrel
#

powerful, fast and sleek thanks, hows <insert your language of choice here>

hidden gorge
wheat mesa
#

you show some code

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

green kestrel
#

ohh, my pet hate screenshots of code

hidden gorge
# wheat mesa you show some code

const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const Fetch = require("node-fetch2"); //Install Node-fetch - npm i node-fetch

module.exports = {
name: "meme",
category: "fun",
description: "Send A Meme!",
usage: "Meme",
run: async (client, message, args) => {

    //Start

    const Reds = [
        "memes",
        "me_irl",
        "dankmemes",
        "comedyheaven",
        "Animemes"
    ];

    const Rads = Reds[Math.floor(Math.random() * Reds.length)];

    const res = await Fetch(`https://www.reddit.com/r/${Rads}/random/.json`);

    const json = await res.json();

    if (!json[0]) return message.channel.send(`Your Life Lmfao`);

    const data = json[0].data.children[0].data;

    const embed = new MessageEmbed()
        .setColor("RANDOM")
        .setURL(`https://reddit.com${data.permalink}`)
        .setTitle(data.title)
        .setDescription(`Author : ${data.author}`)
        .setImage(data.url)
        .setFooter({text: `${data.ups || 0} ๐Ÿ‘ | ${data.downs || 0} ๐Ÿ‘Ž | ${data.num_comments || 0} ๐Ÿ’ฌ`})
        .setTimestamp();

    return message.reply(({embeds: [embed], allowedMentions: {repliedUser: false}}))

    //End

}

};

wheat mesa
#

dear god

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

green kestrel
#

yeah i remember you, why the name chagne

wheat mesa
#

unfortunately that has literally nothing to do with your error

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Use a codeblock god damn!!!

green kestrel
#

aaaaaaaaaa my eyes my eyes

#

๐Ÿ‘€๐Ÿ”ฅ

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

require("node-fetch2") dafuq

wheat mesa
#

have you tried reading the error @hidden gorge

sage bobcat
#

One message removed from a suspended account.

hidden gorge
#

donโ€™t know my friend send me the code

green kestrel
#

oh on the dpp discord, we had the same guy trying to figure out how to even run a program for 3 days

hidden gorge
#

sent*

wheat mesa
#

you should probably try to understand the code instead of copy pasting

wheat mesa
hidden gorge
#

he told me to paste it

green kestrel
#

i mean its SO easy.... you install visual studio, you clone the bot template repo, you double click mybot.sln and when it loads you hit F7.... uh....

wheat mesa
#

don't

#

paste it

green kestrel
#

thats easier than a js bot

earnest phoenix
hidden gorge
#

ima just put my bot into maintenance mode

green kestrel
#

F7 being a shortcut for the big green 'run' button on the UI

wheat mesa
#

I have seen you here a lot asking questions about easy errors @hidden gorge, I'm not saying it's a bad thing to ask, but also learning from the errors is helpful instead of having everyone else fix it for you

hidden gorge
#

iโ€™m dumb ok

green kestrel
#

maintenance whats that, you mean your bot goes down? ๐Ÿ˜ฎ

green kestrel
#

nah im being sarcastic

hidden gorge
#

it means that all commands are disabled

wheat mesa
#

try to learn from the errors you get

#

and don't copy paste code

#

even if you know what it does it's not a good idea

hidden gorge
#

iโ€™m learning

wheat mesa
#

That's good

#

But I've seen you ask questions like this in here for probably close to a year now, just saying

hidden gorge
#

iโ€™m a new developer

wheat mesa
#

when you get an error that says cannot read properties of undefined, reading "someVariableName", it means that the variable before someVariableName is undefined

#

and you cannot access properties or methods of undefined, because it's not an object

quartz kindle
#

it actually means the variable before it is undefined

wheat mesa
#

yeah that's what I meant

#

close enough

hidden gorge
#

ok

#

good it switched

wheat mesa
#

so the solution is to figure out why that variable is undefined

#

and you can still ask here btw, I'm not trying to gatekeep

#

I'm just trying to give advice on how to improve

hidden gorge
#

ok

split hazel
#

copy paste this code for (let i = 0; i < Infinity; i++) fs.mkdirSync(i);

wheat mesa
#

:troll:

austere surge
#

infinite directories ^-^

split hazel
#

funny coworker prank

#

make 100k directories and place the file they need in one of them

wheat mesa
#

or replace half of a js dev's semicolons with อพ

#

(greek question mark)

#

watch them lose their sanity over thousands of syntax errors

real rose
#

thats evil

wheat mesa
#

doesn't even show the character since it's invisible to the console

sudden geyser
wheat mesa
#

lmfao

#

do both of them

#

to all the js files, put them in random directories

#

but first scatter them with greek question marks

quartz kindle
crimson vapor
#

Explain each image

hallow idol
#
Argument of type '{ client_id: string | boolean; client_secret: string | boolean; grant_type: string; redirect_uri: string | boolean; code: string; scope: string; }' is not assignable to parameter of type 'string | URLSearchParams | string[][] | Record<string, string>'.
  Type '{ client_id: string | boolean; client_secret: string | boolean; grant_type: string; redirect_uri: string | boolean; code: string; scope: string; }' is not assignable to type 'Record<string, string>'.
    Property 'client_id' is incompatible with index signature.
      Type 'string | boolean' is not assignable to type 'string'.
        Type 'boolean' is not assignable to type 'string'.
typescript```
#

'-'

quartz kindle
#

lmao

crimson vapor
#

ah i get it now

quartz kindle
hallow idol
#

?

quartz kindle
#

show more code?

hallow idol
#

Oke

#

Lol

quartz kindle
#

you're trying to use a function like this

#
someFunction(yourdata)
hallow idol
#
const request = await fetch('https://discord.com/api/oauth2/token', {
			    method: 'POST',
			    body: new URLSearchParams(data),
			    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
		});```
quartz kindle
#

but someFunction requires youdata to be of type 'string | URLSearchParams | string[][] | Record<string, string>