#development

1 messages Ā· Page 140 of 1

earnest phoenix
#

That's not how you put the slash-commands in separate files...

prisma nebula
#
const { REST } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v9'); const { token, clientId, guildId } = require('./config.json'); const commands = [   require('./commands/addadmin'),     const rest = new REST({ version: '9' }).setToken(token);  (async () => {   try {     console.log('Started refreshing application (/) commands.');      await rest.put(       Routes.applicationGuildCommands(clientId, guildId),       { body: commands },     );      console.log('Successfully reloaded application (/) commands.');   } catch (error) {     console.error(error);   } })();
earnest phoenix
#

You didn't follow the guide it seems

prisma nebula
#

How they paced

#

New xonst

#

Etc

earnest phoenix
prisma nebula
#

And I added my codes

prisma nebula
#

And their is no error

lyric mountain
#

then there's an error

#

it wont prevent you from running, javascript will simply ignore it

earnest phoenix
#

Read carefully

prisma nebula
deft wolf
#

No error Clueless

lyric mountain
prisma nebula
#

Eh

lyric mountain
#

javascript barely has anything that prevents running

earnest phoenix
#

JavaScript won't ignore syntax errors, they're probably not sending the actual code they're running

prisma nebula
#

I did same as the tutorial but ig I placed them wrongly because my codes are diff

prisma nebula
earnest phoenix
prisma nebula
#

Is this the main problem?

#

( please say yes )

earnest phoenix
#

You didn't structure the slash-command file correctly, read the guide

#

Though you should fix that syntax error first

prisma nebula
#

I'll fix the syntax error first

#

Anyone know the issue with it or I need to recode

earnest phoenix
#

And I don't think you're even running the file that contains the slash-command deployment code

prisma nebula
#

Wtf

lyric mountain
#

recode what? the syntax error?

prisma nebula
#

No

#

The whole page

#

It is so messi their lol

lyric mountain
#

replit has an auto-format button afaik

prisma nebula
#

What should I fix uh

#

Nothing showing wheir the error is

lyric mountain
#

it was supposed to show, but I don't use replit so idk if it even highlights errors

prisma nebula
#

In my page nothing at all

#

Ouf

lyric mountain
#

also as I said, don't put your token on config.json

#

that file is visible to anyone visiting ur repl

prisma nebula
#

I know I'll fix that later now I have tons of issues

lyric mountain
#

surely hope you didn't give admin to your bot then

prisma nebula
#

Yesdw

#

Also even if he have admin he can't raid my server

lyric mountain
#

they can, your token is exposed

prisma nebula
#

I have higher security bots he will get banned if he ban or kick or delete 2 channel in a short period

lyric mountain
#

they can also use the bot to nuke the server

lyric mountain
prisma nebula
#

Yes they will use my bot my bot can't do anything

lyric mountain
#

if it has admin, they can

prisma nebula
#

The botnwill directly lose his role and get quarintined if he mess with something

#

They can mass join new bots

#

OR ban or kick

spark flint
#

does not matter

#

if any user adds your bot

#

and someone gets your token

#

they can nuke ANY server your bot is in

prisma nebula
#

Is in 1 server without admin perms

lyric mountain
#

(and has admin)

prisma nebula
#

Is this mine

spark flint
#

yes

prisma nebula
#

Lol

#

From wheir u did enter

spark flint
#

since I know people have replit scanners i am going to force revoke the token and you should use .env instead

spark flint
#

BUT you can use env variables which hide your secrets like tokens

lyric mountain
#

.env works for replit secrets?

spark flint
#

yes

#

well they have built in .env

#

@prisma nebula you should have a DM from Discord

lyric mountain
#

ah, so it's pre-installed

spark flint
#

yeye

#

i revoked their token in case anyone tries to nuke

prisma nebula
#

How did u get my repl

#

Name

spark flint
#

you sent a screenshot before

#

which showed the project name

prisma nebula
#

Oh now u can just fix my codes I don't mindKEKW

lyric mountain
#

it's fun that u can force-revoke tokens by posting either on github or discord

spark flint
#

i made this mistake once and a server i was mod for got nuked, so i am looking out for people who make mistakes like that

prisma nebula
#

I'll reset it and add it in secret.env

earnest phoenix
#

Imagine using Replit anyway, use a VPS troll

spark flint
#

or a tool like mine that automates the github part

#

:p

#

does not break TOS either

#

just revokes the token using Github

prisma nebula
#

Discord did dm me they are banning the user who got access

spark flint
prisma nebula
#

Jk

spark flint
#

i know what the Discord DM looks like

lyric mountain
spark flint
#

yes

#

thats how this works

prisma nebula
#

Ian stressed doing a 5 command bot taking me my life

prisma nebula
#

What is this

spark flint
#

i do this to all tokens I find on replit just to make people aware, and I leave info in the readme.md on how to secure your bot/account

