#development

1 messages ¡ Page 1950 of 1

earnest phoenix
#

Yeah I just noticed that with my other bot.

#

It's saying "Unknown application command"

#

After I edited one of the commands and re-ran it.

boreal iron
#

Yeah because registering an already registered command will cause unexpected trouble

earnest phoenix
#

o-o

#

oh my god

#

How do I fix that now? 🤣

boreal iron
#

By building a proper command handler which fetches the commands on a startup from Discord, compares it to your loaded commands from your files and either registers a missing one, updates commands which have changes or deletes registered ones which do not exist locally anymore

earnest phoenix
#

.

solemn latch
#

Doesn't djs handle that 👀

boreal iron
#

No

earnest phoenix
#

now what

solemn latch
#

Oh fun

boreal iron
#

Not that I know

earnest phoenix
#

that's more confusing than how my granny makes cookies

#

So in simple terms

#

its impossible or is a lot of work?

boreal iron
earnest phoenix
#

Cause I have no idea how to do anything of what you just said

boreal iron
#

I mean fetching and looping through your loaded commands are just a few lines of code

solemn latch
#

Oh

#

I see what you mean

boreal iron
#

Where my screenshot…

#

One second

#

Wow that goes fast

quartz kindle
#

no, heartbeats are not logins, they are normal

boreal iron
#

Ignore Tims comment on that one

#

(I mean my screenshot)

quartz kindle
#

the long ass if line?

#

xD

sudden geyser
boreal iron
#

Which endpoint manages that?

#

Im not aware

sudden geyser
#

aka that .set stuff you were seeing

boreal iron
#

Nonsense

#

Updates will be available in all guilds after 1 hour.

earnest phoenix
#

I'm reading the docs and nothing explains that -

boreal iron
#

You don’t overwrite existing commands if that’s not required

earnest phoenix
#

So what would I do to fix this:

