#development

1 messages · Page 2069 of 1

viscid gale
#

so a repl issue?

sterile lantern
#

oh

#

run

quartz kindle
#

according to the docs thats just a check, it doesnt wait until ready

sterile lantern
#

kill 1

#

in your shell

#

its discord rate limits

#

repl.it shares IPs for many projects, and a lot of people use it to host discord bots

#

so its just discord not letting you sign in

#

(kill 1 switches the repl container)

viscid gale
boreal iron
#

Outside the ready event

viscid gale
sterile lantern
#

yeah repl it is reallllly bad for hosting

#

its fine for testing but i wouldnt rely on it for bot hosting

viscid gale
#

I.. do not have funds to look at other options

sterile lantern
#

railway is a good option

#

although theyre soon limiting their starter plan to 500 hours (similar to heroku)

#

unless you add a CC

quartz kindle
sterile lantern
#

that's probably for the repl container, not ur project btw

quartz kindle
#

some people have said you can reset replit's ip address by running the kill command

viscid gale
#

so.. someone shaaring my ip

#

did bs

quartz kindle
#

you can try that

viscid gale
#

and I pay for it

#

wow

sterile lantern
viscid gale
#

😭

sterile lantern
#

so they arent just gonna give u a individual ip for each project

quartz kindle
#

try running the kill command

sterile lantern
#

that switches the container, works most of the time for me

viscid gale
#

I did.. I'm seeing different errors.. progress ig

#

but it isn't discord.js related

quartz kindle
#

what errors are you seeing?

viscid gale
#

i connect to a.. well something I made to share objects remotely like a db

#

so im seeing a few connection broken and the first one I saw was network.. switch.. TLS

sterile lantern
#

i mean do you allow access from anywhere

viscid gale
#

i cant remember the exact error

#

but in short.. I switched networks while connecting

#

I understood that one, but now.. it's just going connection broken

#

gonna try again in a few seconds

#

success

#

tnx samm and tim

boreal iron
#

So no, nobody does until you pay for it

vivid fulcrum
#

shame we can't fully migrate to ipv6

#

wouldn't be a problem if standardization was a thing from the start

#

the more you dive into protocols the more you realize the internet is bullt by smart people who have no idea what they're doing

sharp geyser
quartz kindle
#

they prioritize "startup" performance instead of long running performance

sharp geyser
#

Yea seems like it to me as well

quartz kindle
#

i kinda dont believe their benchmarks, jscore is not faster than v8, not even close

#

its just faster to start, because its small and simple

#

while v8 is a monster

sharp geyser
#

Icic

#

I never even knew jscore was a thing until 10m ago

#

Looks like it was made by apple(????)

quartz kindle
#

also, their benchmarks focus on web, sqlite and ffi

#

all of which are js interacting with something outside of js

#

so it seems they did a great job optimizing the performance of js interacting with other langs

sharp geyser
#

Yeaa

quartz kindle
#

also, surprisingly, v8 is much more memory efficient than jscore

#

there are not many tests out there, but i found this one from 2019 comparing memory usage in react native

#

also, im pretty sure justjs blows everything away regardless

#

in terms of raw power, nothing beats it

#

it just doesnt have many tools that all other alternatives have

proven escarp
#

it’s youuuu

woeful pike
#

idk why people are trying to sell jscore as the ARM of js engines

spark flint
sharp geyser
hallow compass
#

How to add bot server and user count in website

vivid fulcrum
#

on the your topgg page?

lyric mountain
old cliff
fathom sonnet
#

I got a Question: is it posibble to save images to MongoDB and then when member execute command e.x /image

It generate random image from db

near stratus
fathom sonnet
#

Didnt think abt that

#

And links or link?

#

Since i can generate random img from ine link but saving multiple links dosent sound practical

lyric mountain
#

are you really generating the image or just returning a random image from a pool?

fathom sonnet
#

Return* srry

#

I kinda... Use generate from some reason instead od return

#

As my "keyword"

near stratus
#

well then just use a cdn or filestorage

#

you can technically save image as base64 or something on mongodb but won't be nearly as efficient

tidal nymph
#