spark flint
lyric mountain
#

I once had an idea about making an anti-invasion layer for my bot (registering which messages I send), but didn't know how to reliably revoke the token

spark flint
lyric mountain
#

basically if my bot sent any message that didn't come from my code it'd kill the token

spark flint
#

yeah

#

fair enough

#

anyways @prisma nebula

#

wrong link

#

please follow this guide

prisma nebula
#

Is it possible in the config.json to write something that eill link token to env?

spark flint
#

it will stop your bot from being insecure

#

no

#

just update your code

prisma nebula
#

I updated my code over 40 times today

spark flint
#

bruh you did config.json and you do not even use it

#

😭

prisma nebula
#

That's stressing me fffffffffffffffffffffffff

spark flint
#

you do client.login("TOKEN")

prisma nebula
#

I use it but

rustic nova
prisma nebula
#

I forgot to remove this lone

#

Line

#

From index

#

It is used in the deplay

spark flint
#

replace the following ```js
client.login('YOUR TOKEN');


with the following ```js
client.login(process.env.token)```
prisma nebula
#

Deploy*

spark flint
#

and put the token in the .env part

prisma nebula
#

But the deploy also need config.json

spark flint
#

then change .setToken(token) to .setToken(process.env.token)

prisma nebula
#

😫

#

Ok wait

lyric mountain
#

pass the client to it through params

#

creating a new rest will make the bot login again

tulip ledge
#

is there a way to turn the keys of a json object to an array without using a for loop?

lyric mountain
#

Object.keys()

tulip ledge
#

ah that was the method I was looking for

prisma nebula
#

Ok fixed

#

@spark flint is it possible for u to track error s and show me wheir my website isn't highliting

spark flint
#

No

#

Since i can’t edit repls I don’t own

prisma nebula
#

They don't show u

#

Red Lines

#

?

#

Now it say my token is invalid

#

F

lyric mountain
#

for how to enable error highlighting

lyric mountain
#

as bun revoked it

prisma nebula
#

Revoked?

#

How he did that

prisma nebula
#

So he revoke public tokens by posting them in github?

lyric mountain
#

yes

#

also works if u post the token in a big server

prisma nebula
#

@spark flint is a hero lol

#

I remember this moment lol

spark flint
#

Because if someone sends a token here by accident it’s better to revoke it lol

rustic nova
#

Unless it's happening very frequently, don't see this happening anytime soon

#

The reason they have it as it might be more common due to the nature of what the pycord server is for

spark flint
#

Ah ok

#

That’s understandable

frosty gale
#

yes leak your identity to discord or no bot for you

#

i dont know if any other platform does this

lyric mountain
#

They REALLY don't want to get your ID

#

The only who handles it is stripe, which is pretty much a bank already, and they're heavily audited for potential data leaks

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

watch people use it to spam ads

#

:^)

#

pretty cool tho

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

nah leave it up to people's free will

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

spark flint
#

@prisma nebula šŸ™ ty for using .env

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

ever entered into one of those omegle secret chat rooms?

sage bobcat
#

One message removed from a suspended account.

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

ive been there many times

#

its chaos lmao, but there is a moderator that bans people

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

i'd let them do it, but then again my humor is kinda dark

#

:^)

sage bobcat
#

One message removed from a suspended account.

sage bobcat
quartz kindle
#

lmao

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

oh nice, like a soft block

sage bobcat
#

One message removed from a suspended account.

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.

#

One message removed from a suspended account.

quartz kindle
#

do you know how to use the discord api without discordjs? for example fetching something or posting something to the api

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

either way is already is already something more than using just discordjs

compact pier
#

I saw someone made a bot with cloudflare worker

#

kinda suprised

quartz kindle
#

but most typical non-js methods are using fetch because its a browser standard, and using http because its a nodejs standard

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

fun fact, i learned a massive amount of js from using djs

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.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

i use it for apis and services in general

#

as well as scripting

#

because its easy to use and fast to develop with

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

well, not very light weight in terms of resource usage exdee

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

python is on a similar level with js, but in recent years js evolved a lot faster than py did

#

py got kinda stagnant and from what i hear it suffers from performance issues

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

neon leaf
#

also known as microsoft java#

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.

neon leaf
sage bobcat
#

One message removed from a suspended account.

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
sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

lmao

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

a websocket is a persistent connection for sending messages back and forth

#

discord uses it

#

djs uses it to connect with discord

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
#

u could use websocket for posting too, but that's fine

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.

quartz kindle
#

i mean, thats what discord does

#

rest api for posting

#

websocket for receiving changes

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

a typical website has between 500kb and 2mb page size, including js and css, fonts, icons

#

could be 5+mb if it includes pictures

#

if you wanna save videos, be prepared for using hundreds of gb lol

lyric mountain
#

actually didn't youtube reach pb in the last years?

neon leaf
#

way more than pb

quartz kindle
#

you said you didnt want to save every single website

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
#

off to hb I guess

sage bobcat
neon leaf
sage bobcat
#

One message removed from a suspended account.

lyric mountain
sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

doesnt youtube also copy videos to edge servers?

#

plsu redundancy and what not

lyric mountain
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

also natural sea warming

#

:^)

lyric mountain
#

google has one of those pills too

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

ms appeared on the news cuz it resurfaced

quartz kindle
#

:^)

lyric mountain
#

lmao

#

at that point just move another pill in place

#

they flot

quartz kindle
#

my name is max, its 2040, i work as a diving engineer, i replace parts in underwater servers

lyric mountain
#

wait until they set servers on the moon

quartz kindle
#

edge servers on the moon

#

to get low latency youtube

#

:^)

#

actually the earth moon latency is not that bad

#

1.3 seconds of light time, could setup sat to sat directional laser connection

#

earth mars latency howerver.... forget it

lyric mountain
#

they already have a laser connection to the moon technically

#

they use the retroreflectors for measuring moon drift

quartz kindle
#

light time from earth to mars is between 4 minutes and 20 minutes lmao

#

imagine using the internet with 10 minutes lag

#

imagine tcp with 10 minutes lag

lyric mountain
#

then for a few months you get no connection at all

#

cuz the fatass sun is blocking the way

quartz kindle
#

use a proxy sat somewhere in between

#

place it at L4 or L5

#

image 500 years from now the solar system being full of nodes and relays

#

only really useful for emails tho

#

:^)

lyric mountain
#

I never really understood how L2 works

#

like, both the sun and earth are pulling towards earth

quartz kindle
lyric mountain
#

L3, L4 and L5 are all in orbit, so it makes sense, and L1 is being tugged

#

ah, so L2 is in orbit too

quartz kindle
#

L2 is pulled by earth and pushed by centrifugal force

#

The L2 point lies on the line through the two large masses beyond the smaller of the two. Here, the combined gravitational forces of the two large masses balance the centrifugal effect on a body at L2. On the opposite side of Earth from the Sun, the orbital period of an object would normally be greater than Earth's. The extra pull of Earth's gravity decreases the object's orbital period, and at the L2 point, that orbital period becomes equal to Earth's.

proven lantern
quartz kindle
#

no idea how thats gonna work

#

if it even is gonna work

#

quantum teleportation would be game changing

proven lantern
#

We just need to digitize our consciousness and then we can upload it to a robot across the galaxy. Ezpz

lyric mountain
#

literally pass-by-reference

quartz kindle
#

the year is 2500, i just bough a new quantum ram stick for my pc, hopefully this time it wont get hacked and have its entire memory replaced with porn

deft wolf
#

</comandName:commandId>

#

You mean something like this?

#

You are supposed to click it to jump to message

#

Yea

hushed robin
#

how can I save my authorization on git

#

so everything I wanna git pull I don’t need to type in my username and password

civic scroll
#

you can use a headless browser and capture all downloaded assets

#

scan for all links that navigate within said page

#

by looking for as

earnest phoenix
#

And once you enter your username and access token, it'll be saved

#

Note that Git's credential store helper literally saves your access token in plain text without any encryption so be careful

hushed robin
#

why do i need to do allat

earnest phoenix
#

I encrypted it myself using GnuPG (GPG) and utilized Git's NetRC script (git-credential-netrc) to parse and decrypt it

wheat mesa
#

Too much work for battleless

earnest phoenix
#

Since my GitHub account has direct access to large and important projects, I gotta be careful, but you should be careful as well

hushed robin
#

why can't something simplier work

lyric mountain
#

that is as simple as it gets

hushed robin
#

git login
gives me link to login with github
saves my username and password once logged in
then i no longer need to give them my password everytime

lyric mountain
#

...did u even try what volt said?

#

because what u described is actually less simple than it is

#

also, remember that

hushed robin
#

no it's not

lyric mountain
#

git is not github

hushed robin
#

bruh

#

whats the difference

prisma nebula
#

omg

lyric mountain
#

car vs carpet

wheat mesa
#

Ham vs hamster

hushed robin
#

whos the carpet

lyric mountain
#

github

hushed robin
#

bru

rustic nova
#

Brain hurt

lyric mountain
#

github is a platform and repository for git projects

rustic nova
#

git is a versioning tool

#

version control*

lyric mountain
#

besides, you'd actually be able to do what u said if u used the VCS integration in vscode

hushed robin
#

i use github desktop

lyric mountain
#

remind me, why do u use it if u edit the code with vscode?

earnest phoenix
#

Git is the version control system tool that allows you to create branches, edit across them, commit, rewrite history, and whatnot

GitHub is a repository host for projects that is completely compatible with Git, but it's not the only one, there's GitLab, BitBucket, and more

hushed robin
sage bobcat
lyric mountain
#

how is it simpler?

#

ur using 2 programs when u could use only 1

wheat mesa
quartz kindle
#

i use github desktop too

#

better UI and UX than vsc

lyric mountain
#

is vscode integration that bad? KEKW

quartz kindle
#

i also like to keep those two tasks separated

earnest phoenix
#

Imagine not using Git via command line :^)

hushed robin
civic scroll
#

but do you know what you are doing

quartz kindle
lyric mountain
#

guess I'm too used to intellij then

#

(sidebar)

wheat mesa
#

Intellij is pretty nice when it comes to git integration

prisma nebula
#

Slash command can't be made just from 1 sheet of codes?

prisma nebula
#

I mean without many files and folders

earnest phoenix
lyric mountain
#

how long is 1 sheet of code?

hushed robin
#

i mean it can

lyric mountain
#

is it A4 or postcard?

prisma nebula
#

And why do I have to create handlers etc

hushed robin
#

u don't need to

#

but it'll make your code easier to use and manage

civic scroll
# hushed robin whats the difference

github is a service, pretty much like gitlab, bitbucket, ect.
and git is a tool you use to access them
you can even make your own version control system hosted on your machine (companies do that for their internal code)

civic scroll
lyric mountain
wheat mesa
#

It’s kind of similar

prisma nebula
civic scroll
#

no VCS in CSP :(

wheat mesa
#

It’s not the greatest UX known to man but it’s good enough

prisma nebula
#

Just 1 file

lyric mountain
civic scroll
#

i suggest splitting it out

#

separated command modules and a module registerer

prisma nebula
#

Odk what ti do with my bot rn iam unable to fix

wheat mesa
#

1 file might seem simpler as of right now, but as your project grows, multiple files make your life easier

prisma nebula
#

Idk wheir the issues are

civic scroll
#

huh

#

when why do you know they have issues

#

sus

rustic nova
#

Witchcraft

earnest phoenix
#

Bro we told you what the issues are

lyric mountain
#

how many issues did u get since yesterday?

prisma nebula
#

Repl isn't showing wheir error os and bot working normally but the slash commands aren't showing

civic scroll
#

anyway if there was a runtime error, send the stack

hushed robin
#

bro

prisma nebula
lyric mountain
hushed robin
#

are you registering the commands?

#

they won't just appear on discord

prisma nebula
#

Ok

hushed robin
#

they're not like message commands

lyric mountain
#

lalushi, did u make any change since the last time volt helped u with the slashes?

prisma nebula
#
const { REST } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v9'); const { token, clientId, guildId } = require('./config.json'); const commands = [   require('./commands/addadmin'), 
                                                                                                                                                                                  const rest = new REST({ version: '9' }).setToken(process.env.token);  (async () => {   try {     console.log('Started refreshing application (/) commands.');      await rest.put(       Routes.applicationGuildCommands(clientId, guildId),       { body: commands },     );      console.log('Successfully reloaded application (/) commands.');   } catch (error) {     console.error(error);   } })();
lyric mountain
#

no, ffs u didn't

spark flint
#

please do not format that code like that

earnest phoenix
#

You didn't change anything šŸ’€

hushed robin
#

this is worse than me

prisma nebula
#

Idk wheir

#

It doesnt showwww

lyric mountain
#

enable the highlighting as I said

prisma nebula
#

Wheir exactly

prisma nebula
hushed robin
#

i think you mean where

#

not wheir

rustic nova
#

KuuHaKu just alt f4 discord, escape

prisma nebula
#

Ok done

#

It highlited const

lyric mountain
prisma nebula
earnest phoenix
lyric mountain
#

it IS showing an error

#

the red squiggle is exactly an error

sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

and it's there because of this

prisma nebula
#

?

lyric mountain
#

see anything missing there?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

hm?

#

u mean the returning message issue or lalu's

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
#

this isn't even the only issue

civic scroll
sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

they likely meant to make an array with requires

civic scroll
#

@earnest phoenix moyai_amogus

#

gotta love old codes

prisma nebula
#

Now the error has changed to this

proven lantern
#

if i have a color how can i programmatically find a color that has good contrast to that color? some hex math?

prisma nebula
#

Under ;

lyric mountain
#

no lalu, this is not the issue

#

ur ignoring what I said lalu

prisma nebula
#

Wheir

lyric mountain
sage bobcat
civic scroll
#

and do you know what a statement is

sage bobcat
lyric mountain
#

everytime u open a door, u close it

prisma nebula
#

My pc is broken

lyric mountain
#

if u open the fridge, u close it

proven lantern
#

revolving doors too

lyric mountain
#

if u open a {, u close a }

hushed robin
#

@proven lantern

lyric mountain
#

and if u open a [...?

hushed robin
#

can i unblock u withhout u harassing me

lyric mountain
hushed robin
#

i think he can figure out what u mean

civic scroll
#
const commands = [ require('./commands/addadmin'),
                 ^                               ^
//               Syntax error occured here (unterminated array)
// Hint: Remove them
lyric mountain
#

e0c, shut

hushed robin
#

no

#

stop calling me e0c

#

my name is battleless

lyric mountain
#

ok e0c

hushed robin
#

stop

sage bobcat
#

One message removed from a suspended account.

civic scroll
hushed robin
#

not me

#

idk why he's calling me that

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
hushed robin
#

3 letter username

sage bobcat
hushed robin
#

but my real name is battleless

lyric mountain
#

u want the 3-char username, you'll use the 3-char username

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

hushed robin
#

😐

proven lantern
civic scroll
#

you mean he should clone me

sage bobcat
#

One message removed from a suspended account.

civic scroll
#

Faithe

sage bobcat
#

One message removed from a suspended account.

civic scroll
#

i'm half-decent

lyric mountain
earnest phoenix
civic scroll
#

but go ahead and ask

sage bobcat
proven lantern
#

those stay open

prisma nebula
#

Fixed

civic scroll
#

i couldn't parse the query

wheat mesa
#

I want to write SQL/make a project to learn proper SQL in Java, anyone have recommendations

civic scroll
#

ah

wheat mesa
#

No more baby ORMs for me

civic scroll
#

so the UI repeats deleted messages?

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
civic scroll
#

it has to do with mechanism of your message render list

prisma nebula
#

Ok fixed the request thing

civic scroll
#

what framework / library is it in

civic scroll
prisma nebula
#

But still they don't show so now I need to change linking method

proven lantern
lyric mountain
#

it's like, the lowest u can go

proven lantern
#

there are doors that let you in and out, but never open

proven lantern
#

there are trapdoors, that you can't come back from

wheat mesa
sage bobcat
earnest phoenix
wheat mesa
#

perhaps I should try JDA again

civic scroll
#
fn trap_door(unlucky: Person) -> !;
lyric mountain
#

yeah, making a bot would be a good project for database

civic scroll
#

vanilla?

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

at the same time I also wanna learn svelte

#

even though I hate frontend

sage bobcat
neon leaf
wheat mesa
#

yeah but like

#

crippling java addiction

quartz kindle
#

:^)

prisma nebula
#

Is their an issue with this in indexmjs js client.commands.set('addadmin', require('./commands/addadmin')); and this in addadmin command ```js

