#development

1 messages · Page 1956 of 1

wheat mesa
#

What’s the point of querying for every if block

earnest phoenix
#

i'll do what you said

split hazel
#

and wouldnt it be easier to store data as

db.set('user id', {
  trophies: 0,
  arena: 0
});

db.get('user id').arena // -> 0
wheat mesa
#

^^

split hazel
#

you're defeating the whole point of objects if you're not going to use them

earnest phoenix
#

but I already made the bot with separated keys

wheat mesa
#

Seems like your process of storing data is a little bit unorganized

earnest phoenix
#

¯_(ツ)_/¯

#

I want it to send a message every time it gets in a newer arena but it doesn't work

split hazel
#

your code is very confusing

wheat mesa
#

Yeah

split hazel
#

it might not even be anything wrong with the code above

#

maybe something else

#

like storing the amount of messages

wheat mesa
#

It’s difficult to tell what’s actually wrong because I don’t know what the point of half of these queries are lol

earnest phoenix
#

I started wrong lol I should've learned js properly from the start

split hazel
#

you think

#

i say you should redo your whole leveling mechanism

earnest phoenix
#

leveling?

split hazel
#

your whole code behind it

earnest phoenix
#

ok

split hazel
#

an example for this to not repeat code you could just do something like

const user = db.get('user id');
if (user.trophies % 450 === 0) {
  // some code to increase arena
  message.channel.send(`Congratulations! You've got to the arena ${user.arena}! Use \`cc.arena\` to view it.`);
}
#

that way you are not repeating a lot of code

#

obviously just an example wont work properly

wheat mesa
#

I don’t know if that would work even as a concept since his trophy count probably won’t be exactly a multiple of 450

#

Unless that’s how your system works

earnest phoenix
#

But I can make it a multiple of it

#

this will send the message only one time?

#

oh but the trophies maybe are not multiple

#

because it gives random trophies and it removes random trophies

nova basin
#

To secure the bot

#

There is no other way because for the moment I have no money

spark flint
#

at all

#

they can't ddos the bot

#

unless they miraculously got the bot's ip address

split hazel
#

on ways he could optimise it

#

he could also have an array of trophies

compact pier
#

then you should

#

limit the user

spark flint
#

Yeah

compact pier
#

or an api

spark flint
#

But DDOS protection is really not needed

boreal iron
boreal iron
#

As I already told you yesterday…

lyric mountain
#

DDoS'ing a bot is only impossible cuz discord is the one between both ends

#

so even if u get 1m users to run a command at the same time discord will put things in a queue before sending to the bot

boreal iron
#

I mean regarding some of the shared code in here, a denial of service sometimes happens if just one or a few commands are executed freerealestate

nova basin
wheat mesa
#

Or upon startup!

compact pier
#

normal go is enough for an api or should use a framework?

sudden geyser
#

normal any lang usually doesn't work

compact pier
modest maple
#

generally people advise not using raw go for an api

#

frameworks exist to make your life easier

boreal iron
rocky nymph
#

hello, can anyone help me to fix this problem?

                                                  ^