client.once('ready', () => {
  console.log('Ready!');
  const CLIENT_ID = client.user.id;
  const rest = new REST({
    version: '9'
  }).setToken(CLIENT_TOKEN);
  (async () => {
    try {
      if (true) {
        await rest.put(
          Routes.applicationCommands(CLIENT_ID), {
            body: commands
          },
        );
        console.log('Successfully registered application commands globally');
      } else {
        await rest.put(
          Routes.applicationGuildCommands(CLIENT_ID, MAIN_SERVER_ID), {
            body: commands
          },
        );
        console.log('Successfully registered application commands for development guild');
      }
    } catch (error) {
      if (error) console.error(error);
    }
  })();```?
#

That loop thing? but I have no idea how to do that. 🤣

boreal iron
earnest phoenix
#

Right here, this is what I'm using.

sudden geyser
#

Are you building traditional commands (message intent) for that not to apply?

earnest phoenix
#

o-o I'm using what is directly in there 🤣

sudden geyser
#

referring to fake :p

earnest phoenix
boreal iron
#

Wut? Took a shower real quick

boreal iron
quartz kindle
#

you shower in under 5 mins?

#

thats fast

sudden geyser
#

I was going to ask that too

boreal iron
#

No I was actually writing while taking a shower

quartz kindle
#

lmao

boreal iron
#

But using soap and a phone is getting too complicated freerealestate

#

Ya ya… I know coders usually never take a shower or use soap

#

But once in a month, you know

quartz kindle
#

wdym, i shower every 2-3 days

#

:^)

boreal iron
#

Shh

quartz kindle
#

normal people in brazil shower 2-3 times a day

#

but im european

#

huheuheuehue

boreal iron
#

No! Not anymore, traitor

quartz kindle
#

gibe mi mĂ´ney pleasi

boreal iron
quartz kindle
#

i report iu

boreal iron
#

Not if I report you first, ha! How does that taste, Sir

quartz kindle
#

mordekaiser es numero 1
HUEHEUHEUEHUEHUEHEUHEUEHUEHUEHEUHEUEH
EHUEHUEHEUHEUEHUEHUEHEUHEUEHUEHEUE

earnest phoenix
#

Okay.

#

So now I've swapped to this, but it doesn't "register" new commands, it reloads them.

#
client.once('ready', () => {
    console.log('Ready!');



const clientId = '708198760408416256';

   const rest = new REST({ version: '9' }).setToken(CLIENT_TOKEN);

(async () => {
    try {
        console.log('Started refreshing application (/) commands.');

        await rest.put(
            Routes.applicationGuildCommands(clientId),
            { body: commands },
        );

        console.log('Successfully reloaded application (/) commands.');
    } catch (error) {
        console.error(error);
    }
})();
                      })```
#

so, this loop thing fake, I'd assume it involves that in a way^?

solemn latch
#

applicationGuildCommands needs a guild id

earnest phoenix
#

it does?

#

but its not for a specific server.

#

its global

solemn latch
#

then applicationCommands is what you want

#

I dont think that goes in the ready event either 👀

boreal iron
#

Or simply use the inbuilt methods like I mentioned a million times already

earnest phoenix
#

Well it works 🤣

earnest phoenix
boreal iron
#

client.application.commands.create(…);

earnest phoenix
#

uh what

earnest phoenix
#

so just smack that in there and call it good? Cause idk what to put in replace of the ...

#

....

#

That guide makes no sense

#

It's alr made

#

I'm using rest

#

So it has a description in it.

#

That isn't helpful --

boreal iron
solemn latch
#

👀 isnt it weird the guide suggests a weird round about way when djs itself has its own methods

earnest phoenix
boreal iron
#

And especially those docs are providing examples to work with

earnest phoenix
#

the create method

#

is saying to create a new one

#

Not what I want.

#

It already should do that on ready.

#

The command file n stuff is already made.

boreal iron
#

Lots of the guide is okay and lots of it is straight bullshit like the process of dealing with slash commands

earnest phoenix
#

mhm

boreal iron
#

But even more complicated

earnest phoenix
#

still confused but okay

boreal iron
#

And both is not what you need

earnest phoenix
#

how can it detect if their is a new command and just create it?

#

Wouldn't that be the damn easy way? 🤣

boreal iron
#

Yes as I mentioned above

earnest phoenix
#

there*

boreal iron
#

That’s how it works

earnest phoenix
#

omllll

#

I don't understand that tho

#

It makes literally 0 (no) sense.

#

so this

#

client.application.commands.create({

#

it'll create a command that is not already created or what?

#

Rest does that perfectly fine

boreal iron
#

It will register a new command

earnest phoenix
#

That's what the commands look like

#

So it's not making much sense if the command is already there, and created. But its not created?

#

It's still making no sense tho

#

Wouldn't .create just make a copy of all of them?

#

The name

#

Description

solemn latch
#

why not use set?

earnest phoenix
#

All of that is already made within the actual command file.

earnest phoenix
# solemn latch why not use set?

Why not we use the simple way and use rest 🤣 I don't wanna use the native Discord ones when the Djs guide directs me to rest.

#

I already have it able to reload.

earnest phoenix
#

I just need rest to be able to create if the command isn't already created which if it is already created will then proceed to just reload them.

#

I don't wanna chase my own tail using these .create thingy's when I do not understand them one bit.

#

Like, its saying a specific one.

#

client.application.commands.create({
name: 'test',
description: 'A test command',
})

#

Right there.

boreal iron
#

Registering a command to discord is just telling discord the command name, description and options if available

earnest phoenix
#

name: angegei
desc: getet

When those are already in the command file.

earnest phoenix
#

Literally in the exports.

boreal iron
#

You don’t seem to understand the difference between the user interaction you need to respond to and the actual registered command Discord needs to show it in the guilds UI

earnest phoenix
#

holy still didn't understand a word of that, that just made it even more confusing.

boreal iron
#

Your command module structure is not far off

#

You load all your command modules (files), save them into a map for example and use this map to register non-registered commands or update registered commands if an update is required

An interacting user - running your slash command - does trigger the interaction_create event which fires your command modules execute function

earnest phoenix
#

I have no idea how to use maps either btw.

#

Just another thing

#

Istg if you point me to a docs 😭😂

boreal iron
#

Doesn’t matter can also be an array

solemn latch
#

pretty sure you already use a map

earnest phoenix
#

Idek how to do that

solemn latch
#

yeah you use a map

earnest phoenix
#

Also

#

That's makes again no sense.

#

Why would I have it trigger a interactiomCreate

#

When I can just check if they're already made on the 'ready'

#

Your throwing me in a complete different direction than what I wanna go 😂😭

boreal iron
#

At this point I really wanna recommend learning the basics of JS and trying and testing own written code
You won’t really get forward by just copy and pasting stuff which doesn’t work as supposed to

solemn latch
#

interactionCreate only fires if a user uses an interaction

earnest phoenix
earnest phoenix
# boreal iron Wut?

Why would I on god's green earth, move it into the interaction create when it can just create them on ready?

#

Why wait for someone to use a command.

#

Makes no sense to me tbh

#

Just another sign pointed in the wrong direction 😂😂

boreal iron
#

You need to stop mixing up the registration process and user interactions

solemn latch
#

👀 typically you do it before on ready

#

registering*

boreal iron
#

Before all your code and interaction reply shit takes in place, you have to register your command - in other words tell discord your command name, description and optionally it’s options to let Discord SHOW them if you enter a /

#

In simple words

earnest phoenix
#

I already did tell discord inside the command file

#

What am I not getting

boreal iron
#

No you didn’t

earnest phoenix
#

I didddd

#

Options

#

Desc

#

Name

#

All in the command.

boreal iron
earnest phoenix
#

Mhm

#

Yep

#

There.

boreal iron
#

This does not register a command

earnest phoenix
#

Clearly, but it does something.

#

Can you link an example or something? Your words are confusing me 😂

boreal iron
#

This builder methods just create an object not more

#

Have you ever console logged an embed?

earnest phoenix
#

Mhm

#

Like once.

boreal iron
#

You will magically see the structure- it’s just an object

earnest phoenix
#

Yeah

boreal iron
#

That’s what you do in your command file

earnest phoenix
#

☠️ confused as hell

boreal iron
#

data: …

earnest phoenix
#

Mhm

#

Yep

boreal iron
#

Is your slash command object

earnest phoenix
#

Well yeah

boreal iron
#

But this module does not register the command or anything

earnest phoenix
#

Mhm

boreal iron
#

That’s what you’re doing with the screenshot you sent before

earnest phoenix
#

Wymmmmm?!?

boreal iron
#

With the copied bullshit from the guide

earnest phoenix
#

Tbh imma just use normal prefix commands at this point 😂 slash commands make no sense and this makes me hate em more

solemn latch
#

normal prefix commands wont be usable soon

boreal iron
#

Well they make no sense for you because you completely mixing up any stuff

solemn latch
#

unless you get message content intent, which that bot you linked above wont get

earnest phoenix
#

Eh

#

Then looks like my development career is gone 😂☠️ just like that.

#

I'm done trynna understand this, I don't get it one bit 🤣

solemn latch
#

🤷‍♂️ just code what you want to code.
if its not perfect its not perfect

boreal iron
#

I don’t actually know how else to explain what a registration is and what the response in your code to the actual user interaction is

earnest phoenix
#

If it's doesn't work, it doesnt work, all I came here was was for a simple answer and fix, no I gotta go chasing a tail because I'm not doing it right.

#

Anywho, see ya it's night here

boreal iron
#

Well yeah the more stuff you copy and mix will result in even more issues, unfortunately that’s how it is

earnest phoenix
#

The guide is meant for copying FakE 😂😂😂😂

#

That's why it's called a guide.

#

It points you in the right direction and shows you how.

boreal iron
#

If you’re not willing to sit down and learn/study the stuff it will end up sadly

earnest phoenix
#

I am right now.

#

Your taking me 25 miles from where I wanna go.

boreal iron
#

Well even if don’t agree with it’s meant to be copied, yeah it may is but you at least need to know what the copied code does

#

The guide does even differentiate between global and guild commands and has code examples for both but you copied the first you saw and you wonder why no global command is being registered successfully

wheat mesa
#

Copy pasting from the guide just because it’s a guide is like following directions off of a cliff just because it’s from your GPS so it knows best

#

You gotta have a little independence and realize when something isn’t as right as it can be

#

Which takes time to learn

#

And that’s perfectly ok

boreal iron
# earnest phoenix

Take a look and my command module structure, it looks "similar" to yours except I don’t use that useless builders I write the object per hand

{ name: "command name", description: "…", options: null }

Is what your helper tools creates, not more or less

And that’s (this object) is what you send to Discord to register the command

solemn latch
#

I'm still why not just use set

#

That wasn't english

#

I tried

boreal iron
#

Don’t start the same discussion as Klay

#

Bulk update doesn’t replace a proper handling of creating or deleting commands

solemn latch
#

It says it does

boreal iron
#

How do you think you can delete a command then?

solemn latch
#

Or well it shows removing and adding commands with it

mellow marlin
solemn latch
#

Maybe I'm misreading the examples though

boreal iron
#

you should actually read the real meaning of it

#

Why do I want to overwrite any application command with its 1 hour delay ?

solemn latch
#

It's one hour delay either way isn't it? 👀

#

For global

pale vessel
#

There's no one hour delay unless you're deleting (iirc) OR adding commands

#

Updating it will work the second time you try to use the command you updated

#

At least for me, 100% could confirm

boreal iron
#

Deleting shouldn’t have a delay, too afaik

pale vessel
#

First time it'll say invalid application command but it actually updates it

earnest phoenix
#

So uh, I assume this is one of the side effects?

earnest phoenix
boreal iron
#

Fetching the commands and update/delete a single command if required doesn’t have that consequences

solemn latch
#

But it works while being simple though, which seems to be their goal(not everyone has the same goal)

earnest phoenix
boreal iron
solemn latch
#

Sure, and the bulk set exists for a reason.

boreal iron
#

Yeah to bulk update more than one command if needed instead of sending tons of single patch API requests

solemn latch
#

Which is what they seem to be doing, right?

#

That code block they showed is for re-registering all their commands, and what the guide suggests it's for.

So I guess I presumed that's what they are doing

boreal iron
#

Well it seems we have a different option here but overwriting content without a reason and living with downsides like invalid command warnings instead of correctly dealing with what needs an update and what not doesn’t seem to right for me, easy doesn’t mean okay

pale vessel
#

It only errors if the command's schema actually updated

#

I believe

boreal iron
#

The code block in the guide is not meant to be added in your code to be run on any startup

solemn latch
#

Which is probably an issue with the api, not the set.

boreal iron
#

They just show an example how to manually register commands

boreal iron
#

But yeah once again overwriting things on force without a reason doesn’t seem to be needed and I wouldn’t do it or recommend it

#

Especially because of that

#

This will overwrite all types of application commands

#

But I see we will not agree on this part, which is okay for me

#

But it doesn’t change the fact that he had no clue what code actually does he copied and the difference between registering the application command and replying/responding to it

#

Which is still the core of the discussion

solemn latch
#

I wonder what are the odds a bots commands are stored in a single database column, and needs to be entirely set again on any update to a bots commands.

Seen a few open source projects that do that for whatever reason(db limitations?). Probably not likely on a discord scale right? 👀

boreal iron
#

Actually a good point to protect my standpoint

#

Fetching the commands to figure out in my code if an update is required or not, results in a READ process of Discord’s database

#

Forcefully overwriting the commands on any startup requires a WRITE process

solemn latch
#

Either way they need to read the same amount of data thought?

boreal iron
#

And if it’s technically not needed it is nonsense, in my mind

solemn latch
#

Oh I see what you are saying

boreal iron
#

There’s a difference between reading and writing oldEyes

solemn latch
#

But you can use bulk set without setting on startup.

#

Wym, they need to read each bot command on any command patch right?

#

No matter if its bulk set or single patch(or post)

#

Afaik

#

Actually not on patch right? Hmm ^_^

#

Since patch requires including the command id

boreal iron
#

Not sure how they’re actually store it
I guess our simple relational thinking of how it’s stored especially if you speak about it being written into a single column is far away from reality

#

But more and more assuming than knowing

solemn latch
#

Well, single column would be faster for read wouldn't it?

#

99% of the time these are reads.

boreal iron
#

I fucking need to sleep freerealestate

solemn latch
solemn latch
#

If Tim was here he would have given us the exact number of optimal instructions either way.

quartz kindle
#

@_@

solemn latch
#

Hi tim

quartz kindle
boreal iron
#

Just wanna say on a technical point of view, bulk updating (overwriting each command) requires READ & WRITE processes on any command (if not stored as bulk)

Fetching all commands just requires a READ process and a WRITE process only when I update a command if needed

quartz kindle
#

true if you dont account for network overhead and latency

boreal iron
#

Shut up

quartz kindle
#

lmao

boreal iron
#

That’s not part of the discussion

#

Or I will get no sleep at all

solemn latch
#

I would have no input on that anyway.
That's above me ^_^

round cove
#

What's the topic now.

boreal iron
#

Just mute Tim for the next 69min then

#

lol how did that get a 69

quartz kindle
#

no need i go sleep

#

since you wont

solemn latch
boreal iron
#

fuck it I go sleeping too

solemn latch
#

Gn folks

round cove
#

Bulk setting meaning?

boreal iron
#

Woo has managed to break me

round cove
#

Like sending the JSON?

quartz kindle
#

bulk = bull + elk

boreal iron
#

lmao

solemn latch
#

^

wheat mesa
#

I’m curious tim

round cove
#

I mean it makes sense.

wheat mesa
#

Did you stay up until almost 6am or did you just wake up really early KEKW

quartz kindle
#

when?

crimson vapor
#

he says he needs to sleep so I assume he is just still up

boreal iron
#

6 am oldEyes

crimson vapor
#

also what timezone is Tim in?

round cove
#

dn

quartz kindle
#

its 2am for me lol

crimson vapor
#

Brazil?

wheat mesa
#

Oh wait

quartz kindle
#

yes

wheat mesa
#

I was thinking u were in EU

crimson vapor
#

did you recently move?

boreal iron
#

He got thrown out

quartz kindle
#

about 3 months ago

round cove
#

most of south america in 2am

crimson vapor
#

oh

#

most of south america is brazil

quartz kindle
#

i was demoted from gold to bronzil

round cove
#

Well

#

Brazil has four time zones

#

So like lol

solemn latch
#

Sucks starboard doesn't work

boreal iron
#

I’m sure you’re posting pictures on Facebook and sitting there the whole day long waiting for somebody to hit the like button

#

And you’re sad if nobody likes it

#

Ha! Got you again Sir

quartz kindle
#

whoever you're talking about aint me

boreal iron
#

Obviously Woo wtf

#

Get your sleep

#

This discussion has cost me 2h of my sleep cycle ffs

quartz kindle
#

weee wooo weee wooo weee wooo

#

its da police

solemn latch
#

👀 spooky

quartz kindle
#

go sleep

#

nao

boreal iron
#

Sir Yes Sir! I do

#

Have a good one

quartz kindle
#

i go too kthxbye

wheat mesa
#

I’m on break so I can go to bed at 4 and wake up at 3 like a cat so freerealestate

boreal iron
solemn latch
boreal iron
#

Sorry can’t live without being rude to you

wheat mesa
#

That’s very woo-d of you

#

Ok I’ll climb back into my hobbit hole

boreal iron
#

I’m sure woo can take it

solemn latch
#

Kek doesn't bother me

boreal iron
ruby dragon
earnest phoenix
#

gotta love when js code doesn't load into the discord website

modest maple
#

Thats just JS in any situation

earnest phoenix
#

yeah

#

my fucking window.close won't work and i don't know what permission i need for that

#

website development bruh

#

so annoying

#

WHAT THE FUCK

#

little shi

#

when executing window.close() in the terminal it works but on websites it doesn't

#

hella weird

signal estuary
#
message = await inter.reply({ embeds: [embed], components: [row], fetchReply: true })
const filter = (filter) => {
  if (inter.user.id === filter.user.id) return true
  return filter.reply({ content:'you cant do that', ephemeral: true })
}
const collector = message.createMessageComponentCollector({ filter: filter })
  collector.on('collect', async i => {
  switch (id) {
  case 1:
    if (num === 1) return i.deferUpdate()
    ...
    break;
  case: 2:
      if (num === 2) return i.deferUpdate()
      ...
      break;
})

I have a problem: When num is 2 and the case is 2 if makes a defer update. But when I press a second time no matter which button it says:

DiscordAPIError: Unknown interaction
  method: 'post'
  code: 10062,
  httpStatus: 404,
  requestData: { json: { type: 6 }, files: [] }

The same thing when the case is 1 and the num is 1 too. At first it makes a defer Update and it all works fine. But when I press another button no matter which one it says unknown interaction again

Whole code: https://pastebin.com/2rhXWhAd

earnest phoenix
#

How do you get the search bar content for a chrome extension?

#

like this search bar

spark flint
earnest phoenix
#

oh okay

spark flint
#

See if that bar input has a unique id

earnest phoenix
#

okay

spark flint
#

If so you can get it

earnest phoenix
#

okay

eternal osprey
#

how would i read the last line of a txt file?

modest maple
#

for a big file, or for a small file that fits into memory?

earnest phoenix
#

How can I get a picture in vsc that I have as a .png with code for js

quartz kindle
#

wat

modest maple
#

certainly one way to respond to that

earnest phoenix
#

yeah

quartz kindle
#

you're gonna have to explain better because i have no idea what you just said

earnest phoenix
#

yeah

earnest phoenix
#

Though it depends on what you are doing with the picture

quartz kindle
#

a picture from the internet?

#

you have to download it using any http lib, like node-fetch, axios, etc

earnest phoenix
#

I think he already has it downloaded

#

He specified it was a png file so I assume it is already downloaded

#

Yeah, it's downloaded on my folder

quartz kindle
#

then read the file using fs

earnest phoenix
#

Okay

heavy marsh
#

Got a small problem where can I find the intends I need

#

I mean I am not so sure what I will be needing

sudden geyser
#

Depends

#

Your library may have an intents list

heavy marsh
#

There is a website right

#

For d.js

sudden geyser
#

Yep there

#

Under .FLAGS

#

You'll supply your intents when initializing your client

heavy marsh
#

I mean mine is a music bot

#

GUILD_INTEGRATIONS = slash commands right?

quartz kindle
#

no

#

slash commands do not use the intents system

#

you dont need any intent for slash commands

heavy marsh
#

when for a music bot

sudden geyser
#

Intents are for receiving data.

#

They're not for creating data.

heavy marsh
#

I mean I am gonng to set the prefix for the bot mention as its allowed

sudden geyser
#

You'll need to look through the intents and determine what you think your bot will need. For example, GUILD_VOICE_STATES may be useful.

#

But if I had to assume, you probably won't need it.

quartz kindle
#

not only useful, but required

heavy marsh
#
GUILDS
GUILD_INTEGRATIONS
GUILD_VOICE_STATES
GUILD_MESSAGE_REACTIONS
DIRECT_MESSAGE_REACTIONS
DIRECT_MESSAGES
#

@quartz kindle Sorry for the ping.
Is this all or are sone not needed

#

some*

quartz kindle
#

do you need to see when random people start typing?

heavy marsh
#

<@mention> help - Commands

quartz kindle
#

do you need to see when random emojis and stickers are updated by their guild admins?

heavy marsh
#

that no

quartz kindle
#

like "xyz is typing..."

heavy marsh
#

ooh that is what it means

quartz kindle
#

yeah

#

also, you dont need integrations

heavy marsh
#

integrations = what

quartz kindle
#

some weird crap nobody understands

heavy marsh
#

rip

#

PRESENCE INTENT & SERVER MEMBERS INTENT & MESSAGE CONTENT INTENT
Is not needed right

#

So the final list is ```
GUILDS
GUILD_VOICE_STATES
GUILD_MESSAGE_REACTIONS
DIRECT_MESSAGE_REACTIONS
DIRECT_MESSAGES

quartz kindle
#

you can check it yourself

#

you probably want GUILD_MESSAGES

heavy marsh
quartz kindle
#

no

heavy marsh
#

DIRECT_MESSAGE_REACTIONS Need this right if your using a reaction system

quartz kindle
#

yes

#

although you should probably move away from reactions and use buttons instead

heavy marsh
#

Yes true but I dont like the buttons

earnest phoenix
spark flint
#

(its a mockup i made)

modest maple
#

anything you can do with css you can do with tailwind mmLul

#

but from top thoughts

#

either a relative-absolute container combination

#

or

spark flint
#

would it be easier for me to make them as an image/svg pain

modest maple
#

translation

spark flint
#

alright

#

am i the only one who makes website mockups

#

before making the website

modest maple
#

no

earnest phoenix
#

no

#

a lot of people dont as well tho

#

Okay hear me out, my last handler sucked dooty, so I swapped to commands that look like this:

module.exports = {
    name: 'move',
    description: 'Move a Thread.',
   options: [{
        name: 'category',
        type: 'STRING',
    description: 'Input a Category Name.',
     required:true,
    }],
  
    async execute(interaction, client) {```

But how would I make **SubCommands** using that?
#

You could make one of the props be for subcommands and you could then also tie those subcommands to methods in it?

#

._. what

#

So something like

module.exports = {
    name: 'move',
    description: 'Move a Thread.',
    subCommands: ['show']
   options: [{
        name: 'category',
        type: 'STRING',
    description: 'Input a Category Name.',
     required:true,
    }],
  
    async execute(interaction, client) {},
    async show(interaction, client){}

Something similar to a framework I used to use did it this way

#

ahh

#

but what if a sub command needs a string?

#

Wdym?

#

What if the sub commands need options as well?

#

like /move show category: blah

#

Mmm, good question It was just an idea I thought of off the top of my head

#

Ah yea

#

Not to mention I am more used to using classes for commands so it would be a lot easier for me to come up with a method for a class :p

#

lol

#

I was thinking something like a option yk?

#

You could probably do something like a lookup.

#
    subCommands: [{
name: 'name',
descripion:'description',

}]
#

You could probably do that yea

#

Like all that within the Sub command and just add a option?

#

You would just have to register all sub commands as well

#

I don't think I can add a option within a alr existing {..} huh?

earnest phoenix
#

You can

#

It wont bother it

#

That's the first thing on my command handler I fixed.

earnest phoenix
#

Ig I'll just go have to try some things hah

#

but if I did that

#

How would I fetch the sub command & its option?

#

I think if anything that is a decent way of doing it

earnest phoenix
#

If it actually works 🤣 I'll go try some things

#

Okay yeah that worked.

#
  subCommands: [{
    name: 'create',
    description: 'Create a Snippet',
    options: [{
      name: 'name',
      type: 'STRING',
      description: 'Input a Snippet Name.',
      required: true,
      name: 'description',
      type: 'STRING',
      description: 'Input a Snippet Description.',
      required: true,
    }]
  }],```
#

Noice

#

Okay, I have no clue how I'm even doing thsi rn

#

I've hit 2 429 Errors.

#

Meaning I've been timed out or temp banned 2 times.

#

But I'm barely editing it.

#

The limit of edits is 1000, I've used 11, and I'm already hitting a 429?

solemn latch
#

👀 I dont think you hit the daily limit

earnest phoenix
#

Why am I getting a 429 then?

#

That means I'm temp banned correct?

solemn latch
#

thats not the only ratelimit

#

the timeout appears to be for 40 seconds

#

possibly sending put requests too fast

earnest phoenix
#

Probably lol.

#

should this be happening?

modest maple
earnest phoenix
#

It's firing the event when nobody is messaging it.

earnest phoenix
modest maple
#

oh you instansiating ws connections

#

sorry i was on interactions mode

#

wait nvm not it is interactions

#

yeah its not 1000

#

the 1000 is how many websocket logins you can do in total per day

#

the remaining value is how many logins you can make for the rest of today

#

that's not what's 429'ing

earnest phoenix
#

The application commands are.

modest maple
#

you're 429ing from sending a PUT request to a specific guild's application command

earnest phoenix
#

Because I am put'ting them to fast.

modest maple
#

yes

earnest phoenix
#

but now.

#

It's firing my messageCreate

#

W/o anyone sending a message.

modest maple
#

you probably have a cycle somewhere

earnest phoenix
#

Ahh, I swapped to a new handler, I was logging a general messageCreate and not on DM, I also forgot to add DM Type Intents.

#

So uhh, yeah this happened

#
for (const file of commandFiles) {
  const commandfile = require(`./commands/${file}`);
  client.commands.set(commandfile.name, commandfile);
  data.push({
    name: commandfile.name,
    description: commandfile.description,
    options: commandfile.options
  })
}
client.once('ready', () => {
  console.log('Ready!');
  client.guilds.cache.get('834615041537867806')?.commands.set(data)
})```
Although I'm not creating multiple with this, am I?
earnest phoenix
# earnest phoenix

That happens when the global slash-commands and the guild commands with the same names conflict, or if that's not the case, it can also be caused by your Discord client, try reloading it, if reloading does not fix it, then it's the first case, you can delete the global ones or the ones on the guild to fix that

#

It is caused due to the global commands also loading

#

If he goes to another server and invites the bot it would not dupe

#

So, ultimately just make em global and not guild tbh?

#

It doesn't matter what you do

#

After you are done testing you can remove the guild commands if you want and the global will remain

#

I can remove all guild commands right n just 1 line? w/o going though and putting each id?

#

is there a way to do that? 🤣

#

Choose one of them, if you want to test the slash-commands out, I recommend registering them to the guild since they get cached instantly while global slash-commands take an hour to be cached

#

Yep

earnest phoenix
#

Though registering them as guild commands also seem to register them globally

#

It just prioritizes one guild

earnest phoenix
#

Guild Commands are instantly loaded

#

Ahh

earnest phoenix
#

Global commands take up to an hour to finally appear in the cache

earnest phoenix
#

^

#
for (const file of commandFiles) {
  const commandfile = require(`./commands/${file}`);
  data.push({
    name: commandfile.name,
    description: commandfile.description,
    options: commandfile.options
  })
}
client.once('ready', () => {
  console.log('Ready!');
  client.guilds.cache.get('834615041537867806')?.commands.set(data)
})```
So that?
#

Pass an empty array instead of the data variable

#

so nothing in .set(*here*)

#

nothing there^?

#

pass an empty array

#

as he said

#

[]

#

Done.

#

Yeah I had to think lol

#

Only do this if you are done testing though

#

No point in doing it now

#

It didn't delete all of em

#

Maybe because they're already globally loaded?

#

They were loaded both globally and in that specific guild, you've deleted all of the guild slash-commands by calling that, so now only the global ones remain

#

ohh okay.

#

Keep in mind though if you wanna make more slash commands you have to load them respectively either guild (for testing) or global

#

Ahh, okay, tysm

#

SO just like

#

If I wanna test

#

add back the guild n test that one command

#

but if I am good n they're all set, just load global?

#

bettt

#

ty

spark flint
#

why is that happening

earnest phoenix
#

what is happening

spark flint
#

the image is cut off

earnest phoenix
#

the g part?

spark flint
#

yes

earnest phoenix
#

line-height: normal;

#

if stackoverflow says it works, it works

spark flint
#

yep that worked

#

pogger

#

@earnest phoenix do you like the design angery

#

i made the categories bit smaller

earnest phoenix
#

to the point i can't see them

spark flint
#

i haven't added the categories yet

#

i have the images, just need to make the row and add them

earnest phoenix
#

suggestion: use a flexbox instead of grid

#

so it automatically wraps to the next line on smaller screen

spark flint
#

how do i do that

#

ok

#

i have 4 images

cinder patio
#

why is that an image anyways?

earnest phoenix
#

to fuck accessibility ofc

feral aspen
#

What does this mean?

spark flint
#

idk how to make it work in html

cinder patio
#

that's easily doable man

earnest phoenix
#

fieldset

#

legend

#

what about the star

spark flint
#

its a star image on top

#

idk how

cinder patio
#

images on top alright, talking about the border and text

spark flint
#

yeah

feral aspen
cinder patio
#

Oh so only the star is in the image? or what

spark flint
earnest phoenix
#

try

<fieldset>
<legend><img role="presentation none" src="https://star img" /></legend>
<h3>Starboard</h3>
<p>ultra cool starboard that ACTUALLY works</p>
</fieldset>
#

Is it possible to get a user's IP with js? (chrome extension)

earnest phoenix
#

okay

cinder patio
#

But why is "Categories" an image

earnest phoenix
#

he styled it with css so

cinder patio
#

he said "the image is cut off'

earnest phoenix
#

me when the css has ocr

cinder patio
#

there aren't any fields in ther lmao

earnest phoenix
#

yes but it works

spark flint
#
        .name {
            background: url("https://static.capy.host/9o4rrC4e.png") repeat;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }```
lyric mountain
#

User can always use vpn

earnest phoenix
#

Oh

lyric mountain
#

And there are some other things that can end up messing the passed ip

earnest phoenix
#

true

sudden geyser
#

should you really be using vendor prefixes

earnest phoenix
#

@spark flint

#

it works

#

took some css but it works

spark flint
#

oh pi

#

oh pog

earnest phoenix
#
<!DOCTYPE html>
<html>
<head><style>fieldset {text-align: center;} legend img { width: 5rem; height: 5rem; }</style>
<title>Page Title</title>
</head>
<body>
<fieldset>
<legend><img role="presentation none" src="/favicon.ico" /></legend>
<h3>W3Schools</h3>
<p>Terrible website. Don't go there</p>
</fieldset>
</body>
</html>
#

TEST THIS IN AXE DEVTOOLS

#

NOW

#

I DO NOT WANT TO TEACH PEOPLE INACCESSIBLE CODE

spark flint
#

how do i style it white

earnest phoenix
#

don't forget the fieldset part otherwise it will style every h3 and p tag on the page

spark flint
earnest phoenix
#

oh wait
i thought you meant the text lmfoa

spark flint
#

how do i add a gap between each one tho

spark flint
earnest phoenix
#

tailwind pain

edgy thicket
#

hey I have a bot that I need for my company's discord. I have asked a couple people for help with it but it seems to be very difficult. It is a channel countdown bot that show up as a locked voice channel. It needs to countdown to 8am monday and then restart and do it over.

#

If anyone thinks they could make this I am looking to hire

earnest phoenix
#

You can use a cron job and lock/unlock the vc

#

or something similar to a cron job

heavy marsh
#

Got a small error on d.js v13

const chalk = require("chalk");

Error: ```
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\bla\bla\Discord Development\Public\Radio_X_Alpha\node_modules\chalk\source\index.js from C:\Users\bla\bla\Discord Development\Public\R
adio_X_Alpha\tools\Logger.js not supported.

earnest phoenix
#

That has nothing to do with djs tho

earnest phoenix
earnest phoenix
#

New versions of chalk use ESM instead of require()

#

😩

lyric mountain
heavy marsh
earnest phoenix
#

Cron jobs execute tasks every x time and usually are done on a separate process

lyric mountain
#

Second-precise? Forget abt it
Minute-precise? Maaaaybe
Hour precise? That's fine

edgy thicket
#

not super precise

#

like every 5 or 10 minutes is ok

lyric mountain
#

It's fine then

#

If it'll be a private bot

modest maple
#

well, you realistically only want to edit the channel every 10 minutes

lyric mountain
#

And a single channel

edgy thicket
#

we have a server already

earnest phoenix
#

Wait did I mistake what they wanted 😩

edgy thicket
#

like a discord server and a server with pebble

earnest phoenix
#

I am too tired ima head out of the dev channel

modest maple
#

and you can litterally only edit the channel twice per 10 minutes although that still seems to potentially be more restrictive

lyric mountain
#

Tf is pebble?

modest maple
#

oh noe

edgy thicket
#

i have NO CLUE about any of this

#

pebble is some server my company has for discord bots

sudden geyser
#

I think the op wants someone to develop a bot for them with that capability.

edgy thicket
#

lol why?

heavy marsh
lyric mountain
#

Maybe s/he could be directed on how to do it

earnest phoenix
lyric mountain
#

And since the task was assigned to them, I deduce that there has to be some programming background there

modest maple
heavy marsh
#

Thank you though

modest maple
#

fuck

#

karma

heavy marsh
#

Dum me

#

Any way thanks

sudden geyser
spark flint
#

@earnest phoenix ty that code worked

earnest phoenix
#

you're welcome

edgy thicket
#

ok thanks

spark flint
#

happy new year topggers

earnest phoenix
spark flint
#

ers

sudden geyser
#

topggers
cringe

earnest phoenix
#

topggians

sudden geyser
#

also cringe

earnest phoenix
#

topgang

sudden geyser
#

better

earnest phoenix
#

Yes

sudden geyser
#

topggista

quartz kindle
#

topggay

earnest phoenix
#

top

real phoenix
#

Alright. I have some code here that does reaction roles. Why is the keep_alive() returning an unexpected unindent error?

#
@client.command()
async def roles(ctx):
  embed=discord.Embed(title="Reaction Roles", description="React with the corresponding emoji to get the role", color=0xff0000)
  embed.set_author(name="Joca Management", icon_url="https://images-ext-1.discordapp.net/external/CxjorkQC8xvkLM-OeH78kpf_yP2LNGUYCEltqM3Iomc/%3Fsize%3D128/https/cdn.discordapp.com/avatars/638089573687099442/a9e972fcae9dd9b581da9f9e4f21fb26.png")
  embed.add_field(name=":red_cirle:", value="Red", inline=True)
  embed.add_field(name=":orange_cirle:", value="Orange", inline=True)
  embed.add_field(name=":yellow_cirle:", value="Yellow", inline=True)
  embed.add_field(name=":green_cirle:", value="Green", inline=True)
  embed.add_field(name=":blue_cirle:", value="Blue", inline=True)
  embed.add_field(name=":purple_cirle:", value="Purple", inline=True)
  msg = await ctx.send(embed=embed)
  await msg.add_reaction(':red_circle:')
  await msg.add_reaction(':orange_circle:')
  await msg.add_reaction(':yellow_circle:')
  await msg.add_reaction(':green_circle:')
  await msg.add_reaction(':blue_circle:')
  await msg.add_reaction(':purple_circle:')
  
  def check(reaction, user):
    return user == ctx.user and reaction.message == msg and str(reaction.emoji) in [':red_circle:',':orange_circle:',':yellow_circle:',':green_circle:',':blue_circle:',':purple_circle:']

  while True:
    try:
      reaction, user = await client.wait_for("reaction_add", check=check)

      if str(reaction.emoji) == ':red_circle':
        mrole = discord.utils.get(ctx.guild.roles, name='Red')
        await user.add_roles(mrole)
        print ('gave a role to someone')
  
keep_alive()
client.run(token)
sudden geyser
#

You seem to have some indentation above it.

real phoenix
#

is it wrong?

sudden geyser
#

Notably

real phoenix
#

so just remove that

sudden geyser
#

I don't know if it's causing the error, but if I had to give advice, try removing it.

real phoenix
#

i did

#

it didn't help

sudden geyser
#

That's interesting.

real phoenix
#

also tried adding a matching indent above it since its an unindent error but that didn't help

spark flint
sudden geyser
#

I think it's due to the try block

#

You don't have an except: in there, so it's looking for it.

real phoenix
#

hmm

sudden geyser
#

Which causes it to look at keep_alive and get confused about its indentation.

real phoenix
#

Soo where should I add the except:

sudden geyser
#

In the same scope as the try, like so

real phoenix
#

ty

sudden geyser
#

By the way, you can improve your code by applying loops to add embed fields and message reactions.

real phoenix
#

oh ok

#
while True:
    try:
      reaction, user = await client.wait_for("reaction_add", check=check)

      if str(reaction.emoji) == ':red_circle':
        mrole = discord.utils.get(ctx.guild.roles, name='Red')
        await user.add_roles(mrole)
        print ('gave a role to someone')
    except: Exception as e:
      pass

like so?

sudden geyser
#

You don't need the colon after except

real phoenix
#

wot

sudden geyser
#

Your bot shouldn't send typing indicators when using interactions to my knowledge.

#

If you want it to.

real phoenix
#

alr so I have another issue. Its saying that positional arguments and one keyword was passed.

#
@client.command(pass_context=True)
async def ticket(ctx):
    guild = ctx.guild
    embed = discord.Embed(
        title = 'Ticket system',
        description = 'React 📩 to make a ticket.',
    )

    embed.set_footer(text="React to create a ticket")

    msg = await ctx.send(embed=embed)
    await msg.add_reaction("📩")
    reaction = await msg.fetch_message(msg.id)

    def check(reaction, user):
      return str(reaction) == '📩' and ctx.author == user

    await client.wait_for("reaction_add", check=check)
    await guild.create_text_channel(name=f'ticket - {ctx.author}')
#
@client.command()
async def roles(ctx):
  embed=discord.Embed(title="Reaction Roles", description="React with the corresponding emoji to get the role", color=0xff0000)
  embed.set_author(name="Joca Management", icon_url="https://images-ext-1.discordapp.net/external/CxjorkQC8xvkLM-OeH78kpf_yP2LNGUYCEltqM3Iomc/%3Fsize%3D128/https/cdn.discordapp.com/avatars/638089573687099442/a9e972fcae9dd9b581da9f9e4f21fb26.png")
  embed.add_field(name=":red_cirle:", value="Red")
  embed.add_field(name=":orange_cirle:", value="Orange")
  embed.add_field(name=":yellow_cirle:", value="Yellow")
  embed.add_field(name=":green_cirle:", value="Green")
  embed.add_field(name=":blue_cirle:", value="Blue")
  embed.add_field(name=":purple_cirle:", value="Purple")
  msg = await ctx.send(embed=embed)
  await msg.add_reaction(':red_circle:')
  await msg.add_reaction(':orange_circle:')
  await msg.add_reaction(':yellow_circle:')
  await msg.add_reaction(':green_circle:')
  await msg.add_reaction(':blue_circle:')
  await msg.add_reaction(':purple_circle:')
  
  def check(reaction, user):
    return user == ctx.user and reaction.message == msg and str(reaction.emoji) in [':red_circle:',':orange_circle:',':yellow_circle:',':green_circle:',':blue_circle:',':purple_circle:']

  while True:
    try:
      reaction, user = await client.wait_for("reaction_add", check=check)

      if str(reaction.emoji) == ':red_circle':
        mrole = discord.utils.get(ctx.guild.roles, name='Red')
        await user.add_roles(mrole)
        print ('gave a role to someone')
    except Exception as e:
      pass
sudden geyser
#

You'll need to find where the error is occurring, as should be outlined in the error message.

real phoenix
#

its not though. Thats the issue.

sudden geyser
#

Can you show us the error?

real phoenix
sudden geyser
#

Ok, now you know that it's coming from add_field(...)

#

And the error says that one positional argument is expected, but you gave two, along with a keyword argument

real phoenix
#

yeah

#

I tried searching the code for all usage of add_field but I don't see the issue

#

I might be blind tho so

sudden geyser
#

The error likely displays the line number.

real phoenix
#

the error above it mentions this line

#
embed.add_field("$roles", value="View all the roles and their info.")
earnest phoenix
#

Anyone wanna make a bot together? im looking to make any bot and go out of my knowledge and learn more!

sudden geyser
real phoenix
#

oml

#

i lack braincells

#

tysm

sudden geyser
#

Also, are you using discord.py, or a fork of the library?

real phoenix
sudden geyser
#

You should consider migrating to a fork of it, like Pycord or Nextcord.

#

Discord.py has been deprecated and won't receive updates in the future.

real phoenix
#

ik

sudden geyser
#

alright

real phoenix
#

maybe I'm stupid but why isn't it' registering my emojis?

embed.add_field(name=":red_circle:", value="Red")
  embed.add_field(name=":orange_circle:", value="Orange")
  embed.add_field(name=":yellow_circle:", value="Yellow")
  embed.add_field(name=":green_circle:", value="Green")
  embed.add_field(name=":blue_circle:", value="Blue")
  embed.add_field(name=":purple_circle:", value="Purple")
  msg = await ctx.send(embed=embed)
  await msg.add_reaction(":red_circle:")
  await msg.add_reaction(":orange_circle:")
  await msg.add_reaction(":yellow_circle:")
  await msg.add_reaction(":green_circle:")
  await msg.add_reaction(":blue_circle:")
  await msg.add_reaction(":purple_circle:")

error:

raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji
sudden geyser
#

Check the documentation for adding reactions

#

You can't supply emoji names like that.

real phoenix
#

I did

sudden geyser
#

You have to use their identifiers.

real phoenix
#

wut

#

identifiers?

#

wait like this?

await msg.add_reaction(:red_circle:)
sudden geyser
real phoenix
#

oh ok

#

ty

sudden geyser
#

If you're using a regular emoji, you have to use the raw unicode emoji. For example, 😺 should be sent as \😺

real phoenix
#

oh ok

earnest phoenix
#

What lang is that

#

is that python

#

👀

#

ew

real phoenix
#
while True:
    try:
      reaction, user = await client.wait_for("reaction_add", check=check)

      if str(reaction.emoji) == '🟥':
        # mrole = discord.utils.get(ctx.guild.roles, name='Red')
        mrole = ctx.guild.get_role(926536964860158074)
        await user.add_roles(mrole)
        print ('gave a role to someone')
    except Exception as e:
      pass

So why isn't it giving me the role?

lyric mountain
#

while true 😩

real phoenix
#

its not printing or anything

#

shut

#

I'm a bad coder

#

😎

lyric mountain
#

why tf are u using an infinite loop anyway?

#

like, there's no escape out of it

real phoenix
#

yes ik

lyric mountain
#

and remove the try catch

real phoenix
#

Its reaction roles

lyric mountain
#

you're muting the error

#

that's why u don't get any error on console

#

or at least add print(e)

real phoenix
#

ok

#

lemme try it now

earnest phoenix
wheat mesa
#

while(troll) mmulu

real phoenix
#

ok so now it says that the value "reaction" is undefined

lyric mountain
#

cuz it is

#

(reaction, user) = await not reaction, user = await

#

the way u did is the same as
reaction
user = await ...

real phoenix
#

slightly confused

#

where is that?

lyric mountain
#

inline declaration

real phoenix
#

oh

lyric mountain
#

u could do reaction = something, user = otherthing, abc = 123

#

it's a valid syntax

#

the way u did u only initialized variable user

real phoenix
#

oh

#

ty

modest maple
#

sip foo, bar = await wait_for() is perfectly valid code

lyric mountain
#

doesn't it need parens?

modest maple
#

basically everything Kuu said is incorrect

real phoenix
#

wot

modest maple
#

and is basically the opposite

lyric mountain
#

I mean, in all languages I saw multiple declaration had parens

modest maple
#

reaction = something, user = otherthing, abc = 123 isnt valid

lyric mountain
#

it is

modest maple
#

run it

real phoenix
lyric mountain
#

ah wait, yeah it'd be semicolon

modest maple
modest maple
real phoenix
#

well I did this

try:
      (reaction, user) = await client.wait_for("reaction_add", check=check)

Would this work?

modest maple
#

literally isnt any different to the code you had

real phoenix
#

ok

lyric mountain
#

no, it indeed is a valid syntax

#

just not in python

earnest phoenix
#

does python have ternary operators or something equivalent

lyric mountain
#

I just didn't know python didn't have inline declaration

modest maple
modest maple
earnest phoenix
#

mm Ic

lyric mountain
earnest phoenix
#

so python doesn't have something like how js has expression ? true : false

modest maple
modest maple
earnest phoenix
#

Well yes I know the equivalent

modest maple
#

also for immutable items a = b = c = 1

earnest phoenix
#

I was just wondering if python had what js had

lyric mountain
#

idk how that's called, but it's a different thing

earnest phoenix
#

what

#

python actually uses and or?

modest maple
#

well they exist as key words yes

earnest phoenix
#

I did not know this

modest maple
#

they dont actually behave as ternary operators though, they just lazily evaluate the truthyness of an object

earnest phoenix
#

icic

drifting wedge
#

is there a way to run a function from a module?

#

in vanilla js

modest maple
#

bearing in mind | and & are purely bitwise arithmetic operators in py / separate to or and and logic

drifting wedge
#

like to call a function from a module script

#

how?

#

@opaque fern

#

basically i have a js module in a script tag that is the create user function

#

bc it doesnt work outside of it for some stupid reason

#

so idk how to actually call the function

earnest phoenix
#

🤔

drifting wedge
#

bc it says the function isnt found if its in the module

earnest phoenix
#

I assume this is web dev stuff

drifting wedge
#

yeah

#
    <script type="module">
import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.6.1/firebase-app.js';

const firebaseConfig = {
...
};

const app = initializeApp(firebaseConfig);

import { getAuth, createUserWithEmailAndPassword } from "https://www.gstatic.com/firebasejs/9.6.1/firebase-auth.js";
const auth = getAuth();

function _signup() {

    const email = document.getElementById('email').value;
    const password = document.getElementById('password').value;

    createUserWithEmailAndPassword(auth, email, password)
    .then((userCredential) => {
        // Signed in 
        const user = userCredential.user;

        alert("signed up");
        // ...
    })
    .catch((error) => {
        const errorCode = error.code;
        const errorMessage = error.message;

        alert(errorMessage);
        // ..
    });
}

    </script>```
#

and it doesnt let me call it

earnest phoenix
#

you can do an onclick event in a button if that is what you're trying to do

drifting wedge
#

yeah

#

exactly

#

but it doesnt let me

#

so basically for the createUserWithEmailAndPassword function

#

it needs the const auth = getAuth();

#

and for. that it needs the imported thing and the app

#

so in the docs for it, it says to "pass it in" but that doesnt make sense

#

any ideas?

#

@earnest phoenix @marble juniper ?

earnest phoenix
#

Why ping us

#

dont

drifting wedge
#

sowwy

marble juniper
#

I got no idea how to help you

#

never used firebase

drifting wedge
#

aight aight ty

#

dw

marble juniper
#

and no ping yes

earnest phoenix
#

Any alternatives to canvas talking about the npm package

#

I find installing canvas to be rather annoying unless they've changed it

solemn latch
#

depends on what you are doing I would think

#

canvas kinda does "everything"
other libs dont

earnest phoenix
#

Just trying to make a card with information people give

#

So I am stuck with canvas great

#

lets go see if it is still aids to install

solemn latch
#

it is, but only takes 10 minutes or so.

#

🤔 ?

quartz kindle
#

the problem with canvas alternatives is performance

#

one of the most popular pure js image compositing is jimp, and its terribly slow

boreal iron
#

🎆

split hazel
#

canvas is pain to build

#

you have to pray for the installation not to end in NPM ERR

quartz kindle
#

i mean, you just need the standard build tools and it should work?

#

idk

split hazel
#

idk either

#

i dont want to think about it either

#

bad memories

solemn latch
#

Gpk or something else is needed too iirc.

Idk if that's in build tools

quartz kindle
#

build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

#

on ubuntu/debian

solemn latch
#

Was gtk I was thinking of.
For windows

quartz kindle
#

ah yes windows is speshul

spark flint
modest maple
#

flex boxes and flex-wrap is your friend

solemn latch
#

Use a grid

#

Yeah

spark flint
modest maple
#

welleach one of those cards should be its own container

#

and then have a parent container

#

so basically just flex flex-wrap or more likely for mobile flex flex-col lg:flex-row

#

depending on how you wan the flex box behavour to go

#

flex-wrap probably better tho and / or a combo

spark flint
#

its uh

#

fieldset

#
                <div class="w-1/4" onclick="location.href = '/dashboard/822059901568024616';" style="cursor: pointer;">
                    <fieldset class="text-white rounded-lg text-center" style="border:1px solid white">
                        <legend><img role="presentation none" src="https://cdn.discordapp.com/icons/822059901568024616/f7ba9cd05f50205e4ecacaa35dbab5d5" style="border-radius:50%; width: 80px" onerror="if (this.src != 'https://eu.ui-avatars.com/api/?name=big bun&#39;s server&size=128') this.src = 'https://eu.ui-avatars.com/api/?name=big bun&#39;s server&size=128';"/></legend>
                        <h3 class="text-2xl mx-5 mb-5">big bun&#39;s server</h3>
                    </fieldset>
                </div>```
modest maple
#

meh doesnt matter

spark flint
#

blame @earnest phoenix

modest maple
#

although your child having a width of w-1/4 is a little eak

spark flint
#

yeah

#

agreed

modest maple
#

if you have a really big screen then shit gonna grow too big

#

too small and it's gonna be tiny

split hazel
modest maple
#

eye balling it, it looks around w-64

spark flint
#

2 secs

#

luckily i'm production testing

#

epic that works

#

ty @modest maple

#

now how do i center it KEKW

split hazel
#

yeah that shit doesnt look straight

spark flint
#

its worse on mobile

sudden geyser
#

did you use margin or something

spark flint
#

oh shit i did

modest maple
spark flint
#

epic that worked

#

time to fix this KEKW

solemn latch
#

I really need to move away from masonry on my sites

#

Too stinky

sudden geyser
#

What's masonry

solemn latch
#

animated grids

#

its a pain for elements you do not know the size of beforehand

#

such as videos

modest maple
solemn latch
#

(can do, but is a pain)

drifting wedge
#

hi ok so if anyone understands firestore rules pls help

#
            email: user.email,
        },
        account: {
            name: user.displayName,
            photo: user.photoURL,
        },
        user: { // uneditable
            isBirthday: false,
            badges: [],

            created: user.metadata.creationTime,
            last_login: user.metadata.lastSignInTime,

            admin: false,
        },
        data: {
            profile: {
                bio: "",
                location: "",

                pronouns: [],
                gender: "",

                age: null,
                birthday: [null, null, null], // day month year
            },
            connections: {
                website: "",
                twitter: "",
                github: "",
                instagram: "",
                youtube: "",
                discord: "",
                twitch: "",
                steam: "",
            }
        }```
#

this is the user boject right

#

so i want the user's email to be only readable if the user is the actual author, have everything else public, and editable by the author except for the user key

#

if i need to change stuff around then its fine, just someone pls explain cuz the rules are very complicated

#
  match /databases/{database}/documents {
    match /users/{uid} {
      allow read;
      allow write: if request.auth.uid == uid;
    }
  }
}``` this is my rules rn, its jsut that everyone can edit their own documents