const { SlashCommandBuilder } = require('discord.js');

if (commandName === 'addadmin') {
// Check if the user is the owner of the bot
if (interaction.user.id !== '1002843443992743996') {
return await interaction.reply('You are not authorized to use this command.');
}

const admin = options.getUser('admin');

// Your code to add an admin goes here

await interaction.reply(`${admin} has been added as an admin.`);

}```

neon leaf
#

you can play using the bot or on the web in sync

civic scroll
neon leaf
#

java as backend / bot

proven lantern
civic scroll
#

also

// Your code to add an admin goes here

prisma nebula
lyric mountain
sage bobcat
prisma nebula
#

I mean about the linking between them

earnest phoenix
wheat mesa
lyric mountain
#

never used grails personally, but it feels very similar to popular frontend frameworks

sage bobcat
#

One message removed from a suspended account.

sage bobcat
proven lantern
hushed robin
#

unhealthy

sage bobcat
#

One message removed from a suspended account.

hushed robin
#

use sqlite

sage bobcat
#

One message removed from a suspended account.

proven lantern
#

normal if you use a nosql database. which you should be

hushed robin
#

better sqlite3

quartz kindle
sage bobcat
#

One message removed from a suspended account.

hushed robin
#

i love sqlite

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

hushed robin
#

it's easy and reliable

#

😘

wheat mesa
#

or maybe I could just make a bot with jda and make my dashboard with svelte and nextjs or something as backend

sage bobcat
#

One message removed from a suspended account.

civic scroll
#

you didn't remove marked ones from the dom

#

you should something like a message id to it

#

to make the deletion easier

sage bobcat
#

One message removed from a suspended account.

quartz kindle
frosty gale
#

it shouldnt happen at all

lyric mountain
frosty gale
#

maybe because people do it concurrently and dont have some kind of queueing measure in place?

quartz kindle
#

naive implementation

proven lantern
#

dynamoDB uses json.

lyric mountain
#

but groovy can use java seamlessly, it is java

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

json isn't necessarily bad if you know what you're doing, but most people who use it as a storage format make it themselves and fuck up their "database" because they don't know what they're doing

sage bobcat
#

One message removed from a suspended account.

hushed robin
#

why use json when sqlite exists

#

it's just as easy

neon leaf
#

why use sqlite when postgres exists

hushed robin
#

because it's harder

#

duh

sage bobcat
#

One message removed from a suspended account.

hushed robin
#

because mongo is šŸ’©

prisma nebula
#
const { SlashCommandBuilder } = require('discord.js');  // Create a new Set to hold the IDs of all admin users
const adminList = new Set();
const command = new SlashCommandBuilder()   .setName('addadmin')   .setDescription('Add a user to the list of admin users.')   .addUserOption(option => option.setName('admin').setDescription('The user to add as an admin.'));  module.exports = {   data: command,   async execute(interaction) {   
// Check if the user is the owner of the bot 
if (interaction.user.id !== '1002843443992743996') {       return await interaction.reply('You are not authorized to use this command.');     }      const admin = interaction.options.getUser('admin');         adminList.add(admin.id);      await interaction.reply(`${admin} has been added as an admin.`);   } };

This is addadmin codes now

lyric mountain
wheat mesa
sage bobcat
#

One message removed from a suspended account.

prisma nebula
sage bobcat
#

One message removed from a suspended account.

hushed robin
proven lantern
earnest phoenix
hushed robin
prisma nebula
sage bobcat
hushed robin
#

i've improved a lot since then

proven lantern
lyric mountain
#

sanitized it ```js
const {SlashCommandBuilder} = require('discord.js'); // Create a new Set to hold the IDs of all admin users
const adminList = new Set();
const command = new SlashCommandBuilder()
.setName('addadmin')
.setDescription('Add a user to the list of admin users.')
.addUserOption(option => option
.setName('admin')
.setDescription('The user to add as an admin.')
);