TypeError [INVALID_ELEMENT]: Supplied Array fullPermissions includes an invalid element: [object Object]
    at ApplicationCommandPermissionsManager.set (C:\Users\moyou\Documents\Alef\node_modules\discord.js\src\managers\ApplicationCommandPermissionsManager.js:180:51)  
    at C:\Users\moyou\Documents\Alef\Handlers\Commands.js:64:50
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  [Symbol(code)]: 'INVALID_ELEMENT'```
sudden geyser
#

Show us line 64 of Commands.js

rocky nymph
sudden geyser
#

You probably didn't pass an array to some function/method

rocky nymph
sudden geyser
#

What's the value of fullPermissions?

rocky nymph
#

idk how to code in this way i copied this video https://www.youtube.com/watch?v=rqRb8YJ4T5Q&list=PLQfxpktrTzhK-w4sdeIV6lNEdr-a1ke2Z&index=4&ab_channel=Lyxcode can u check it?

boreal iron
#

lol

rocky nymph
#

This is the permission check category

sudden geyser
#

I think I see what's wrong

#

Here specifically

#

I assume the video doesn't go over that, so it probably won't help you.

#

What you probably want to do is get rid of the : true after it.

#

Because you have the variable

#

But you're not using it.

rocky nymph
#

oh

molten garden
#

is there a way to make a event for onvote

#

so when a user votes i can give them a role and other perks

rocky nymph
#

@sudden geyser I Got This Message :/

sudden geyser
#

That doesn't correspond to the code block you showed me, so that's another issue.

#

Check the stacktrace for the locations of the error

#

You can then debug what went wrong

rocky nymph
#

this is the code for: interactionCreate

sudden geyser
#

Nice

#

Now you know it's throwing due to execute not being a function

#

So you'll want to check the value of command for an execute function/method

#

Which is probably missing

#

What you could do

#

Is check what value corresponds to the command you issued

#

and check the source code of that

rocky nymph
slender wagon
#
ArgumentError: Expected `string choice value` to be of type `string` but received type `undefined`

error ^

.addStringOption((option) => option.setName('warranty')
                .setDescription('Insert the type of warranty you can provide for this item.')
                .addChoice('Till Claim')
                .addChoice('Lifetime'),
            ),

the code^

boreal iron
#

Why’s there a , behind the addChoice method?

slender wagon
#

added it as i was testing

#

pretty sure it fixes nothing if i remove it

boreal iron
#

And why’s there another one behind addStrinngOption?

#

You remove both as that’s no valid syntax

slender wagon
#

because it's the end

boreal iron
#

It’s not an object or an array

slender wagon
#

if i remove that it leads to errors

#
  data: new SlashCommandBuilder()
        .setName('add')
        .setDescription('Adds a item to the shop (Sellers Only)')
            .addStringOption((option) => option.setName('url')
                .setDescription('Insert the url of the item you are listing!')
                .setRequired(true),
            )
            .addStringOption((option) => option.setName('price')
                .setDescription('Insert the price of the item you are selling can go from 20 - 50 Cips!')
                .setRequired(true),
            )
            .addStringOption((option) => option.setName('warranty')
                .setDescription('Insert the type of warranty you can provide for this item.')
                .addChoice('Till Claim')
                .addChoice('Lifetime')
            ),
            async execute(interaction) {
boreal iron
#

My gosh…

#

Ok the last one is valid in that context

slender wagon
#

the top 2 ones work just fine

boreal iron
#

I see you removed the first one

slender wagon
#

the issue is on the third

boreal iron
#

There are also , behind the setRequired methods

#

Also an invalid syntax

#

…(method(),) is just wrong on many levels freerealestate

boreal iron
#

There are also , behind the setRequired methods

#

Also an invalid syntax

slender wagon
#

but those work just fine tho

#

the third one is the one not working

#

removed

#

still the same error

boreal iron
#

If code blocks wouldn’t be that horrible to watch on mobile pepowot

#

Could you post the current code again incl the error?

#

Without indentation

slender wagon
#
.setName('add')
        .setDescription('Adds a item to the shop (Sellers Only)')
            .addStringOption((option) => option.setName('url')
                .setDescription('Insert the url of the ')
                .setRequired(true)
            )
            .addStringOption((option) => option.setName('price')
                .setDescription('Insert the price of the')
                .setRequired(true)
            )
            .addStringOption((option) => option.setName('warranty')
                .setDescription('Insert the type of')
                .addChoice('Till Claim')
                .addChoice('Lifetime')
            ),
#

shortened desc so u can understand on mobile

#

i think the issue might be at

#

.addChoice

#
            ^

ArgumentError: Expected `string choice value` to be of type `string` but received type `undefined`
Expected string `string choice value` to have a minimum length of `1`, got `undefined`
Expected string `string choice value` to have a maximum length of `100`, got `undefined`
boreal iron
#

Is addChoice a valid method for string options?

slender wagon
#

looks like it

boreal iron
#

addChoice seems to require 2 parameters

slender wagon
#

uh

boreal iron
#

Not sure if that’s optional or not

#

I don’t use the ugly helpers

slender wagon
#

yeah that's the issue

#

but

boreal iron
#

There we go

slender wagon
#

let me see what the sec par does

boreal iron
#

It looks like an ID

#

How else would you identify the user choice

slender wagon
#

any idea why it adds a new one everytime i add something

solemn latch
#

are you registering guild commands and global commands?
if so, all commands will show twice on the guild with guild commands.

boreal iron
#

This or the fact you’re registering commands multiple times

boreal iron
#

Well it’s your code, don’t u know how/where you register them?

slender wagon
#

ah i am registering them globaly

#

no i do

#

but i've been moving them from 1 pc to another

#

and the .env file messed up

boreal iron
slender wagon
#

yup

boreal iron
#

Commands need to be registered once only

#

Anything else causes unexpected issues

#

You can always update or delete them but not register an already registered one again

slender wagon
#
  try {
            if (!TEST_GUILD_ID) {
                await rest.put(
                    Routes.applicationCommands(CLIENT_ID), {
                        body: commands
                    },
                );
                console.log('Successfully registered application commands globally');
            } else {
                await rest.put(
                    Routes.applicationGuildCommands(CLIENT_ID, TEST_GUILD_ID), {
                        body: commands
                    },
                );
                console.log('Successfully registered application commands for development guild');
            }

the dev guild id isn't on my .env anymore that's why it's messing up

#

just figured

boreal iron
#

That registers both global and guild commands but still a registration process is a one-time process

#

(at least in your test guild)

#

Alright I’m out… working

slender wagon
wheat mesa
#

Gotta love how the djs guide doesn’t properly show you how to register commands KEKW

sudden geyser
#

It hasn't been updated it seems

#

Still using the raw API

solemn latch
#

doing things properly? whats that?

boreal iron
#

You gonna register the commands over and over again

#

once means only a single time, not another startup registering them again

#

Also there’s no priority in terms your guild ID wasn’t found or not

#

Either you register a global command or guild command

#

Once the command has been pushed to the guild, a command being registered multiple times can pop up multiple times tho

#

And even worse one will always end up triggering an interaction failed response

boreal iron
#

But for some reason people straight copy that guide bullshit into their bot code

#

Executing it every time they startup their bots

#

Because nobody actually reads what’s written down in the guide about the one time registration process

#

I wonder they provided a guide how to build a common handler but didn’t do so for slash commands as this would be more important

#

If I’m gonna search in this channel the issues about proper slash command registrations are countless

#

And this will probably get even more funny in April

#

Discord could get rid of that bullshit by throwing an API error if you try to register a command with the same name

#

Only the resource (PATCH) to update (all) commands should be capable or overwriting existing ones

#

I mean how can you fucking register something that already exists anyway?

#

What an useless shit and bad practice allowing it in my opinion

boreal iron
#

patch or put whatever it was

#

I swear I’m close to build a slash command handler package

azure lark
#

how do i create a file on a github repo using the github api

proven lantern
#

will this delete the message for the interaction?

DELETE
/webhooks/{webhook.id}/{webhook.token}```
https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
#

are webhooks created each time the slash command is invoked?

#

Delete a webhook permanently. Requires the MANAGE_WEBHOOKS permission. Returns a 204 No Content response on success.

proven lantern
#

is it possible to delete this without first sending a message?

boreal iron
#

Isn’t “thinking” just the indication of a deferred response?

proven lantern
#

probably not possible

#

i've tried using the delete webhook endpoint thingy and it failed

#

403

#

now i'm getting 429 errors with my test bot

#

i have 2 items in the array and it throws a 429 on the second call

#

i was doing it all in one Promise.all, but i changed it so now it's synchronous

#

but i still get 429 errors

proven lantern
#

yeah

boreal iron
#

Hmm I think you can’t get rid of that then

#

Other than not deferring it and sending a channel message when your code is ready

#

Can you actually just acknowledge the interaction without sending a response?

#

To prevent it from failing?

proven lantern
#

the follow up message after the defer requires either context or embeds

#

i guess i could do a follow up message and then delete it after that

#

But I can't use that until I follow up with a message

boreal iron
#

Why do you even wanna remove that thinking placeholder?

#

Does your response takes that long?

proven lantern
#

The command is updating another message and having it return a response takes up too much space

#

I just want it to think and then be done thinking

#

Like how buttons work

boreal iron
#

Hmm actually without any response?

proven lantern
#

Yeah

boreal iron
#

I’m assuming that’s not the supposed use case freerealestate

worn sonnet
#

Hello

spark flint
#

Omg it’s a hacker

worn sonnet
#

Are there any libraries which can keep track of invites and let me know who invited who?

#

I'm using discord. Py

spark flint
#

No need for an additional library

boreal iron
spark flint
boreal iron
#

But I assume the answer is the same

lyric mountain
worn sonnet
boreal iron
#