My bot is currently fetching and editing a message on multiple servers in interval. But having to fetching every time actually causes the rate-limit. Is there a better way to do this task? (My bot has message cache disabled, idk if it's a good choice or not)

quartz kindle
#

even with cache disabled

#

that way you dont need to refetch it all the time

tidal nymph
quartz kindle
#

yeah

tidal nymph
#

hmm I see, Imma try implement that

boreal iron
#

@quartz kindle weird people at djs just mentioned that changing the nickname is currently bugged in v14

#

at least that wasn't my fault

quartz kindle
#

bugged by djs?

boreal iron
#

(at least in the latest build)

quartz kindle
#

or bugged by the api

boreal iron
#

in the latest djs build

#

(v14)

quartz kindle
#

lmao

wooden ember
#

nicknames?

#

you can change bots nicknames now?

#

or is that somthing thats been around for a while and i just never noticed

lyric mountain
#

always been there

#

bots are technically users after all

wooden ember
#

yeah i just never thought about it

#

makes sence

#

im still wating for bots to get an editable presence

#

so you dont have to have "playing"/"watching" there

boreal iron
#

doubt this will happen

#

to reduce the possible char length for ads?!

#

idk

#

maybe just because discord is weird

#

there's always a reason

fathom sonnet
#

Ammm another question, i saw this interesting thing

quartz kindle
#

"watching your mom under the table"

fathom sonnet
#

How I could make this with slash command?

boreal iron
#

The message content is exactly the same

#

No matter you send it as interaction response or message response

hallow compass
lyric mountain
old cliff
quartz kindle
#

yup, as we expected

#

ty for running the test

boreal iron
#

Is there actually a way to update the original response to an interaction after deferring?

lyric mountain
quartz kindle
#

the edit webhook endpoint should work as many times as you need

boreal iron
#

oh yeah I'm stupid

lyric mountain
#

The way u tested it is creating new arrays each time, and accessing arrays too

#

Although array ops are good to test whether it is good or bad too

hallow compass
lyric mountain
#

No, here

boreal iron
#

what would you say @original represents as type?

#

i don't get this

#

message resolveable or original, huh wtf

#

original actually is the interaction id or interaction message

quartz kindle
#

yes its a literal thing

boreal iron
#

really just @original

quartz kindle
#

yes

boreal iron
#

lol

#

that's confusing

quartz kindle
#

its a shortcut for the first response to that interaction token

boreal iron
#

hmm okay, wasn't aware of that

#

good to know

#

just wanna disable the components but I don't wanna fetch the message before

#

weird... it does absolutelly nothin

#

no error, no response

#

await interaction.fetchReply().then((message) => interaction.webhook.editMessage("@original", { content: "test", components: [] })).catch((error) => app.utils.error(error));

near stratus
boreal iron
#

I wanna keep this without auth

#

once I migrate the bot to interactions only, i dont wanna edit this again

old cliff
lyric mountain
boreal iron
# quartz kindle its a shortcut for the first response to that interaction token

ok I found the issue, @original is considered the select menu deferring itself (not my command respond)

it goes like /command -> response (select menu) -> defer interaction -> edit reply -> update original message (select menu)

webhook edit message actually required the interaction message id in this context, since it's the select menu interaction

#

easy things can be difficult sometimes

quartz kindle
#

ah yes

#

for message components you have to use the message id they belong to

boreal iron
#

should have mentioned that earlier I guess

quartz kindle
#

although responding to a component interaction with type 6 or 7 should work?

#

type 6 and 7 are specific responses to edit the message the component belongs to

#

but if you already respond to the component with a type 4 or 5 (create a new message), then you cannot use them at the same time

boreal iron
#

👍

fathom sonnet
#

any web dev here to explain me why tf these annoying lines from left and right sides appear?

#

ofc if u can see it on the image

quartz kindle
#

from left and right side?

#

i only see the big line in the middle

cinder patio
#

there are no lines

idle coral
#

Yo how do I make a folder in github..stupid question I know..but I'm not used to github. Haven't used it in 3 years.

lyric mountain
#

I mean, not directly

#

when u upload a file u can rename it, add somefolder/ behind it's name

idle coral
gloomy lantern
#

how to change prefix for BlackJack bot? i need / from +

lyric mountain
#

not the right place to ask

#

but since u said / I assume it uses slash commands

#

in which case you can't change

nocturne grove
#

When I have a try-catch statement in js, is there a way to catch the error with the catch statement if the error occurs in another file? For example, this:

try {
  myfunc();
}
catch (error) {
  // ...
}```
where myfunc is not inside this file, but another
wheat mesa
#

That should catch it, no?

nocturne grove
#

No it goes through process.on('unhandledRejection'

boreal iron
#

can I actually await a promise in a statment?

wheat mesa
nocturne grove
wheat mesa
#

you could do myfunc().catch(console.error); or something similar

#

If you didn't want to await

boreal iron
#

also return await makes no sense

nocturne grove
boreal iron
#

as you already return the promise

nocturne grove
boreal iron
#

yes it does, but await is useless

#

you need to this

#

return new Promise((resolve, reject) ...

nocturne grove
#

iirc it was necessary, but I'll try to leave it out

boreal iron
#

you have to await the promise (it returns) at the place you're calling your function

#

iirc it was necessary

no, absolutelly not

nocturne grove
#

oh maybe it's needed to say that it's like this:

bot.database = async function(queryContent, interaction) {
    return await new Promise((resolve, reject) => {
          // asynchronous stuff
wheat mesa
#

That doesn't make sense lol

nocturne grove
#

oh no

wheat mesa
#

That's returning Promise<Promise<something>>

#

Wait

nocturne grove
#

wait I'll first try the catch question

wheat mesa
#

Nevermind

boreal iron
#

ok I can await a promise inside a statement

#

my gosh

#

I understand why people are too lazy to test things instead of asking for it

wheat mesa
#

or js eval command

#

but ts playground is much easier imo

boreal iron
#

answering my question would have been less chars for you to write

#

dingus

wheat mesa
#

I didn't see ur question cus I wasn't looking

#

dingus

boreal iron
#

cus I wasn't looking

#

very helpful

wheat mesa
#

😉

#

I was helping the other guy so I unintentionally just skipped over u

boreal iron
#

unintentionally

#

hmm

#

for sure

#

just ignoring me because you can

nocturne grove
#

the await with the catch is working, thanks for that

wheat mesa
#

It... works... I guess? But it certainly doesn't do anything

nocturne grove
#

ok I will remove the await and test

wheat mesa
#

It won't fix anything if anything is wrong with it

#

It just has no effect

nocturne grove
#

don't ask me why I totally intentionally added that two years ago

#

thanks

wheat mesa
boreal iron
#

aye

spark flint
#

duck

#

goose

wheat mesa
#

Anyone know if there's a way to globally export a json file like so? ```ts
export * as Config from './config.json';

#

Nvm found a solution

idle coral
#

I keep getting an error, it's just An error occurred, try again

#

For my getinvite command.

wheat mesa
#

Just saying that this command is very not ok

boreal iron
#

Damn… can’t see it on mobile

wheat mesa
#

It's a command that generates invites to servers without their consent KEKW

boreal iron
#

Would you mind to use sourcebin to let anybody enjoy it?

wheat mesa
wheat mesa
#

Therefore I will not be assisting in the development of it lol

#

Also ngl, why is <Message>.author even a thing when <Message>.user already exists

#

Is there a difference between the two?

idle coral
#

I made it for the purpose of apologizing.

wheat mesa
#

You are generating invites to servers that are not consenting to it. That is a privacy breach. It does not matter what your intentions are.

idle coral
#

My bot's token got accessed, and porn was spam advertised in dms..

idle coral
#

If so, I'll remove it asap

wheat mesa
#

I believe so

#

Not entirely sure

#

Probably a gray area at best

boreal iron
#

I don’t even see a permission check
Must be a bot trying to get admin in its invite I bet freerealestate

lyric mountain
#

1 - mistakenly scratch someone else's car
2 - break into their house while they're sleeping
3 - wake them up and apologise
4 - ???
5 - refuse to elaborate and leave

wheat mesa
#

lol

idle coral
#

that's low key the reality

#

I'll disable it

wheat mesa
#

If you want to apologize, put a link to a pastebin or some sort of blog post site that apologizes for it in your bot's about me

#

That way people can see it without needing you to join their servers

boreal iron
#

Don’t get why people actually need to create those random invites

#

To join a random server… and then?!

wheat mesa
#

If anything they're going to feel like you've violated their privacy even more

eternal osprey
#
SyntaxError: Unexpected end of JSON input```

Why is this error occuring? i am literally validating my json and it looks clear and valid
#

okay new update, js let gangs = fs.readFileSync("./gangs.json", "utf8"); console.log(gangs)shows this in the log:

wheat mesa
#

Use async for file reading

#

Also I hope you're not still using json like this for databases 😭

wheat mesa
#

Is it possible to use a number to index an enum in typescript? Trying to use an enum type with a random variant: ts export enum CardSuit { HEART = 'HEART', DIAMOND = 'DIAMOND', SPADE = 'SPADE', CLUB = 'CLUB', }

#

I suppose this works, feels sad though :C ```ts
Object.values(CardSuit)[Math.floor(Math.random() * 4)]

earnest phoenix
#

help me

proven escarp
#

Ok require dotenv with: require('dotenv').config()

earnest phoenix
#

i already have dotenv

proven escarp
#

and then call the variable with process.env.VARIABLE_NAME

wheat mesa
#

You'll need to add in the variable in the secrets tab of replit by the way

earnest phoenix
#

const require(‘dotenv’).config() ye?

proven escarp
wheat mesa
#

Just require('dotenv').config()

earnest phoenix
#

in the index right?

proven escarp
#

Yes

earnest phoenix
#

alr

proven escarp
#

Wherever you want to use dotenv

earnest phoenix
#

im sorry if im confusing

wheat mesa
#

You should only need to require it once in wherever you're configuring it

#

After that, you can use it anywhere that you can access the process object

proven escarp
wheat mesa
#

Yes

proven escarp
#

didn't know that lmao

wheat mesa
#

If that file can access process, it can use the env variables attached to it

proven escarp
#

nice

wheat mesa
#

dotenv is basically a small package for loading env variables into the process

earnest phoenix
wheat mesa
#

Your config.json is not correctly formatted

#

You probably forgot a " somewhere

earnest phoenix
#

hm

#

nope i don’t

wheat mesa
#

It's invalid, so something is wrong about it

#

Can you show it? Just remove your token

earnest phoenix
#

its pretty simple in here

#

oops

wheat mesa
#
  1. Reset your token because it was transparent
earnest phoenix
#

bruh

wheat mesa
#
  1. You're writing javascript in a json file
earnest phoenix
#

Uh

#

my bad

#

lemme change

#

@wheat mesa sorry dude i just came back

wheat mesa
#

No problem

earnest phoenix
#

now it’s shwoing me the same error

wheat mesa
#

What does your index.js look like

earnest phoenix
#

uh do i send screen?

wheat mesa
#

At your client.login line

earnest phoenix
#

can i send in dm’s dude?

wheat mesa
#

sure I guess

proven escarp
#

weird

earnest phoenix
#

thanks

proven escarp
#

just say what's written at client.login

earnest phoenix
#

im sorry im just scared that someone copies the code

#

i cant find it

proven escarp
#

no one wants to copy code of someone who can't pass a token in process 🤣

earnest phoenix
#

brun it aint funny dude

#

dosen’t mean my bot is trasj

wheat mesa
#

damn u dont gotta do him like that 😔

earnest phoenix
#

last year i worked really hard on it

proven escarp
earnest phoenix
#

i just came back

shell tundra
#

🤣

wheat mesa
#

no worries man 🙂

earnest phoenix
#

it’s actually a pretty good bot when it starts working pandasad

#

@proven escarp

#

im verified too

#

🥺

wheat mesa
#

better than @sharp geyser

meager garnet
#

hello

earnest phoenix
#

who’s misty

meager garnet
#

i have a quick question

wheat mesa
meager garnet
#

Your bot has a command (!play) that sends NSFW content in a non-nsfw channel. Please lock this command to only NSFW channels. If your command uses an API or searches the web please use features such as safe search to filter the content if you wish to have it available in non-nsfw channels.

#

@wheat mesa how can i remove it

#

?

wheat mesa
#

Don't... send NSFW content to non NSFW channels?

meager garnet
#

no

#

when i did !play <nsfw words> and it sent embed with nsfw on it

wheat mesa
#

top.gg requires that all of your NSFW content is sent to channels marked as NSFW

meager garnet
#

how can remove it

#

with a code ?

wheat mesa
#

I don't know how to fix that because you haven't provided any code or any context to what !play even does

meager garnet
#

look my music bot is connected to youtube api and spotify and lava link

#

when i use command play

#

with

#

nsfw world

#

she send a embed and this is not on require to tog.gg

#

so how can i remove it or what i do ?

quartz kindle
#

if channel is not nsfw, send error telling people that command can only be used in nsfw channels

#

channels have a channel.nsfw property to check this

#

or dont show the embed

meager garnet
wheat mesa
#

Do modals have number inputs only? Or do I have to validate it myself still

spark flint
#

im a good dev

#

someone told me to .join it kek

solemn latch
#

Lol

spark flint
#

going through old messages before i delete that channel so thought its worth sharing

wheat mesa
spark flint
#

i would need that rn

wheat mesa
#

Damn

spark flint
#

ngl

wheat mesa
#

That would be nice, guess I'll just validate it myself

wheat mesa
#

so good to know that esm import cache is pretty much impossible to delete

#

I guess no reload command for me

#

I could be brave like this guy but I'm just gonna suck it up instead of potentially destroying my files

lament rock
#

actually

#

I figured out a way to do it without going through the internal esm module cache

#

esm users will rejoice if what I'm thinking works

round cove
#

Is there something wrong with ephemeral messages?
@quartz kindle Is this a d.js-light issue?

#

Despite having true for ephemeral I cannot get any replies to be ephemeral

wheat mesa
#

struggling on how to get the select menu data out of a modal response

#

agh

#

yeah ok I think detritus is just broken for it/outdated

#

or I'm just bad

quartz kindle
round cove
#

No defer and websocket

quartz kindle
#

type 4?

#

can you show your interaction response code?

wheat mesa
#

damn it's a detritus skill issue 😔

lament rock
#

use the raw api

#

day 2 of telling people that

wheat mesa
#

I'm too lazy

#

sounds more chaotic to add on to detritus using raw api than just waiting

quartz kindle
#

once you go raw, you never go back

round cove
#

Pretty basic.

#

Sorry for the late reply, crimping cables.

quartz kindle
#

which version?

#

4.8.1?

round cove
#

Correct.

quartz kindle
#

hmm i dont see anything wrong in the code

sharp geyser
boreal iron
#

smh

#

Options not sorted alphabetical

#

Rating 3/10

rocky hearth
#
const routes: Record<string, number> = {
  blogs: number,
  users: number,
};

type RouteKeys = keyof typeof routes

How do I make RouteKeys of type "blogs" | "users". Right now its, string.
How do I make it better?

#

I do want all the values in routes to be number

pale vessel
#

The problem is you explicitly casted routes as Record<string, number> so it assumed the keys are simply string

#

You should create an interface and use that as the type

rocky hearth
#

@pale vessel I understand that, but now, how can I make sure routes values be always of type number

copper cradle
rustic nova
true solstice
#

how can I enable creating slash commands for my bot?
When I invite him I can't see his commands

sharp geyser
#
  1. Did you make sure you invited the bot with application.commands scope
  2. Are you creating the commands for a specific guild?
bright hornet
#

Idk but these code makes my soul happy:

switch(this.name) {
            case this.name: divorce.div(message, prefix); break;
            default: message.channel.send("Something went wrong.")
        }

more clean area

boreal iron
#

Why don’t use an if else statement when you can use an one-case switch

#

The longer the code gets the better? smirk

rustic nova
#

single statements: switch
multiple statements if else if else if else wesmart

boreal iron
vivid fulcrum
#

is-even ptsd

cinder patio
boreal iron
feral aspen
vivid fulcrum
#

or even better, just invert the if check and place the message send under it

#

you avoid indentation and make it more readable

feral aspen
cinder patio
#

The first case will always be executed

sharp geyser
sudden geyser
#

Nope

#

Switch T with case of T is redundant (and probably doesn't work)

cinder patio
#

it works but the first case will always be ran

#

so the entire switch statement becomes pointless

#

idk if they were joking or not lol

sudden geyser
#

Isn't switch meant to be static

cinder patio
#

not in js

sudden geyser
#

That's interesting

lyric mountain
#

then there's the funny case of ```js
switch (true) {
case a == b == c:
// stuff
break
case a == b:
case a == c:
case b == c:
// stuff
break
default
// stuff
break
}

sudden geyser
#

you're scaring me

lyric mountain
#

that's to check what type of triangle it is, but the fact u can use a switch as a multi-branch if statement in js is hilarious

sudden geyser
#

Given == is just repeated left to right checking, is that still valid for when a = false, b = true, c = false.

#

wait no these are numbers aren't they

lyric mountain
#

ye

#

triangles have three types: equi, iso and scalene

#

one where all sides are equal, one where two sides are equal and one where all sides are different

eternal osprey
#

hey can a setTimeout hold 7 days or would it be too much?

sudden geyser
#

It can, but depends on what you mean by "hold".

eternal osprey
#

the integer can be too big right

#

so it can't fit in the timeout anymore

sudden geyser
#

well the limit is 2147483647, which is about 24 days

#

So it can work, but if your program shuts down before those 7 days are reached, your timeout handler will never execute.

eternal osprey
#

Yup i understand. Thanks clay!

sudden geyser
#

So you'd probably want to persist the timeout if needed

eternal osprey
#

noted 🙂

woeful pike
eternal osprey
#
if (oldMember.premiumSince !== newMember.premiumSince) {```
this is how i can check if someone boosts right? How would i check if a user removes his boost tho?
lyric mountain
#

I forgor 💀

lyric mountain
pine nova
eternal osprey
eternal osprey
earnest phoenix
#

I have forgotten the website that keep’s my bot running how do i find it again?

lyric mountain
#

since discord has the "returned booster" thing now

earnest phoenix
#

someone help me

civic scroll
#

lemme read discordjs docs

lyric mountain
earnest phoenix
#

alr but still help

lyric mountain
#

and please, wait at least 5 minutes before bumping a question

earnest mural
#

how do you forget the very thing that keeps your bot running?

lyric mountain
earnest mural
#

look at your search history bru

earnest phoenix
#

@earnest mural I took a break from coding and it has been 1 year+ so ive almost forgotten everything

lyric mountain
#

in 1 year ANY bot would have long died

#

without any maintenance that is

civic scroll
#

the type is ?Date

#

so it's a nullable

earnest phoenix
#

Mine’s still alive for some reason

#

it’s too good

earnest mural
lyric mountain
#

no it isn't

earnest mural
civic scroll
earnest phoenix
#

btw, how do i find it tho

#

how?

#

I can’t go back to my history from 1 year ago

civic scroll
#

check your browser history

lyric mountain
#

discord has frequent crashes, your bot would've hit cloudflare identify limits if it didn't crash

#

and if it crashed, it wouldn't go back online

earnest phoenix
#

Oh yeah my CPU for some reason skyrockets

earnest mural
#

it just works

#

i never question my spaghetti code

civic scroll
#

then it's not too good is it

lyric mountain
#

commonly used free services: replit, heroku, glitch and oracle cloud

earnest mural
#

thats bad

lyric mountain
#

is it any of those?

earnest phoenix
#

i use repl

lyric mountain
#

then u didn't forget did you?

earnest phoenix
#

why does my cpu skyrocket

#

well i forgot the hosting site

lyric mountain
#

because repl is utter shit

civic scroll
earnest phoenix
#

no it aint

#

nope

civic scroll
#

that can't clean itself

earnest phoenix
#

what’s garbage about my code?

#

It works like a charm

civic scroll
#

cpu skyrockets because of large computation cycle

lyric mountain
#

lemme grab that cow gif again

civic scroll
#

can be caused by piled-up resources

#

without closing

#

either way

#

inefficient

#

therefore conclusion

vivid fulcrum
#

stage 1: denial

earnest phoenix
#

Yeah, but it goes back again and then goes high and then goes low again

civic scroll
#

it reboots

earnest phoenix
#

Oh

vivid fulcrum
#

either that or you can thank the gc

earnest phoenix
#

Ive never had that problem before

#

It’s chill

#

it’s always chill but sometimes it just randomly goes up

lyric mountain
#

repl is a terrible, terrible service if u plan to use it seriously

civic scroll
#

but you found out tthe site that hosts your bot

lyric mountain
#

mostly because u can get CF banned for doing nothing at all

civic scroll
#

problem solved

vivid fulcrum
#

if there is an obvious pattern where your resource usage skyrockets and then lowers (assuming the process stays alive), you probably have unoptimized code and the garbage collector is working to clean it up

civic scroll
#

^

earnest phoenix
#

@lyric mountain ive almost been verified because of repl.it

lyric mountain
#

almost?

civic scroll
#

man

civic scroll
#

stop blaming

earnest phoenix
#

well i got the message

#

from discord about verifying but i didn’t

civic scroll
earnest phoenix
#

because i don’t wanna show my id or pass

lyric mountain
#

that has nothing to do with repl at all

civic scroll
#

so it's whose problem?

#

it's your problem

earnest phoenix
#

Yeah but i took it seriously with repl.it tho

lyric mountain
#

nope

earnest phoenix
#

How didn’t i

lyric mountain
#

75 is child play for any service with more than a rock as a processor

#

it's barely enough to make cloudflare notice u exist

#

also, repl for bot hosting is almost entirely based on how lucky you are with ip-sharers

#

if someone makes too many requests in a short time, welp, too bad you're locked out of discord for an entire day

earnest phoenix
#

too many request for what

lyric mountain
#

to discord api, be it any endpoint

earnest phoenix
#

i can’t use anything else on mobile tho

lyric mountain
earnest phoenix
#

oh yeah

#

lol

lyric mountain
#

so let's say u get 153.251.90.3

#

chances are many others got that same IP

earnest phoenix
#

but i can’t use much since i only have a mobile

civic scroll
#

time to go to an internet cafe

lyric mountain
#

cloudflare doesn't care who's behind the IP, if it makes more than 10k requests per minute that's it, IP banned

#

and their STARTING ban in 1 day

earnest phoenix
#

what can i use then?

civic scroll
#

best option: vps

lyric mountain
#

you can still code in replit, simply upload to a vps after ur done

civic scroll
#

@lyric mountain i wonder if this 11month old code still works

lyric mountain
#

afaik replit can upload to git

earnest phoenix
#

what’s git?

civic scroll
#

version control

lyric mountain
#

the holy grail of programming

earnest phoenix
#

where i can save my codes?

lyric mountain
#

well...kinda

earnest phoenix
lyric mountain
#

imagine if u made a copy of your project and saved it into a compressed file

earnest phoenix
#

I have all that saved

lyric mountain
#
proj_v1.zip
proj_v2.zip
proj_v3.zip
proj_v4.zip
proj_v5.zip
proj_v6.zip
proj_v7.zip
earnest phoenix
#

in a discord server LOL

civic scroll
#

bruh

lyric mountain
#

git manages all that for you

#

but for every single line of code

earnest phoenix
#

Yeah i got every single line

lyric mountain
#

you can literally return some line to what it was 2 years ago

#

without having to download the entire project

earnest phoenix
#

but i dont have much i only have an ipad

lyric mountain
#

there's no "that much"

lyric mountain
civic scroll
#

it will track the entire project for you

#

you can see what's changed throughout versions

lyric mountain
#

git allows managing every single character, everything is manageable and easily undone

#

or re-done, imagine it as time-travelling

civic scroll
lyric mountain
#

you can return to what it was 2 years ago, mix with what was 5 days ago and return to your current proj

#

all of that and the safety of being unable to fuck everything up

civic scroll
#

you can also separate your project into different branches

#

yes

#

oh wait

#

i commited everything to main

lyric mountain
#

lmao

#

but well, I recommend learning about git, it can literally save u one day

#

also it's free

earnest phoenix
#

Alr do i just search git or add a package?

lyric mountain
#

u prob heard about it

earnest phoenix
#

OH github yes

lyric mountain
#

github

#

a hub for gits

earnest phoenix
#

nah i don’t need it

lyric mountain
#

you do, trust me

earnest phoenix
#

ima leave the server bye

civic scroll
#

well

#

a stubborn child we met

earnest phoenix
#

ill come back when i need help or smthing

vivid fulcrum
#

i am witnessing five stages of grief

civic scroll
#

anywho

earnest phoenix
#

@civic scroll bruh i have beard

civic scroll
#

kuu

lyric mountain
#

saving project as files is terrible

civic scroll
#

child

#

kuu

earnest phoenix
#

@lyric mountain alr ill try github

civic scroll
#

does git have project size limit

lyric mountain
#

nope

earnest phoenix
#

thanks for the help

lyric mountain
#

but it does have file limit

earnest phoenix
#

bye

civic scroll
#

wanna know how heavy is prts

lyric mountain
#

I think 100 MB is the maximum file size

civic scroll
lyric mountain
#

lmao

civic scroll
#

mostly game assets and npm

vivid fulcrum
#

still less than node_modules

lyric mountain
#

I have a proj that can easily reach a couple of GBs, and it's still there on github

#

I use gh for image hosting

#

(since imgur has deletion issues (or had))

civic scroll
#

i sê

lyric mountain
#

as it seems, 100GB

civic scroll
#

oh

#

i can upload entire division game

lyric mountain
#

although u can technically just create another repo

lyric mountain
#

we do insignificant amounts of tomfoolery

ancient nova
#

so nobody executed any command when this happened (error handler and command handler are in different files so error couldn't happen instead of cmd exec log)

#

any ideas?

raw nest
#

How would I build my own UI Kit library?
Like code all the components and then put'em in an NPM packages like aqua-components or something? Won't this get too big in file size after a few hundred components?

lyric mountain
#

well, UI libs are big for a reason

lyric mountain
ancient nova
# lyric mountain you're trying to send an embed with empty value
                ghostPingLog.setTitle("Moderation Logs (Action: Ghost Ping)");
                ghostPingLog.setColor(commandColor);
                ghostPingLog.addField("Message Content", message.content.slice(0, 512));
                ghostPingLog.addField("Message Author", message.author.tag);
                ghostPingLog.addField("Members", members.size.toString(), true);
                ghostPingLog.addField("Roles", roles.size.toString(), true);
                ghostPingLog.addField("Everyone", toProperCase(everyone.toString()), true);
``` everything seems filled up
#

perhaps I don't have enough permissions to grab some value?

lyric mountain
#

message.content.slice(0, 512)

#

bold of you to assume message has content

ancient nova
#

OHHH

#

IF IT'S AN EMBED

lyric mountain
#

^ no content

ancient nova
#

yeaaaaa

lyric mountain
#

also embeds, but users can't

ancient nova
#

ye ye

raw nest
ancient nova
#
ghostPingLog.addField("Message Content", message.content.slice(0, 512) || "No Message");
``` is this gonna do the trick?
lyric mountain
#

it's an attachment

ancient nova
raw nest
#

aight

ancient nova
lyric mountain
#

that should do it

ancient nova
#

okay cool

raw nest
#

Is there a way to get infos to my npm package, like how many different people downloaded it?

lyric mountain
#

u can scrap npm site

raw nest
#

but not how many different people downloaded it

sudden geyser
#

Can you define "different"?

#

If you mean unique, I don't believe so.

#

Even the download count npm displays isn't a good way of determining popularity due to dependency reliance and bots automatically downloading packages.

sick agate
#

yup

lyric mountain
#

but for obvious reasons, that's technically illegal and sends a "fuck" to the user's anonymity

sudden geyser
#

how to end your open source career in 5 minutes (guaranteed)

lyric mountain
#

exactly lmao

raw nest
meager garnet
#

hello everybody

#

i have a question

#

how do i make my command doesn't work in a nsfw channel if is an nsfw channel

lyric mountain
#

the opposite u mean right?

#

there's a channel property <channel>.nsfw u can use to check if a channel is nsfw or not

ancient nova
#

can anyone help me solidify a game idea?

#

I know what I wanna make, but I'm just trying to make it all go well together

lyric mountain
#

what kind of help?

ancient nova
#

so I'm making a game but I can't seem to come up with a coherent story

#

would you be able to help?

lyric mountain
#

nope, I'm terrible at storytelling

ancient nova
lyric mountain
#

is it sci-fi?

#

if so u can try playng rimworld to get some ideas

#

it has a pretty...unique story generator (basically AI that generates events based on context)

ancient nova
#

it's a spongebob squarepants themed horror game. And before you say anything, I've already seen some explamples on how scary that can be so I really wanna give it a try myself too

#

I have a basic idea for my story but I need to patch it up. (eg. what happens when the user first presses play, cutscene/straight into the game?)

#

I'm stuck on these things since I didn't usually have to come up with the story by myself I mostly just done the coding and asset making : P

lyric mountain
#

it's a spongebob squarepants themed horror game
please don't give young people another creepypasta game

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.

lyric mountain
#

every year there's at least 2 or 3 that become the year's creepypasta topic (baldi, granny, hello neighbor, slender, fnaf, etc)

quartz kindle
#

fiath punto

lyric mountain
#

fiath uno 2020 1.0 48L

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

lalafell

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

yes what?

quartz kindle
#

yes

sage bobcat
ancient nova
#

hold up..

quartz kindle
sage bobcat
#

One message removed from a suspended account.

ancient nova
#
every character goes mad insane and scary looking
spongebob will jumpscare you when u try leaving
you will wake up in the basement and you will have to escape```
lyric mountain
ancient nova
#

but it's not good enough, I need to make it somewhat coherent

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

ancient nova
#

like I need to set the gameplay plan

#

what will happen at the begining what happens after you steal the formula

#

etc.

lyric mountain
sage bobcat
#

One message removed from a suspended account.

sage bobcat
#

One message removed from a suspended account.

ancient nova
sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

I though u would compare to the other games

ancient nova
#

one you steal the formula you will be tasked with leaving the krusty krab and before you do spongebob would jumpscare you and you would wake up in the basement and you would have to escape it

sage bobcat
ancient nova
#

yes

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.

ancient nova
#

I just need a way to tell the player what's going on, story is the best way of going about it I think..

lyric mountain
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

or dont, people will make a lore for it anyway

sage bobcat
#

One message removed from a suspended account.

ancient nova
sage bobcat
#

One message removed from a suspended account.

lyric mountain
ancient nova
#

that's why I need to make it good

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

I like to think that games do really well when they're released as a finished product

ancient nova
#

don't have the will to finish it

wheat mesa
#

Like stardew valley for example, the dev never put it into open beta and it took him 4 years to release it

#

But when it was released, it was a polished and finished game, and was a massive hit

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

ancient nova
#

ouch I just bit my lip

sage bobcat
#

One message removed from a suspended account.

ancient nova
#

okay okay

sage bobcat
#

One message removed from a suspended account.

lyric mountain
sage bobcat
#

One message removed from a suspended account.

ancient nova
#

so what do you think should happen when the player first presses play? cutscene, text, anything at all?

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.

ancient nova
#

okay that could give you some idea on the story, I was thinking of an animation

sage bobcat
#

One message removed from a suspended account.

ancient nova
#

it would start at the top of the chum bucket and slowly pan towards the enterance where it would show planknton leaving before you would go to first person view

#

I would need some sort of system though

#

maybe a checkpoint system

#

to just tell you what you need to do

#

cause you won't know where to go initially

lyric mountain
#

such types of game don't have checkpoints

ancient nova
#

unless I tell you Objective: break into krusty krab

lyric mountain
#

the whole horror is in having your run cut short due to mistakes

#

also remember overusage of jumpscares makes the game less scary

ancient nova
#

my game won't have any jumpscares for the first ~10m of the gameplay, mainly noises and stuff falling yk the general stuff

#

the first jumpscare will be from spongebob when u try leaving the krusty krab after stealing the formula

earnest phoenix
#

This whole thing reminds me of Mr. Krabs on Ketamine game

ancient nova
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

You're my ketamine

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

ancient nova
#

KEKW oou

#

okay I'm gonna go try to create everything that's been said here into 1 huge idea

#

brb

ancient nova
#

since I'm using HDRP should I make it hella realistic?

#

or cartoonish?

sick agate
#

cartoonish

lyric mountain
#

never try to make a cartoon realistic, 99% the times it end in disaster

#

just remember sanic

sudden geyser
#

but when you make it cartoony you go bankrupt

ancient nova
#

maybe realistic cartoonish?

#

I'm gonna have to somehow use it either way since I already made it a HDRP project

sick agate
#

no no no no

ancient nova
#

so are you telling me to go back to SP?

#

by realistic cartoonish I mean models are cartoonish but the overall feel would be realistic

lyric mountain
#

then u get the legendary vrchat plankton

ancient nova
#

idk in what route I should go

sick agate
#

lol

lyric mountain
#

u could try cel shading

wheat mesa
#

damn apparently something I made got a decent amount of downloads

#

literally just like 200 lines of js for a minecraft chattriggers module lmao

lyric mountain
#

make a mod that "increased diamond find chance", but make it do nothing at all

wheat mesa
#

lmao

#

that's genius

lyric mountain
#

Placebo effect will make people feel like it indeed increased

lament rock
#

no require.resolve in esm is a bitch

#

Trying to make hot reloadable esm modules

sudden geyser
#

Suffer.

earnest phoenix
slim heart
#

need me some regex help

#

im trying to turn /hello/{world/abc/def}/hi => ['hello, '{world/abc/def}', 'hi']

#

so obviously .split(/) wont work

sudden geyser
#

\/?

slim heart
#

the issue is its splitting up the {world/abc/def} because it has /'s

sudden geyser
#

Are you trying to match one of the three or the actual text {world/abc/def}

lament rock
slim heart
#

i want to use .split to generate the array i showed above

sudden geyser
#

Oh now I see

lament rock
#

I think what you'd want is negative lookahead

slim heart
#

i tried the negative lookahead for the {.+} but that wont work because it'll just ignore the one before it as far asi can tell

#

im open for suggestions, im usually really good with regex but im stumped

lament rock
#

.+ matches any char and shouldn't be used

slim heart
#

i said it as an example

lament rock
#

You can use a [^…] array to define characters that shouldn't be matched. For example, {

#

in conjunction with negative lookahead that is

slim heart
#

nevermind figured it out

#

you dont have to lecture people on how to use shit they're obviously already using btw it just makes you look rude

lament rock
#

My sincere apologies. I am trying to help and provide suggestions - that is my pov. I don't know your skill level, so now I know and will keep that in mind. Not exactly with a lot of free time myself as I am omw to work so

#

I have my own worries like how tf am I gonna hot reload esm modules

#

@earnest phoenix do you know when the module resolver will reach release

#

because I might just write my own with fs promises

earnest phoenix
lament rock
#

oh ok. Not a problem. Thanks for the suggestion anyways

lyric mountain
#

ok, math time:
how can I multiply where the higher the multiplier goes, the lower its influence gets?

#

like

1 = 100%
2 = 50%
3 = 25%
4 = 12.5%
...
wheat mesa
#

Exponential decay?

lyric mountain
#

idk, graph to help understand

wheat mesa
#

nth term = starting * (multiplier) ^n-1

lyric mountain
#

black is the desired curve

#

well, yeah

#

now just need to figure out how to flip it

#

ah nvm

wheat mesa
#

my math knowledge finally coming in handy

lyric mountain
#

yep, ty

wheat mesa
#

C: np

proven lantern
#

could log n work?

#

oh wait, nm

spark flint
#

evalling doing js (async () => { const m = await message.guild.members.fetch(); const minutes = 4320 // 3 days const now = Date.now() const channel = await client.channels.cache.get("898980424544550912"); const p = m.filter(x => (now - x.user.createdTimestamp) < 1000 * minutes * minutes ).map(async (x) => { await message.guild.bans.create(x.user, { reason: `[AUTOMOD] Anti-raid mode` }) await channel.send(`Banned **${x.user.username}#${x.discriminator}** - Account created <t:${Math.round(x.user.createdAt/1000)}:R>`) }) Promise.all(p) })() started banning people over 3 days old

#

some 7 month old account kek

#

how can I make that only ban people whos accounts are under 3 days old

#

its because we got raided and every account is 2 days and under

proven lantern
spark flint
#

i think so

proven lantern
#

the function passed to map shouldn't be async. create an array of pending promises and then Promise.all that

wheat mesa
#

#RatelimitCity

spark flint
#

theres over 1k raid accounts to ban

#

because the owner doesn't like us using raid prevention "incase it false bans"

wheat mesa
#

I suppose it's not a big deal since djs handles ratelimits for you

#

3 * 24 * 60 * 60 * 1e3 would be 3 days in ms btw

proven lantern
#
await Promise.all(
    m.filter(x => (now - x.user.createdTimestamp) < 1000 * minutes).reduce((acc, member) => [
        ...acc,
        message.guild.bans.create(member.user, {reason: `[AUTOMOD] Anti-raid mode`}),
        channel.send(`Banned **${x.user.username}#${x.discriminator}** - Account created <t:${Math.round(x.user.createdAt / 1000)}:R>`)
    ], [])
)```
#

like this'

spark flint
#

ah

proven lantern
#

cant use map because it's a one to many mapping

#

or wait

#

maybe it is possible

sterile lantern
#

this keeps crashing my bot - how do i prevent these type of errors?

Current code:

var logo1 = await fetch(`https://thumbnails.roblox.com/v1/groups/icons?groupIds=${GROUP_ID}&size=150x150&format=Png&isCircular=false`)
if(logo1.status == 200) {
   var logoa = await logo1.json()
   var logo = logoa?.data[0]?.imageUrl
}
if(!logo) return;
    var response = await fetch(`https://groups.roblox.com/v1/groups/${GROUP_ID}/`)
    if(response.status == 200) {
      var responsea = await response.json()
      var response_count = parseInt(responsea.memberCount)
    }
    if(!response_count) return;```
boreal iron
#

By catching your promises

spark flint
#

its working

#

all accounts used in a raid today

eternal osprey
#

i made 1 fucking account 3 days ago

#

how is this still being rate limited

sterile lantern
wheat mesa
spark flint
#

lmao

#

well it also checks for no pfp

#

which all raidrs had no pfp and were created within the last 3 days

wheat mesa
sterile lantern
#

kk

#

thanks

wheat mesa
#

But beware that your program will crash if you do not await a promise within the block

#

(And it rejects)

spark flint
#

should return tru

#

on an alt i just joined the server with

proven lantern
spark flint
#

im stupid

#

its joinedTimestamp and idid it wrong

wheat mesa
#

might not be cached if you don't have the GUILD_MEMBERS intent

#

but nvm cus it would've thrown if it wasn't cached

lyric mountain
#

Like, 1 elevated to 3 is 1

wheat mesa
#

1e3 in scientific notation

#

1 * 10^3

lyric mountain
#

Ain't it 1 * 10e3?

#

Never saw e directly to the number

wheat mesa
#

It's not

lyric mountain
#

weird

boreal iron
#

Indeed

#

2.5e+5 instead of 25e+4 triggers me

#

But I get why it is like that

#

But still

wheat mesa
#

1-10 only allowed for it

boreal iron
#

Yeah ik as I said but it triggers me

#

Imagine 25,000e+1

sterile lantern
#

is there a way to check what a user does on the database (e.g: delete a document, update a document) for mongodb? i cant seem to find any sort of logs

spark flint
#

banning a raid

ancient nova
spark flint
#

it was me purge banning with an eval

ancient nova
#

that is a lot of people tho

zinc pecan
#

I can't vote do you know why?

#

no, when I want to log in to vote it tells me that the account is incorrect, I tried many times and it does not let me

#

won't let me vote

#

👍

wheat mesa
#

Are select menus fully supported in modals yet?

proven escarp
#

anyone knows how i could do this?

#

in my react ts website i want to have a "highlight" pre-defined component that basically just changes the color of the text to pastel-green (custom tailwind color)
i want it to look like that:
````<Highlight>Here should be the highlighted text<Hightlight />and not that:<Highlight content={"Here should be the highlighted text"} />```
how could i do that with react and typescript?

vivid fulcrum
#

accept a prop that's named children

#

then use it in your highlit component as a regular child

#

highlight*

proven escarp
#

ignore the squiggly line

proven escarp
boreal iron
#

Modals already have select menus?

wheat mesa
#

I got them in my modal, I just haven't been able to get the value from it

boreal iron
#

Thought there’s only the text field and textarea

wheat mesa
#

Not sure if it's a lib support issue or if they're not supported yet

boreal iron
#

I usually use the properties raw methods to get the options

wheat mesa
#

They don't look very good yet, but that's why I'm thinking maybe they're not fully supported yet

boreal iron
#

The modal submit object has an options property or was it called fields?!

wheat mesa
#

It's called fields

#

But not for detritus

#

I've used the debugger for it, I can't really seem to find anything that has the value for the select menu

boreal iron
#

Can’t u get the raw api object in detritus?

wheat mesa
#

No idea

boreal iron
#

It should contain all fields

#

(maybe)

wheat mesa
#

I'll check the source

boreal iron
#

Hehe people bitching about djs

wheat mesa
#

It does seem to have the Interaction object, let me debug more

boreal iron
#

I mean djs transforms the raw api response into its own structure where for example the options are stored in an option resolver class