module.exports = {
data: command, async execute(interaction) {
// Check if the user is the owner of the bot
if (interaction.user.id !== '1002843443992743996') {
return await interaction.reply('You are not authorized to use this command.');
}
const admin = interaction.options.getUser('admin');
adminList.add(admin.id);
await interaction.reply(${admin} has been added as an admin.);
}
};

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

neon leaf
#

postgres will stay the king of relational for me šŸ‘‘

sage bobcat
#

One message removed from a suspended account.

lyric mountain
neon leaf
#

^

lyric mountain
#

replit has an auto-format button, use it

prisma nebula
#

The command should appear after fixing that?

lyric mountain
#

no

#

I just formatted the code cuz it was unreadable

proven lantern
prisma nebula
#

But it is fine

frosty gale
prisma nebula
#

And still not shown any command

neon leaf
#

since ive been using orms like primsa relational dbs are the best thing in the world, noone can tell me otherwise

lyric mountain
#

yes, because I didn't fix it

frosty gale
#

its quite a commonly used feature from what ive seen

prisma nebula
#

What I should also do it is registered

prisma nebula
#

(I guess)

#

Because I fixed it

#

My fixes becoming useless

proven lantern
lyric mountain
#

show where ur registering it

prisma nebula
#

I did 100 time

sage bobcat
lyric mountain
hushed robin
#