@proven lantern After some investigation I’m sure it’s not possible.
Your only chance to not fill up the channel at least for anyone else is a ephemeral response, for example a simple content like just an OK emoji and to delete it right after it was sent

proven lantern
boreal iron
#

No

proven lantern
#

and follow up messages after the initial message

boreal iron
#

You need to defer with the ephemeral option

#

Maybe it’s just too fast for my mobile client

#

But it looks like deferring with the ephemeral option makes the thinking text hidden too

#

At least for anybody else

#

Looks like there’s no other solution

proven lantern
lyric mountain
#

But yeah, it'll work even at 1m joins per second

#

Never underestimate cpu speed

proven lantern
#

1ghz = 1 billion operations per second

lyric mountain
#

That in a single threaded non-optimized runtime

#

Cpu speed is so fckin huge that we often forget 1 second is an eternity to a computer

proven lantern
#

light only travels about a foot in 1ns

sudden geyser
#

light is slow as fuck

proven lantern
#

stupid light

sudden geyser
#

want to talk to my friend at mars but have to wait 27 minutes

lyric mountain
#

Imagine playing league on mars

#

By the time you exit the fountain the game already ended

sudden geyser
#

"bro I lagged" will become a valid excuse

proven lantern
#

how can it do a billion operations in a second if light is so slow

#

it's a conspiracy

lyric mountain
#

Imagine after they manage to reliably use quantum entanglement

proven lantern
#

matrix math is going to be big

#

infinite sized matrix

#

im not sure how to use that to solve many problems

worn sonnet
sudden geyser
#

I'd like to see information-theoretical security become a thing

lyric mountain
#

My estimate is that during a raid you have about 2-4 people joining per second

sudden geyser
#

no 5-10 is normal

boreal iron
lyric mountain
#

5-10 is a huge amount of people joining

#

In a single second

sudden geyser
#

yeah raids are annoying

#

and 5-10 does happen often

#

usually 5

proven lantern
boreal iron
#

Hmm my gosh why do you need to do such complicated things

proven lantern
#

i like to be complicated

boreal iron
#

Yeah I see freerealestate

proven lantern
#

i gave up on my idea of making each command it's own separate github project

#

that was a little too much

boreal iron
#

And like I said responding without deferring with an emoji for example and removing the webhook response immediately after sending it, isn’t an option?

proven lantern
#

like a delay

#

or maybe i can add a delete button

#

i'll make my own ephemeral message

#

that anyone can dismiss

boreal iron
#

Just tickYes as interaction response and removing it 5s after sending it

#

(for example)

proven lantern
#

yep, something like that should work

boreal iron
#

There we go

#

I will only calculate 2h as you have to make compromises

#

Support invoice is on its way

flat copper
#

can we use tts in bots?

snow urchin
earnest phoenix
#

ayo ty nitro

round cove
#

It's claiming usersOneCommand is type never?

#

@snow urchin

slender wagon
#
let warranty = await interaction.options.getString("warranty")

how do i check if warranty is null without making two big functions
i just wanna check if it is null and if yes it will give it a value

round cove
#
if(!warranty) {
  // code
}```
pale vessel
#

Also that await is superfluous

#

That method does not return a Promise

slender wagon
#
if (warranty === null) warranty = "Till Claim"

went for this instead

#

saves alot of lines

slender wagon
round cove
slender wagon
#

because i would have to repeat the code 2 times

round cove
#

What?

slender wagon
#

and i couldn't just give another value to the warranty

slender wagon
round cove
#

What you want to do is

const warranty = interaction.options.getString("warranty") ?? 'Till Claim';```
slender wagon
#

nothing

round cove
#

What

slender wagon
#

i just want to check incase that's null

#

and give it another default value

round cove
#

That checks if it's null, if it is it gives it the value Till Claim

#

Is that not what you want?

slender wagon
#

yup

#

but a codeblock wasn't what i was looking for

round cove
#

Then don't use the if. Do the thing I showed.

round cove
slender wagon
#

oh

#

?? is used on the new version of node right?

round cove
#

Should be.

#

Try it out.

slender wagon
#

okay i totally forgot about that

round cove
#

This the problem with non TS devs smh

slender wagon
#

oop that worked

#
  collector.on('collect', async (i) => {
                    if (i.customId === 'cl') {
                        await i.message.delete()
                        if (price > 30 || price < 15){
                            i.channel.send(`Please avoid going higher than 30 CIPS or lower than 15 CIPS`);
                        }
                        try{
                          }

how do i define (i) inside the "try" block

pale vessel
#

You don't need to?

slender wagon
#

it no worki tho

#

oh shiut

#

nvm

#

i did a typo

#
await i.message.delete()
#

how do i prevent this shit from crashing my app

#

sometimes it works

#

sometimes it says unknown message

#

can i add a handler or smthn

dry imp
slender wagon
#

yes

dry imp
#

wdym crashing

slender wagon
#
throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Unknown Message
#

it doesn't even warn it just crashes ffs

dry imp
#

thats unfortunate, whats more unfortunate is that i dont know djs

slender wagon
#

F

quartz kindle
#

it means you're trying to delete a message that was already deleted

spark flint
#

how would i get the domains here to do a forloop

{
  "ApiResponse": {
    "$": {
      "Status": "OK",
      "xmlns": "http://api.namecheap.com/xml.response"
    },
    "Errors": [
      ""
    ],
    "Warnings": [
      ""
    ],
    "RequestedCommand": [
      "namecheap.domains.getlist"
    ],
    "CommandResponse": [
      {
        "$": {
          "Type": "namecheap.domains.getList"
        },
        "DomainGetListResult": [
          {
            "Domain": [
              {
                "$": {
                  "ID": "47232901",
                  "Name": "benchurton.xyz",
                  "User": "oak8trading",
                  "Created": "12/31/2020",
                  "Expires": "12/31/2022",
                  "IsExpired": "false",
                  "IsLocked": "false",
                  "AutoRenew": "false",
                  "WhoisGuard": "ENABLED",
                  "IsPremium": "false",
                  "IsOurDNS": "false"
                }
              },```
slender wagon
#

yeah but it is weird since it deletes the message then throws it

spark flint
#

(there are like 20 domains)

quartz kindle
#

button interactions all have the same message

slender wagon
#

oh

#

so what can i try

#

in the beggining of each button i have it yeah

#

but it is inside the if blocks

quartz kindle
#

something like that?

spark flint
#

yeah

#

i'll see if that works dance

#

nope

#

using ejs

quartz kindle
slender wagon
#

okay

quartz kindle
#

other than that you have to catch the delete anyway, becausw it can be deleted by other things

slender wagon
#

i'll try that

quartz kindle
spark flint
#

in the json output

quartz kindle
#

there are 3 arrays in your response

#

which level is the correct one?

spark flint
#

thats the json response

#

well it was xml but converted to json

quartz kindle
#

so they are all in Domain, not in DomainGetListResult

spark flint
#

ah

quartz kindle
#

so add [0].Domain to the for

#

and remove it from inside the block

spark flint
#

yep that worked

#

tysm

boreal iron
#

I better don’t ask

errant flax
#

im trying to get the user tags

#

oh wait now i see the issue

errant flax
#

anyone explains why it returns null

feral aspen
compact pier
#

he want to get it from the text

feral aspen
#

Oh, I see.

errant flax
#

im expecting it to return an array like

["hello#0804","epic#0001"]

but it just returns null

feral aspen
#
const regex = /\w+#[0-9]{4}/g;
const string = 'hello#0804 noob haha epic#0001';

const result = string.match(regex);
console.log(result) // [ "hello#0804", "epic#0001" ];
#

This is what it returns for me.

#

Anyone knows why when I upload a website folder from my domain, the image just disappears?

#

(Locally)

#

(On Domain)

modest maple
#

have you considered checking your console?

feral aspen
#

I use Plesk.

#

I also chercked the source code.

feral aspen
#

Although, why so, I'm not sure what I'm supposed to be doing to prevent this?

modest maple
#

I mean, check your plesk logs ig

feral aspen
#

It's a Get 500 error.

earnest phoenix
#

now my codes are human-readable I think and better organized

modest maple
feral aspen
#

The error is there.

#

On my access_ssl_log?

#

OHH, I see why.

#

I appreciate it, I figured it out. 👍

earnest phoenix
#

Is there a way to name multiple variables using a array names? like instead of using let every time, you use function or something

feral aspen
#

Does this help?

sage bobcat
#

One message removed from a suspended account.

nocturne grove
#

okay I'm back lol
Having problems with starting my test bot. I updated Node.js and now it keeps loading (?) in the terminal. I already deleted all npm-modules and npm install, I tried npm init and I installed all my packages

#

Still not working

#

nvm I'm stupid

#

-> always make sure your ready event is working

indigo cobalt
#

I'm trying to update an object inside a array, but instead of updating the correct object it's updating the first in the array
The first is doing what i want but the second no
The function I use:

await equipItem("<user_id>","swords","iron","10000")

In the first sword instead of being true it should be false and in the second there should be a equiped value saying true
https://srcb.in/5Q0kbB1ERV

lyric mountain
#

First note: var

#

Don't use var

timber fractal
#

WHY doesnt this work and how can i make it work, why doesnt it mention the user js interaction.editReply({ content: `${data.value}\n${user}`, allowedMentions: { users: [user.id] } });

lyric mountain
#

Log the variable item to see what it returns

timber fractal
# lyric mountain Error?

no, it doesnt mention the user while i want it to mention the user, like it does have an @timber fractal but it doesnt actually give a mention

indigo cobalt
lyric mountain
#

U didn't show current output

lyric mountain
indigo cobalt
timber fractal
indigo cobalt
indigo cobalt
lyric mountain
timber fractal
#

is it cause i deferreplied it earlier?

indigo cobalt
timber fractal
lyric mountain
timber fractal
#

dumb

indigo cobalt
#

(don't mind unactivated windows)

timber fractal
indigo cobalt
feral aspen
#

What's better?

spark flint
#

By far

feral aspen
#

👍

quartz kindle
#

horde is not as bad is it was before

#

but yeah i've always liked roundcube

#

its not that bad

modest maple
#

Ngl

#

I just pay for MS

quartz kindle
#

outlook?

timber fractal
spark flint
#

Meant to send that

feral aspen
compact pier
#

@feral aspen what framework you use for your website?

azure lark
#

how can i make a file in a github repo using its api?

round cove
#
Moxie Marlinspike

Despite considering myself a cryptographer, I have not found myself particularly drawn to “crypto.” I don’t think I’ve ever actually said the words “get off my lawn,” but I’m much more likely to click on Pepperidge Farm Remembers flavored memes about how “crypto” used to mean “cryptography” than ...

earnest phoenix
quartz kindle
#

web3 is a big pile of ass

#

for me, the biggest problem is not even listed there

#

its straight up just performance

#

web3 is stupidly slow in general, blockchains as stupid slow in general

#

you cannot build something like the common internet of today on top of blockchains without making everything much slower than it is today

feral aspen
#

Do you think it's a great idea to do this, and which? I don't seem to understand what's the huge difference between both of those.

round cove
#

I have no idea what the speed is. But the thing that got me was how centralized the "decentralized" thing is supposed to be and the amount of layers they make you go through, for something like the NFT, to not even SIGN the request and prove you're the owner.

quartz kindle
#

web2 = client buys from business, client receives item. end of story
web3 = client buys from business, business checks the government, informs government that client bought item, government says ok, client receives item.

round cove
#

Well, yes.

#

Web3 is supposed to be about the blockchain.

modest maple
#

Yeah web3 is not a good idea rn

#

The cost to work ratio is hurendous

round cove
#

I have my same gripes with people wanting the metaverse lol.

quartz kindle
#

i dont mean the literal government like the president of the united states, government as in the blockchains that control all transactions, just to be clear

modest maple
#

cough topgg

round cove
#

Metaverse is supposed to be a big open source project anyone can check, decentralized owned by all.

However, each big corporation is making their own non open source metaverse, centralized, get fucked.

#

It's literally doing the thing the book said lol

feral aspen
#

Damn.

round cove
#

big bad corpo

quartz kindle
#

if you really want a true web3, start with ditching ISPs and creating your own open ended meshnets

feral aspen
quartz kindle
#

until that happens, centralization will never be defeated because it simply outperforms everything

modest maple
#

There was a quote somewhere.

Web3 presents itself as a more secure design to stop these big governments from controlling and trying to make a dime. However, Web3 stands on the very foundation of a system make to make a quick dime ]

quartz kindle
#

pretty much

round cove
#

Like the blog I sent above. Yeah lol.

quartz kindle
#

i dont trust the current situation with NFTs at all

round cove
#

It's just for anyone wanting to make a quick buck.

quartz kindle
#

it just feels like a fast money grab that will become forgotten and obsolete in no time

#

the entire concept of NTFs is just idiocracy

#

stealing money from idiots

cinder patio
#

web1 and web2: build
web3: buy

modest maple
#

I think mee6 making NFTs is a good proof of the quick muni

round cove
#

That was so funny lol.

#

Top.gg with the DAO stuff is also just omega sad when the site hasn't finished its own bugs too.

spark flint
#

^

quartz kindle
#

bugs create jobs

#

remove bugs and you lose your job

round cove
#

Lmao.

quartz kindle
#

:^)

spark flint
round cove
#

Look, a refresh button that should literally just be get bot info and update that's been broken for almost 2 months should get you fired ngl.

spark flint
#

its fixed now

#

finally

round cove
#

GOOD

spark flint
#

but also not fixed

round cove
#

wait

#

🧐

spark flint
#

it refreshes

round cove
#

Is it a dice roll

spark flint
#

but takes several hours to update

round cove
#

I mean, that's probably just how they cache.

spark flint
#

true

round cove
#

But it shouldn't be.

spark flint
#

their caching is shit

round cove
#

It should be a time limited button if that's the case.

spark flint
#

Yeah

#

Clear cache button when

round cove
#

It's okay refresh servers doesn't work either :^)

spark flint
round cove
#

One button at a time.

spark flint
#

top tip: don't release a site redesign if 90% of the features break

#

especially if its a popular service like top.gg

round cove
#

I mean the redesign is pretty.

#

Eye catching yknow.

spark flint
#

yeah

cinder patio
#

it's ok

modest maple
#

basically

#

👏 Learn to cache correctly topgg

#

but also learn how to use a search system

#

👏

spark flint
#

yes

#

mostly ok design, terrible caching and backend

#

me: accepts team invite

site: works

me: checks the team

site: not in team

api: shows me in team

modest maple
#

😉 If you're watching and want me to fix the search and cache system my day rate is £1k

round cove
#

what the FUCK is that discord

spark flint
#

lol

#

great design right there

modest maple
#

changelog looking pretty poggers so far

modest maple
boreal iron
sudden geyser
nova basin
#

by pressing one of the buttons on the left you can change page while staying in the same page so by pressing for example on the category fun there will be all the information of the fun orders which will be displayed without changing page same thing for the other categories and how can I do that? Please

spark flint
quartz kindle
#

like ben said, one option is to load the content of all pages at once, and hide them in invisible elements that are controlled with css and js

#

another option is to have the content of the pages available by ajax requests, so that when you click the button, it fetches the content of that page without reloading the page

spark flint
#

why am i getting that

#

with gitlab

#

when alertmanager wasn't running (ip wasn't set in config), it gave me an error page

#

now I have fixed that, i'm now getting that

earnest phoenix
#

I've decided to swap from using express on itself and use nestjs with it

#

Since I couldn't be bothered to make everything nest already has.

earnest phoenix
#

So I am making a platform type thing, how should I generate user ids that will be unique per user?

quartz kindle
#

any way you want basically

#

the most basic form of a unique id is random + time

earnest phoenix
#

oh?

quartz kindle
#

then you can hash it, or convert it to base64, idk

earnest phoenix
#

what would random be?

#

like a random number?

quartz kindle
#

Math.random for example

#

or crypto.randomBytes if you want extra safety

#

very simple way of generating guaranteed uniqueness

earnest phoenix
#

Mm I would prefer them to be numerical ids for readability

quartz kindle
#

you want something like a snowflake id?

earnest phoenix
#

Yea

quartz kindle
#

well you can still use the same method

earnest phoenix
#

Oh?

#

I was told it was much different from that

quartz kindle
#

if you want to create an actual snowflake conforming to the spec, its 41 bits of timestamp plus 10 bits of "instance", ie the worker/process id, plus 12 bits of "sequence", ie sequence++

earnest phoenix
#

Yea that is whatt people were telling me

#

But I didn't know exactly how to do that mmLol

quartz kindle
#

so in js terms, using bigints, that would be ((BigInt(Date.now()) << 22n) + (workerid << 12n) + sequence++

earnest phoenix
#

mmmm

quartz kindle
#

workerid = 1, sequence = 0

earnest phoenix
#

what is the point of workerid tho

#

would it ever change?

quartz kindle
#

for horizontal scaling

#

so you can have hundreds of workers generating snowflakes at the same time and never collide

earnest phoenix
#

My biggest confusion is between workerid and sequence

#

like what if sequence resets backs to 0 since you are incrementing it?

quartz kindle
#

its supposed to

earnest phoenix
#

Ah

quartz kindle
#

but by then the timestamp is way ahead

earnest phoenix
quartz kindle
#

yeah

#

or you can simply remove it

#

and make shorter snowflakes

earnest phoenix
#

true

quartz kindle
#

54 bits instead of 64 bits

#

you can also reduce the size of the sequence

#

and fit everything in js ints

#

which are 53 bits

#

but for databases you still need 64 bit ints

earnest phoenix
#

so something like newUser.id = (BigInt(Date.now()) << 22n) + BigInt(seq++);

round cove
earnest phoenix
#

TypeError: Do not know how to serialize a BigInt sad

#

I don't work with BigInts at all so I have no idea what this means

#

I think this is probably a typeorm error tho

round cove
earnest phoenix
#

I don't think typeorm can handle querying with bigints

#

idk tho

round cove
#

It can't.

earnest phoenix
#

that is an issue then

#

I might have to set the actual type to be bigint and let ts say its a string

#
  @Column({ name: 'id', type: 'bigint', primary: true })
  id: bigint;

to

  @Column({ name: 'id', type: 'bigint', primary: true })
  id: string;
#

Yea that worked

earnest phoenix
quartz kindle
#

if typeorm is using JSON.stringify behind the scenes, then it will cause that error

earnest phoenix
#

yea

quartz kindle
#

its still the same size as a snowflake, you just increased the sequence size

sage bobcat
quartz kindle
sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

telepathy

earnest phoenix
#

I am still storing it as a string tho

quartz kindle
#

yeah it doesnt really matter if you're not worried about data size and stuff

earnest phoenix
#

Ye I am not too worried about it

#

I just wanted unique ids that are readable

quartz kindle
#

it just changes the point at which the sequence should reset

#

your current setup should reset the sequence at 4194303

#

if(seq > 4194303) { seq = 0 }

earnest phoenix
#

to test it out I was just setting the sequence inside a function so it reset every function call

#

Ima change it now tho

earnest phoenix
#

and I also assume it doesn't matter if it resets to 0 due to the backend going offline and back online

quartz kindle
#

yeah it shouldnt matter

earnest phoenix
#

alrighty tyty

quartz kindle
#

the functionality of the sequence is to prevent collisions caused by generating multiple snowflakes in the exact same millisecond

earnest phoenix
#

Should I replace Date.now() at some point with the timestamp of when the platform is released to the public like discord does or should I just not care

quartz kindle
#

discord basically did that to reduce a bit the size of the snowflake

earnest phoenix
#

ah

quartz kindle
#

by setting an offset, you can count time from a closer date, and have smaller date numbers overall

earnest phoenix
#

icic

#

Ig it doesn't matter in the long run then?

quartz kindle
#

not much

#

at least until the timestamps get bigger than 41 bits

earnest phoenix
#

ic

#

I will worry about that when it comes to it

quartz kindle
#

thats when 42 bit timestamps will starts

earnest phoenix
#

I dont have to worry then

#

Mmm I just realized something

#

When I am fetching a user I obv don't want to display their password in the data returned that is something I want hidden.

#

How can I remove the password from the returned data?

quartz kindle
#

what password?

earnest phoenix
#

the hashed password in the database

#

I dont wanna return that in the data from the GET /users/:id endpoint

quartz kindle
#

then dont return it

earnest phoenix
#

But how

quartz kindle
#

in your endpoint code?

earnest phoenix
#

Yes I know this but I am unsure of how to actually make it not return it

#

I wouldn't be asking if I knew

quartz kindle
#

whats your code?

earnest phoenix
#
  async findOne(identifier: string, relations?: Array<string>, cache: boolean = true) {
    const user = relations
      ? await this.usersRepository.findOne({ where: { id: identifier }, relations, cache })
      : await this.usersRepository.findOne({ where: { id: identifier }, cache });
    if (!user) throw new BadRequestException('No user with the email exists.');

    return user;
  }
  @Get('/:id')
  async fetchUser(@Param('id') id: string, @Res() res: Response) {
    return res.status(200).send({ ...(await this.usersService.findOne(id)) });
  }
quartz kindle
#
const user = await this.usersService.findOne(id));
delete user.password;
return res.status(200).send(user);
``` well thats one way
round cove
#

That's what I was thinking lol

earnest phoenix
#

ffs

#

I forgot delete was a thing

#

thanks tim for that

quartz kindle
#

otherwise theres also the opposite way, just build a new object with all the fields except the password

#

if you have many fields you can use a loop

earnest phoenix
#

I can't remember what my friend did but iirc he basically just deconstructed something and it left out whatever he grabbed from the end result

round cove
#

yikes.

earnest phoenix
#

The source code for the backend to this project is an absolute shit fest rn

round cove
#

my code

earnest phoenix
#

I haven't used nestjs in ages so I am trying to slowly get back into using it

#

this looks nice

#

Should i change what role is?

#
export enum Role {
  ADMIN,
  USER,
}

rn it is an enum so the values are 0-1

#

but should i give em string values instead like

export enum Role {
  ADMIN = "Admin",
  USER = "User",
}

Though in the end it probably doesn't matter cause what gets displayed wont even be what the enum's equal

quartz kindle
earnest phoenix
#

I plan on making badges or smth and displaying the appropriate badge depending on the value of role

earnest phoenix
quartz kindle
#

i also forgot that was a thing, had to google it to remind myself

earnest phoenix
#

yea it is a neat trick

#

better than using delete

quartz kindle
#

yeah its a cleaner approach

#

in terms of performance it should be the same as creating a new object with all keys except password

earnest phoenix
#

yea

#

it just looks cleaner which is what I like about it :p

#

@round cove also in case you care I recently figured out typeorm has its own caching system

#

You can cache whatever you fetch and typeorm will fetch from cache instead

#

you just need to pass in the cache option into find or findOne

round cove
#

Oh really?

#

That's pretty neat

#

I wonder if it's work looking into.

#

Or using.

#

I don't think my bot is something that would be able to use cache, it wouldn't make sense.

#

Or does it update the cache and DB at the same time? @earnest phoenix

#

Like I assume the cache is local in the entities and then it makes the call to the postgres db

earnest phoenix
#

I think it updates cache and db yes

round cove
#

Curious. I should google it.

earnest phoenix
#

If you find out I would like to know the answer too

#

But I am pretty sure it does

round cove
#

Oh hey you can set the lifetime of the cache, the default is 1 second.

#

Kinda cool.

earnest phoenix
#

yea

round cove
#

My bot is based on if the server has react roles or not and if they deleted one and it was still cached then it kinda defeats the point?

earnest phoenix
#

I have no idea how to set the time not using a query builder

round cove
#

?

#

Oh

earnest phoenix
#

I am not using a query builder

round cove
#

You can do it in the config.

earnest phoenix
#

Also I love adding things to Request in typescript

round cove
#

:^)

earnest phoenix
#

TS2339: Property 'user' does not exist on type 'Request >'.

#

I know how to solve this but ffs

#

I wish shit was simpler sometimes

round cove
#

You're LITERALLY using TS for the type safety

#

The best part of it

#

but I know the feel

#

lmfao

earnest phoenix
#

yea pretty much

#

Type safety and decorators

#

literally the only thing I like about ts rn

round cove
#

lmao

earnest phoenix
#

Actually I dont think this is the best idea 🤔

#
declare module 'express' {
  interface Request {
    user: Partial<Users>;
  }
}
round cove
#

nosir

#

Make some interface that extends request

#

Xd

earnest phoenix
#

yea

#

actually no

#

I want to

#

I want to override Request's types and add user to it like that so i can use it anywhere

#

Actually does it matter? 🤔

#

I am just setting req.user once they login so I can use it on the frontend side to get the user's data to display

earnest phoenix
#

Doesn't matter anyway, req.user is empty even after logging in

#

Wait wtf

#

Why am I doing this shit by myself I can use passport and passport-local

fresh verge
#

How do I have my bot check it's channel override permissions properly?

craggy pine
#
      const msg = await message.channel.send({
        embeds: [pingEmbed] 
      })

I'm toying around with v13+ after being on v12 of discord.js for a while and I wanted to ask since it has since changed...

how would I go about updating an embed with it being embeds: [pingEmbed]

I originally just did msg.edit(pingEmbed.setDescription("stuffhere")) however that wouldn't work anymore.

quartz kindle
#

the same way as you send it

#

.edit({embeds:[embed]})

round cove
#

^

craggy pine
#

Neato

#

Ty much

round cove
#

i remember watching you play osrs miyuka

#

when we were both mods

#

lmfao

craggy pine
#

Yee I've moved on from OSRS. I'm now a FF14 nerd

round cove
#

Lmfao

#

But nex got release ;p

craggy pine
#

I knowwwww

#

But like

#

I cba with getting back on it tbh. It drained me so much

round cove
#

I know that feeling

craggy pine
round cove
#

Curious, why would you edit it and not just sent an initial message that shows that info?

#

No need to edit.

#

local testing ignore the latency ;p

earnest phoenix
#

iirc editing is to get the ping

craggy pine
#

It's an old thing I did idk shrug ${Math.floor(msg.createdAt - message.createdAt)}

round cove
#

Don't need to edit at least.

#
    embed
      .setTitle('General Info')
      .setColor(COLOR.AQUA)
      .setDescription(
        `
Thanks for using RoleBot!
This servers shard ID: ${interaction.guild?.shardId}
Server count: ${size} servers.
Latency is ${
          Date.now() - interaction.createdTimestamp
        }ms. API Latency is ${Math.round(this.client.ws.ping)}ms.

[Click to Vote!](${VOTE_URL})
[Join the support server!](${SUPPORT_URL})
`
      )
      .setThumbnail(AVATAR_URL);```
craggy pine
#

I suppose Date.now() would also work ya

quartz kindle
#

that might not be entirely accurate

earnest phoenix
#

yea

round cove
#

Which part?

quartz kindle
#

you are relying on discord's time and your vps's time being in sync

#

which rarely happens, clocks can have several seconds of difference between computers

round cove
#

Hmm, I wouldn't be too worried when it reports ~26ms most off the time but yeah.

quartz kindle
#

well you are showing 450ms

round cove
#

Locally running >:((

#

hosted actual bot

quartz kindle
#

looks like typical time sync differences

#

those are very unusual numbers

round cove
#

There aint no way people are worried about 30ms

earnest phoenix
#

30ms could make a difference mmLol

quartz kindle
#

not worried, just using the wrong math to get the same result, which works sometimes, and sometimes can be veeery off

round cove
#

Go on

#

prove it

earnest phoenix
#

It makes a difference cause I say it does

#

get rekted nerd

round cove
#

gg

earnest phoenix
round cove
#

gonna hardcode 1ms

earnest phoenix
#

Also fucking jwt is pissing me off

#

😩

round cove
#

How so

quartz kindle
#

better than those guys who hardcode math.random

quartz kindle
#

i literally saw that here on top.gg

earnest phoenix
#

It is saying I am unauthorized even when providing the correct jwt token

round cove
#

function randomNumber() {
  return 4;
}```
earnest phoenix
#

just making me angy

quartz kindle
#

some dude showing his ping code, and it literally had ping: ${Math.floor(Math.random() * 100)}

earnest phoenix
#

Im not wrong tho

craggy pine
#

Wow

round cove
#

prove it

earnest phoenix
#

I literally copy and pasted the exact token returned

round cove
#

Show your verification code

#

jwt.verify('token', { secret: 'key' })

quartz kindle
#

i also remember seeing some other guy post a code, and his ping command had an array like [150, 200, 145, 253, 120] and he would randomly pick one every time

#

lmfao

round cove
#

just to have a command?

earnest phoenix
quartz kindle
#

yes

#

and one of them, i dont remember which one, legit thought thats how people did ping commands

#

he didnt even know what ping means

#

and how to measure it

round cove
#

As much as I wanna laugh at them I guess if they didn't know then you can't blame them.

earnest phoenix
#

Wait you don't pick a random number from a array to get the ping???

#

World is upside down now

earnest phoenix
#

jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken to jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken() fixed the constant 401 Unauthorized

round cove
#

Lmao

uneven scaffold
earnest phoenix
#

So I want some help with thinking something through, basically I am going to be using sessions to persist logins, but heres the thing. I want to generate an api key that is unique to the user so that it can be used on certain api endpoints, like getting the user's data and such things like that (though if you guys have a better idea since I don't really plan on making the api public as of right now so it will be mostly internal use only to fetch user data, posts and things like that, that needs to be displayed on the frontend). My question is how should I generate these keys, store the keys so they can be verified/revoked and if I am using an api key system, should I attach the key to that users session or like what should I do.

zinc stream
cobalt junco
zinc stream
cobalt junco
zinc stream
cobalt junco
cobalt junco
earnest phoenix
dense gulch
#

Broo wth is happening with dev portal

#

I cant invite any user to my team

pure talon
spark flint
#

What is the best way to integrate a login system to express.js?

#

I would use Discord oauth like I usually do but the project is completely unrelated to Discord

quartz kindle
#

you can use any other oauths out there

#

like google, facebook, etc

#

or if you want your own, just make a database and store users and passwords

pale vessel
#

plain text

#

I heard guilded used to store users' passwords in plain text

#

quite outstanding

boreal iron
#

lol

split hazel
#

many bigger companies used to

#

until they've been exposed

boreal iron
#

Unfortunately the sad truth

pale vessel
#

wp at some point stored passwords in md5

#

I think they're still in md5

quartz kindle
#

lmao

boreal iron
#

If you never ask yourself how websites could send you your forgotten password in plaintext in the past, you’re lost

pale vessel
#

sussy

quartz kindle
#

thank god i've never seen that

boreal iron
#

MD5 totally save… no hash tables or related stuff exists
Bad things don’t exist!

quartz kindle
#

megadrive5

spark flint
#

Looks really promising

boreal iron
#

While I’m gonna say my password encryption also ends up as MD5 string but using SHA with salt keys before and behind

#

I mean the fact it generates a 128 bit hash or 32 chars is perfect for a database tho

quartz kindle
#

why not just bcrypt?

boreal iron
#

Because mixing multiple existing algorithms (combined with salt keys) is more save

quartz kindle
#

i've always heard the opposite

#

that multi hashing does not really improve security

modest maple
#

md5 hashing is basically just as bad as plain text

#

but yes it can cause issues because you're affecting how the algorithm ingests the data and performs the lossy operation

boreal iron
#

But too save is bad, if the NSA can’t read your shit tho you may will disappear

#

Did you remember the legendary cryptography group developing a new hashing method based on 3 different, very save hashing algorithms?

#

I can’t remember how the fucking project was called

#

It was basically “impossible” to decrypt it and the guys had the goal to improve the ‘net

modest maple
#

nothing is ever impossible

boreal iron
#

But it never goes live and the developers mysteriously disappeared

modest maple
#

SHA-256 and SHA-512 are already computationally impossible to reasonable bruteforce

boreal iron
modest maple
#

the issue is people making the passwords suck, and it only takes a few old websites to build a reasonable rainbowtable for the most common styles

boreal iron
#

Yeah but only works if you don’t use any salt keys or if they got leaked

#

And how knows how many (big) website out there are still thinking they’re save and relying on that old unsave shit

modest maple
#

pithink salt does not make you invincible

#

and these events have already happened

quartz kindle
#

its impossible for a hashing algorithm to be 100% unbreakable, thats why we make the algorithm more expensive instead, to severly slow down any attempt at breaking it

modest maple
#

there are rainbow tables in the Petabytes in size that can reasonably match your parent's passwords lol

quartz kindle
#

any decent password hashing algo will be customizable in terms of computing complexity, so it will never go obsolete, you just increase the complexity at the same rate hardware power increases

boreal iron
earnest phoenix
#

what the fuck happened to faker.js

quartz kindle
#

went to korea and started playing league of legends

boreal iron
#

Wut? Im still here

earnest phoenix
#

the entire source code is gone

boreal iron
quartz kindle
#

it doesnt matter if they have the encryption source, thats the point

boreal iron
#

Not that it would be a big surprise employees have grant attackers access to their intranet by just opening a malicious email

quartz kindle
#

you can know exactly how the hash was created, its still computationally too expensive to break it

split hazel
#

I think he didn't wanna work on it for free anymore

boreal iron
earnest phoenix
quartz kindle
#

all these modern hashing functions are public and easily differentiable, take a bcrypt or argon2 hash and you know its made with bcrypt or argon2 just from looking at it

boreal iron
#

It mostly is the more cheap the better

earnest phoenix
#

also fireship had to reupload the video and strip a lot of important stuff

quartz kindle
#

but you still wont be able to break it

earnest phoenix
#

pinned comment: "i haven't been harmed"
sounds a bit sus

boreal iron
quartz kindle
#

if i steal a bcrypt/scrypt/argon2 hash from a database, i will give up on the spot

boreal iron
#

I’m fully aware of how it works as I’m running such a rainbow table myself for game IDs and stupid game developers think they can hide the Steam IDs

quartz kindle
#

sure you can still run a test for weak passwords

#

that will always work regardless

boreal iron
#

Yeah that’s what I mean

#

How knows if not even the administrator uses 123456 as password :)

quartz kindle
#

no, admins use 000

#

:^)

boreal iron
modest maple
split hazel
#

I didn't notice any

earnest phoenix
#

the name of the marak dude

#

the part about securedrop

#

and the uhhh self-rip of another guy whom marak thinks is related to aaron

nocturne grove
#

Am I right that there's no way to obtain an id/timestamp of a type 5 reaction to an interaction?

#

please ping :)

neat ingot
#

anyone here use statsd? For some reason when I increment a value by 1, it doesnt actually do that. the most common increase seems to be 0.8, and i dont get why...

#

see? It somehow records 0.8 for the 'player' command usage, and then 0.2 on the following second

#

its like, it splits up the counters increase of 1? i dont get it.

earnest phoenix
#

another day of crying over css

i want the icons at the start of align to the left on mobile but it ain't working. I tried using css grid too.

.contact-ul li .button {
  display: flex;

  svg {
    justify-self: flex-start;
  }
}
#

@quartz kindle i summon thee

#

i haven't pinged tim for no reason since i stopped bot development

neat ingot
#

dont you want to justify the button content, not the button?

#

or i guess your trying to only justify the svg elements huh

#

imo, that will look wonky af, to have only the icons aligned with the text centered

earnest phoenix
#

true

neat ingot
#

those look like font awesome icons

earnest phoenix
#

but it's better than discord server expanding to the depths of left and right or worse justifying everything to the left

earnest phoenix
#

ayo tim entered chat

quartz kindle
#

do you need the word "server" there?

earnest phoenix
#

all our problems will now be gone

quartz kindle
#

just remove it

earnest phoenix
neat ingot
#

what kinda site you making mr epic?

earnest phoenix
#

aughel's portfolio but with a <body> tag instead of <article class="markdown-body">

quartz kindle
earnest phoenix
#

i should put aughel's username there too

quartz kindle
#

you can always make it a sub-choice

neat ingot
#

wth is an 'aughel's portfolio' ? 😄

earnest phoenix
quartz kindle
#

click the discord button first, differentiating the service from other services, then in a second page/modal, display the distinction between user and server

earnest phoenix
neat ingot
#

oohh, thats not too bad ::)

earnest phoenix
neat ingot
#

not the best tho, buttons dont even take you anywhere 😄

#

like, the language buttons

earnest phoenix
neat ingot
#

should tell of projects

earnest phoenix
#

ok i removed the server part

#

it looks better tbh

#

ty

#

I also added target="_blank" to the links is that okay

neat ingot
earnest phoenix
#

lmfao

neat ingot
#

gawd i love that.

#

tell me my graph isnt dope af, i dare you 😂

earnest phoenix
#

it isn't dope af

#

it's doper than top.gg fixing a bug

neat ingot
#

i actually realized top.gg had a hiring page the other day

#

i'd much rather just show off my skills and wait for a job offer than to apply tho SnorlaxDab

earnest phoenix
#
let skinss = await db.fetch(`skinss_${message.author.id}`);
                                                     ^

TypeError: Cannot read properties of undefined (reading 'id')
    at Object.run (/workspace/commands/useful/skin.js:14:54)
    at Client.<anonymous> (/workspace/index.js:127:23)
    at Client.emit (node:events:390:28)
    at MessageCreateAction.handle (/workspace/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/workspace/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/workspace/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/workspace/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/workspace/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/workspace/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:390:28)

#

why

sudden geyser
#

Cannot read properties of undefined means you tried accessing a property on an undefined value.

earnest phoenix
#

ik

#

but it's not undefined I think

sudden geyser
#

x to doubt

earnest phoenix
#

it's a command so it should exist

sudden geyser
#

That doesn't mean it can't be undefined.

earnest phoenix
#

oh