this is hard to watch

lyric mountain
#

EXACTLY battle, EXACTLY

neon leaf
lyric mountain
#

now u feel it

prisma nebula
#
const { REST } = require('@discordjs/rest');  const { Routes } = require('discord-api-types/v9'); 

 const { token, clientId, guildId } = require('./config.json');  const commands =     require('./commands/addadmin') 
                                                                                                                                                                                     const rest = new REST({ version: '9' }).setToken(process.env.token);    (async () => {      try {          console.log('Started refreshing application (/) commands.');           await rest.put(              Routes.applicationGuildCommands(clientId, guildId),              { body: commands },          );           console.log('Successfully reloaded application (/) commands.');      } catch (error) {          console.error(error);      }  })(); 
hushed robin
#

bro

prisma nebula
hushed robin
#

format your code

lyric mountain
#

this is how people see our usual discussions

prisma nebula
earnest phoenix
proven lantern
prisma nebula
sage bobcat
wheat mesa
#
const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v9");
const { token, clientId, guildId } = require("./config.json");
const commands = require("./commands/addadmin");
const rest = new REST({ version: "9" }).setToken(process.env.token);
(async () => {
  try {
    console.log("Started refreshing application (/) commands.");
    await rest.put(Routes.applicationGuildCommands(clientId, guildId), {
      body: commands,
    });
    console.log("Successfully reloaded application (/) commands.");
  } catch (error) {
    console.error(error);
  }
})();

proven lantern
wheat mesa
#

literally 2 seconds spent on prettier

prisma nebula
#

Ok thank you

earnest phoenix
lyric mountain
#

(it's not fixed)

prisma nebula
#

And wheir the issue now

lyric mountain
#

is there where ur initializing the bot?

wheat mesa
#

all I did was format your code

#

I didn't touch anything else

lyric mountain
#

you dont need to new REST, simply register through the client

prisma nebula
#

No errors

hushed robin
prisma nebula
#

Iak sending inage

lyric mountain
prisma nebula
proven lantern
#

this is from immutable.js

lyric mountain
#

why separate it from the client

hushed robin
#

not really

#

so u don't register everytime u restart your bot

#

cus u don't need to

lyric mountain
#

I mean, still doesn't make sense

prisma nebula
#
const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v9");
const { token, clientId, guildId } = require("./config.json");
const commands = require("./commands/addadmin");
const rest = new REST({ version: "9" }).setToken(process.env.token);
(async () => {
  try {
    console.log("Started refreshing application (/) commands.");
    await rest.put(Routes.applicationGuildCommands(clientId, guildId), {
      body: commands,
    });
    console.log("Successfully reloaded application (/) commands.");
  } catch (error) {
    console.error(error);
  }
})();

#

Is this wrong ?

lyric mountain
#

u can do exactly the same with the client

#

almost 1:1 to the REST method

prisma nebula
#

Wait

#

So I remove rest?

lyric mountain
#

no, I'm talking to battle

prisma nebula
#

Oh

#

Lol

hushed robin
earnest phoenix
# quartz kindle yes

Does your function also deep clone symbols, unenumerable properties, and nested objects? As that's what a deep clone actually is

hushed robin
#

but u shouldn't do it like that anyways

hushed robin
#

u should loop through the commands folder

quartz kindle
proven lantern
lyric mountain
#

they already added the command to an array

#

simply loop the array and get .data

quartz kindle
prisma nebula
#

Wym loop

#

Link by link by link

quartz kindle
hushed robin
#

🧌

prisma nebula
#

?

lyric mountain
#

for (const cmd of commands)

earnest phoenix
hushed robin
#

i think u should learn some javascript before making a bott

prisma nebula
#

Everything is good why command isn't showing

#

😫

quartz kindle
hushed robin
#

no it's not

#

if everything was good ur commands would show

lyric mountain
prisma nebula
#

Iam not seeing any error everything is right no redlines

prisma nebula
lyric mountain
#

well, u wont finish it asap

prisma nebula
#

Uhh

#

I just need 1 command to show

#

And then I work as that one is

lyric mountain
#

as it is, you're walking in circles, you NEED to grasp the concepts before making it work

prisma nebula
#

I just need it to announce new item and a command to chrck an old announce by it name and a ckmmand wheir u give perm for sm1 to use command to announce

#

That'd all

quartz kindle
#

even json-json is faster

solemn latch
#

json minus json?

quartz kindle
#

json into json

lyric mountain
quartz kindle
#

like json stringify + json parse

#

as a way to deep clone an object

#

lel

earnest phoenix
# quartz kindle spread and assign only goes 1 level deep, i go unlimited levels deep

Oh you go to unlimited depths, though since you ignore unenumerable properties it could be the reason it's faster

But I gotta say the implementation of ours is not that great because it ports and receives a value through an entire worker thread message channel, we'll definitely consider making it better, note the comment in the implementation

quartz kindle
lyric mountain
quartz kindle
#

but i am aware it goes much deeper than the standard user facing values

#

so for some use cases its appropriate

lyric mountain
#

read the d.js guides, it wont take long (maybe 1 day if you're a slow reader)

earnest phoenix
#

Though note that it handles all types of values and not just objects

#

Which adds to its considerably high overhead

lyric mountain
#

then try to apply what you learn from it SLOWLY (make the bot start, then make ONE command, then another, and so on)

hushed robin
#

you must be a very slow reader

lyric mountain
#

I know people who'd never finish reading a guide

quartz kindle
civic scroll
#

guys

#

how old is intel gen 9 cpu

hushed robin
#

the discord.js guide and docs are the only good ones in existence

civic scroll
#

4 years ago?

hushed robin
#

i can actually read them

hushed robin
quartz kindle
lyric mountain
#

I genuinely prefer reading through javadocs than d.js documentation

hushed robin
#

so yes

quartz kindle
#

but as you said, the major overhead is probably the worker

civic scroll
#

4 years ago

earnest phoenix
#

Yeah that's the issue

civic scroll
#

i hope the cpu will last until 2028 šŸ™

hushed robin
#

discord.js has the most readable docs

lyric mountain
#

nahh

sage bobcat
#

One message removed from a suspended account.

hushed robin
#

yeah

#

I only code JavaScript

lyric mountain
#

u only code d.js specifically

hushed robin
#

no

#

i've coded outside of d.js

hushed robin
#

check my github

earnest phoenix
sage bobcat
civic scroll
#

what docs

hushed robin
#

my first and second pinned isn't discord.js

civic scroll
#

the library docs?

sage bobcat
civic scroll
#

oh yeah and C++ sdk docs too
very helpful gx_tro

hushed robin
civic scroll
#

right @earnest phoenix?

#

missing null-terminated string -> no progman

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

You guys should try doing Vulkan in C++

hushed robin
#

i'm bad at making websites

#

so i probably couldn't

civic scroll
sage bobcat
#

One message removed from a suspended account.

civic scroll
#

i just want to draw animations

sage bobcat
#

One message removed from a suspended account.

civic scroll
#

why do i have to set up buffers

#

and hardware queues

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

civic scroll
hushed robin
#

i made an api once

#

but i quit because it's boring

civic scroll
hushed robin
#

sounds not bad

sage bobcat
hushed robin
#

just check every 1 second

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
civic scroll
hushed robin
#

i said the firs ttwo

#

not the others

lyric mountain
#

only the first is a valid project

hushed robin
#

why

civic scroll
lyric mountain
#

the second u didn't even finish

hushed robin
#

bruh

hushed robin
hushed robin
#

yea

#

i didn't say they weren't

#

🧌

sage bobcat
#

One message removed from a suspended account.

lyric mountain
hushed robin
#

whats the rest of it

lyric mountain
#

as it is u can't setup a bot solely with that project

sage bobcat
#

One message removed from a suspended account.

hushed robin
#

well yea

#

i'm not doing allat

#

it's beyond my skills now

#

maybe in the future i will add onto it

lyric mountain
#

then u didn't finish wrapping discord

hushed robin
#

šŸ™„

#

what "project" should i make then

wheat mesa
lyric mountain
#

idk, how about something different this time

#

like a site or console project

hushed robin
#

bro

proven lantern
#

tim never reviewed my code

hushed robin
#

sites are beyond me

#

i can't make them

lyric mountain
#

sites are literally 60% of js

hushed robin
#

yes

civic scroll
hushed robin
#

and that 40% is impossible for me

wheat mesa
#

volt sent this

lyric mountain
#

there's that list too

wheat mesa
#

pretty good list of stuff on there

sage bobcat
wheat mesa
#

I'm going to attempt #90 in java

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

because I think it'll be fun

sage bobcat
#

One message removed from a suspended account.

civic scroll
hushed robin
wheat mesa
#

actually no

#

I'm gonna do it in rust

#

because rust is fun

#

(and because I can't be bothered to do parsing in java)

civic scroll
#

this is easy

wheat mesa
sage bobcat
civic scroll
#

i live in hanoi so i can do towers of hanoi

wheat mesa
hushed robin
civic scroll
sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

hold my cosmos

civic scroll
#

hang on

#

lemme quote

sage bobcat
#

One message removed from a suspended account.

civic scroll
hushed robin
#

"basic neural network" this does not sound easy

#

tf is a neural network

civic scroll
sage bobcat
civic scroll
#

nah

hushed robin
#

šŸ’€

civic scroll
#

all you need is a training algorithm and a dataset

hushed robin
#

that is not easy

wheat mesa
#

It’s a bunch of linear algebra at its core if you wanted to build it from the ground up

hushed robin
#

bro i am not a math genius

civic scroll
wheat mesa
#

However there’s tons of neural network models prebuilt for you to use

civic scroll
#

it's basic for every single computer science program

sage bobcat
civic scroll
#

i just didn't attend class enough PensiveWobble

wheat mesa
#

The ā€œhello worldā€ of neural networks is identifying 1 digit handwritten numbers

civic scroll
wheat mesa
#

Also I have decided on a project now

hushed robin
#

what project

wheat mesa
#

Called ā€œgoing to the poolā€ because I can’t be bothered to program rn

lyric mountain
#

lmao

hushed robin
#

wtf

wheat mesa
#

(Plus it’s hot as balls outside so it’s a good day to swim)

sage bobcat
wheat mesa
#

Classic Texas weather

lyric mountain
#

how's that in celsius?

#

41?

hushed robin
#

yes

sage bobcat
hushed robin
#

what the fridge

sage bobcat
#

One message removed from a suspended account.

civic scroll
#

i should buy a ssd

wheat mesa
#

Nothing like the good old heat of the southern US

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

Had a day where the ā€œfeels likeā€ thing was 120 šŸ’€

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

It’s crazy how fast I burn in this weather without a shit load of sunscreen

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

Not really

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

We just get like one winter storm every now and then where it shuts our state down for a week since we’re not used to any snow being in existence

hushed robin
wheat mesa
#

My head doesn’t burn

#

I have hair

hushed robin
#

oh

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

It’s my chest, shoulders, and back that burn

hushed robin
wheat mesa
#

Especially my upper back since it’s difficult to reach with sunscreen by myself

sage bobcat
#

One message removed from a suspended account.

hushed robin
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

hushed robin
#

wait

#

if your in water

#

do u get sunburn still

lyric mountain
#

yes

wheat mesa
#

Yes

sage bobcat
#

One message removed from a suspended account.

hushed robin
#

bru

wheat mesa
#

It’s not the heat

#

It’s the UV

sage bobcat
#

One message removed from a suspended account.

hushed robin
#

🤨

lyric mountain
#

also UV ricochets off the floor