#development

1 messages · Page 1951 of 1

split hazel
#

apparently you cant do this in firebase because you can only address rules by whole documents, not fields

#

so the best solution would be to make another collection which contains sensitive data about the user where then you can make a rule that only the user can read the sensitive document

modest maple
#

basically

#

firebase pretty stinky

#

Supabase is a pretty solid (also cheaper) alternative

#

because RLS is so fucking nice

sudden geyser
#

what is firebase and supabase useful for

spark flint
#

authentication iirc

sudden geyser
#

so they just streamline it for you?

drifting wedge
#

its like a toolset for data basically

split hazel
drifting wedge
#

i mean i could use mongo?

#

with js

#

but like whatever really

split hazel
#

the concept is good but firebase makes rules difficult to work with and lacks a lot of elements

drifting wedge
#

bc its good that users can access it

#

so no serverside stuff

#

well yes but less yk

#

like its just less server load

sudden geyser
#

but the server is still somewhere

drifting wedge
#

but like for example

#

when a user creates an account

#

it doesnt need to talk to YOUR server

#

it just does everything clientside

#

fuck tho hmmm

sudden geyser
#

so it's useful for delegating responsibility to firebase?

drifting wedge
#

2 options then

#

i guess?

#

i mean it has other fratures

#

featurss

#

its great for apps in specific

#

but 2 options for me: either just to completely serverside or figure out this rule stuff

#

what do u guys think?

sudden geyser
#

hmm

drifting wedge
sudden geyser
#

so firebase is useful when you don't want to manage a backend and all its complicated stuff

drifting wedge
#

umm

#

you still have to i think

#

just less work

#

i could also just scrap the js and move to python

#

and then just use mongodb? ezclaps???!?!

#

i mean i added google auth tho

#

but i could just scrap that

#

and just hash passwords with salts??

lyric mountain
#

who cares abt pass, just use finger digitals smh

sudden geyser
#

but now you need an iPhone

drifting wedge
#

what

sudden geyser
#

or a phone

#

I didn't have a phone until I was 16

#

it was so annoying how every site aggressively pushed 2FA

#

particularly discord

modest maple
#
  • bandwidth
drifting wedge
#

i just decided to fuck it all and move to python and mongodb

#

ezclaps no more rules

sudden geyser
#

but you were probably paying for that server without it anyway

drifting wedge
#

fuck firebase ngl

#

i mean tho

#

how can i implelement google auth tho

sudden geyser
#

Try finding a library for it

#

Good chance it's written by Google

#

I tried using Google auth once and immediately backed out

drifting wedge
#

wait oh should i do discord?

#

discord is by far the easiest

sudden geyser
#

if it makes sense for your platform

drifting wedge
#

umm

#

the platform is to practice really

#

oh fuck i need to store images!! how the fuck do i do that?

sudden geyser
#

practice what 👀

drifting wedge
#

coding..

sudden geyser
#

and does the site have relationships with discord? if not, I'd advise against implementing Discord oauth. It's like implementing GitHub OAuth on a cooking recipes site

earnest phoenix
#

isn't there a way to make this in a few lines?

            db.add(`silver_${message.author.id}`, 1);
            db.set(`giantt_${message.author.id}`, true);
            db.set(`archers_${message.author.id}`, true);
            db.set(`minions_${message.author.id}`, true);
            db.set(`arrows_${message.author.id}`, true);
            db.push(`common_${message.author.id}`, "Giant");
            db.push(`common_${message.author.id}`, "Archers");
            db.push(`common_${message.author.id}`, "Minions");
            db.push(`common_${message.author.id}`, "Arrows");
            db.add(`cards_${message.author.id}`, 4);
            db.push(`all_${message.author.id}`, "Giant");
            db.push(`all_${message.author.id}`, "Archers");
            db.push(`all_${message.author.id}`, "Minions");
            db.push(`all_${message.author.id}`, "Arrows");

db.set(`deck1_${message.author.id}`, "Giant")
db.set(`deck2_${message.author.id}`, "Archers")
db.set(`deck3_${message.author.id}`, "Minions")
db.set(`deck4_${message.author.id}`, "Arrows")
``` forEach, function or with "i"? ( *for ( let i of array)* )
sudden geyser
#

Where you find patterns in your code is where you can substitute it for loops.

proven lantern
#

how does mee6 let you create your own version of their bot via the website?

green kestrel
#

hmmmm

proven lantern
#

can new application be created programmatically?

green kestrel
#

triviabot was bombarded with 13000 commands in the space of an hour 3 days ago

#

i guess it says something about scalability that i wouldnt even have noticed if i hadnt seen a spike on the graph

crimson vapor
#

13k commands kekw

proven lantern
#

revenge of the spammers

green kestrel
#

it looks like it just laughed at them and kept on running lol

crimson vapor
#

epic c++ scalability

sudden geyser
#

I'm more curious about what Mee6 is doing

proven lantern
#

i saw someone else had it

crimson vapor
#

does it require you to give them a token?

proven lantern
#

maybe it did. i'll have to double check with them to see what they did

#

that would work though

rocky hearth
#

Is is the only difference between C++ struct and class is that members of struct is public by default and class is private, right?

lyric mountain
#

Isn't struct a temporary class?

#

Like, something to be used in that context and then disposed

rocky hearth
#

Idk, i just started learning oops in c++

#

Would like to know too.

lyric mountain
wheat mesa
earnest phoenix
#

I write semantic html not css

royal herald
#

ok so how can i close that div before the center div?:

<div class=container style="background-color:#000">
    <div align=center>
<img src=<%=bot.search(user.id).avatar%> class="mb-3 mt-4 rounded-circle"draggable=false height=160 width=160>
        <h1 class=app-slogan>Welcome back!</h1>
<br>
        <h1 class=app-description>manage ur servers</h1><br></div> <!-- this div closes the center div,but i want it to close the container -->
    <div class=container>
        <div class="mb-3 input-group">
<input aria-describedby=basic-addon1 aria-label=Username class="form-control search" id=search placeholder="search smthn"></div>
earnest phoenix
#

what in the world

royal herald
#

what

#

oh its ejs

earnest phoenix
#

so it knows when stuff ends?

#

or is that optional

pale vessel
#

Optional

earnest phoenix
#

ah ic

royal herald
#

optional

#

abtw

#

anyways

earnest phoenix
#

I think your divs are messed up unless I am looking at it wrong

#

That code snippet is poorly formatted so its hard to actually tell

royal herald
#

i can format it

#

if u want

earnest phoenix
#

Yea

#

you're missing 2 closing divs

#
<div class=container style="background-color:#000">
    <div align=center>
        <img src=<%=bot.search(user.id).avatar%> class="mb-3 mt-4 rounded-circle"draggable=false height=160 width=160>
        <h1 class=app-slogan>Welcome back!</h1><br>
        <h1 class=app-description>manage ur servers</h1><br>
    </div> <!-- this div closes the center div,but i want it to close the container -->
    <div class=container>
        <div class="mb-3 input-group"><input aria-describedby=basic-addon1 aria-label=Username class="form-control search" id=search placeholder="search smthn">
        </div>
    </div>
</div>
royal herald
#

ah

#

ok

#

thanks

earnest phoenix
#

There that is better formatted

#

no problem glad I could help :p

#

close that br tag pls

#

it hurts when you see normal html code after closing every single tag in react

fresh verge
#

Can a bot change their own pfp for a server? If so, how would I do it? Internet isn’t being very helpful rn.

pale vessel
#

No

#

That's for users with nitro

neat ingot
#

happy 2022 folks 😘 ❤️

earnest phoenix
#

https://sourceb.in/hD6spS6No3
snipe command - issue is that it always says no message to snipe even if I just deleted a message

modest maple
earnest phoenix
#

btw its for a private bot

modest maple
#

which for even a very slow webserver is basically nothing

neat ingot
green kestrel
#

the bot processes submit counters to a set of tables every 15 minutes, then a set of mysql views represent that data in a way that lets the graph be displayed without having excessive data points

#

less data points the further back you go, e.g. 15 min, then hourly, then daily, then weekly

green kestrel
modest maple
#

I mean if it was a webhook interaction the bot could respond to them all :P

neat ingot
green kestrel
#

sort of

#

my bot has three parts plus a database server

#

theres the actual bot, then theres the dashboard, and admin panel

neat ingot
#

docker?

green kestrel
#

the bot is a set of instances of a C++ program, it has no web stuff in it

#

the dashboard and admin panel are a set of php scripts that are run under apache 2.4

#

they all use the database (mariadb) as a central point of truth

#

so the bot process can update user/channel cache tables etc, and scoreboard tables

#

the dashboard can read them

#

both dashboard and bot can update guild configs

neat ingot
#

i see

green kestrel
#

im not using docker or virtualisation

neat ingot
#

seems fair enough

#

ahh

green kestrel
#

i probably could/should use docker eventually

neat ingot
#

any reason why? no need?

#

ahh lol

green kestrel
#

no need yeah

#

it'll get to the point where i have to scale horizontally soon

#

well, when i get to about a million servers lol

neat ingot
#

lmao

#

my setup is kinda similar, kinda not

green kestrel
#

and then i could do with docker images for deploying a multi-master mysql, or a varnish cluster for the web stuff

neat ingot
#

i have everything running in docker containers. 1 for each bot, 1 for each website, 1 for mongodb, 1 for nginx, 1 for netdata monitoring. etc

green kestrel
#

interesting

neat ingot
#

so i managed to write a little class that is able to grab the docker container id, which i can then use for polling container specific information from an internal network to the netdata server (which normally requires auth)

#

^ the graph the bot sends (one of)

green kestrel
#

thats a lot of cpu

neat ingot
green kestrel
#

my cpu graph is pretty much boring

neat ingot
#

^ possibile charts to grab

green kestrel
#

because its flat lol

neat ingot
#

spent the entire day yesterday figuring out how to send statsd pings to my netdata server (wasnt working, cause netdata binds to localhost and not 0.0.0.0, which is required for docker)

green kestrel
#

cant you ping the docker host ip 172.x?

neat ingot
#

no need, i can use the container name directly

#

where netdata is the container name

modest maple
round cove
#

Netdata finds all your running docker containers.

neat ingot
#

ive been using docker for years lol

#

netdata is also dockerized, which makes it require more things, but yes, it reads all container info

round cove
#

I mean yeah you need to create the docker network.

#

Which I didn't do for my netdata just have it running normally.

neat ingot
#

yea i debated just having netdata run locally, but i wanted my nginx to resrict the port

modest maple
green kestrel
#

man cave is about finished now btw 😄 finally got my pcs in it

#

anyone wanna see?

round cove
#

Sure let's do it

neat ingot
#

sure 🙂

boreal iron
#

Cave? I’m concerned what you will show

#

Ah

green kestrel
#

it literally is a cave ig, its in an 18th century cellar

neat ingot
#

oohh nice

round cove
green kestrel
#

i converted it from a horrible hole in th ground into a place im comfy coding in 😄

neat ingot
#

imo you should paint the walls a super light grey, and then get some rgb going all over the everything! 😄

green kestrel
neat ingot
#

out of curiosity, why the 2 rigs? is one a server rig?

green kestrel
#

not had my Z5500 set up for years

#

the one on the right is literally a server, yes, with a ups on its right

neat ingot
#

ahh yea i see it peeking out 😄

neat ingot
#

what does it serve?

green kestrel
#

thats how it looked before i put the rest in

neat ingot
#

boring af 😄

boreal iron
#

Isn’t it fucking cold down there?

green kestrel
#

and that monitor and old computer to the left of the server, those are a retro computer from 1984

#

but i cant keep the retro computer on, it has an electrical fault in its psu and it cripples the lan lol

round cove
#

Old photo but basically my setup

neat ingot
#

isnt airdropping for crypto?

green kestrel
#

its pretty warm lol, server kicks out a lot of heat

boreal iron
#

my gosh 25 is almost too hot KEKW

green kestrel
#

im careful to monitor the humidity in here, got a big-ass dehumidifier

neat ingot
#

i like your desk mat

round cove
#

I don't use it it's too tiny lmao

boreal iron
neat ingot
#

black, white, red. best color combo for a setup imo

round cove
#

Bought it thinking it was bigger

green kestrel
#

desk mat lol, i donmt have room for desk mats

neat ingot
#

😄

green kestrel
#

i have a drawing tablet i barely ever use

boreal iron
#

Having is better than not having

neat ingot
#

lol, idk if i have a pic of my setup after i moved to my new house

green kestrel
#

true

neat ingot
#

random question: any yall have any idea how to level out a floor in a house i dont own? 😄

green kestrel
#

if youre curious heres what it looked like before i got started converting it

neat ingot
#

...

#

wtaf? lmao

boreal iron
#

I recently added some led stripes to my desk and it looks so cool but is so unnecessary

round cove
#

Photo of it now

green kestrel
#

yeah the floor in here was literally uneaven dirt.... heres what i did 😛

boreal iron
#

Hmm since it turns out to be a presentation…

green kestrel
#

pallets.... then i got boards and screwed the boards to the pallets with an electric screwdriver

#

painted and varnished them all

boreal iron
green kestrel
#

oooo thats pretty

#

i like the accent lights

boreal iron
#

Wait I got more lights

green kestrel
#

RGB?

boreal iron
#

Lights inside the furniture looks fucking sick

green kestrel
#

niice

boreal iron
#

RGBWW

neat ingot
#

oohh yea thats dope af

boreal iron
#

Warm white and cold white LEDs as well

neat ingot
#

not the best pic, but its the only one i can find from right after i moved in lol, can still see my construction in the hall 😄

boreal iron
#

As common cheap LEDs are not really truly to colors

#

I mean I renovated the house a few years ago, so everything still looks "new"

neat ingot
#

where is the pc? 😄

#

where is the keyboard?!

boreal iron
boreal iron
boreal iron
slender thistle
boreal iron
#

lmao aye

slender thistle
#

Gotta get lights in your car though

#

+100 to driving

boreal iron
#

I do but not inside freerealestate

boreal iron
slender thistle
earnest phoenix
eternal osprey
#

why if i fetch a user with djs v12 it only maps me 4 of the actual 66

#
 const guild = client.guilds.cache.get(message.guild.id);    


     
      guild.members.cache.forEach(member => {
        console.log(member)
        
      });```
earnest phoenix
#

Make sure you have the members intent enabled

#

tf is that indentation

split hazel
#

is it because of cash

earnest phoenix
#

Indeed it is

eternal osprey
earnest phoenix
#

money issue pain

#

Members are not guaranteed to get cached

split hazel
#

cash

earnest phoenix
#

I am trying to help someone here

#

so stfu

split hazel
#

cash

eternal osprey
#

owh so to get all people in a server i should find the user?

earnest phoenix
earnest phoenix
#

also why are you mapping every user

eternal osprey
earnest phoenix
#

menacecraft pocket edition

#

Well I can tell you now whatever you are going to do will likely get you ratelimited

eternal osprey
#

i want to give one random user in the server an ingame currency gift if the other doesn't accept the gift

eternal osprey
earnest phoenix
#

If you wanna get a random user why are you looping

#

message.guild.members.cache.random()

#

let's hope djs did one thing right

#

it still exists yes

earnest phoenix
#

you can just use .random on cache to get a random user

#

Saves you the trouble of doing all that yourself

earnest phoenix
#

Most likely not

#

I am sorry since Erwin's gone i have to yell at everyone to use detritus

eternal osprey
#

alirghtty, thanks cuties!

boreal iron
split hazel
#

you know you're in too deep when driving while helping beginner bot devs get their bot to start

boreal iron
#

I know, I’m a good boy, too good boy probably

#

I mean like @quartz kindle … delaying his API for years now because he’s continuously helping people

  • there’s no other reason for the delay!
quartz hill
#

have any alternative ? (discordjs v13 btw)

split hazel
#

i am not gonna ask why you're using intellij for javascript

solemn latch
quartz hill
split hazel
#

wait are they really getting rid of it

#

i swear at this point they should just make another library

#

i dont like most of their changes the old syntax was completely fine

#

i feel lost now when using the library because i try using something that was there for many years but oop they've removed it

#

oh they're only deprecating the icon parameter, was out of place anyways

#

point still stands tho

boreal iron
#

Tbh since more of those helper functions now require to pass an object as option, what does people actually prevent from writing the whole embed object themselves?

#

Less code anyways, looks cleaner on my opinion and you don’t have to import the helper function of the djs package

split hazel
#

throwback to the time everything was actually in a single package

boreal iron
#

What discord expects as data with the API request will most likely never change

boreal iron
marble juniper
#

Can anyone recommend me a visual studio code theme

#

which is not too distracting

earnest phoenix
#

How can I disable Inspect element on a chrome extension using js?

#

so it's like this

#

instead of this

signal estuary
#
collector.on('collect', async (i) => {
        let id = i.customId
        switch (id) {
            case 'english':
                language = 'en'
                row.components.find(id => id.customId === "german").setStyle('SECONDARY')
                row.components.find(id => id.customId === "english").setStyle('PRIMARY')
                i.deferUpdate()
                break
            case 'german':
                language = 'de'
                row.components.find(id => id.customId === "english").setStyle('SECONDARY')
                row.components.find(id => id.customId === "german").setStyle('PRIMARY')
                i.deferUpdate()
                break
        }
    })

Why is none of the buttons style changing?

split hazel
#

i think its because you are editing the local instance of that interaction, not actually submitting it to discord unless im wrong

#

you would have to edit that message with the new button styles

signal estuary
full epoch
#

how to send ephemeral message in discordjs v12

modest maple
#

you dont

earnest phoenix
full epoch
#

ugh I have to update

#

fine

earnest phoenix
#

Yes cause v12 doesn't really support that stuff

#

if at all

earnest phoenix
#

Xcuse mme sir have you heard of Detritus by any chance?

full epoch
modest maple
#

ignore the fan girls

#

Discord.js is the best framework ever made

earnest phoenix
modest maple
#

with absolutely nothing flawed

earnest phoenix
#

everything in djs is flawed

#

ever since v13

#

v13 = panic

#

Not with Detritus though oh no, it comes with a client that is made for interactions

full epoch
earnest phoenix
#

i think eris is nice

#

no

#

but i am using d.js v13 lmao

#

eris bad

#

eris no support v9

#

i know

full epoch
#

discord js v13 is a bit complicated but has a lot of features

earnest phoenix
#

a lot of useless stuff as well

earnest phoenix
#

not to mention it removed a good bit of what was useful

#

For example, it caches everything f*ck

#

caching isn't actually that bad what

full epoch
#

ok now

#

how to

#

send ephemeral message in djs v13

modest maple
#

you dont

#

upgrade to discordjs@latest

#

jk

#

no idea

full epoch
#

bruh

#

bruhhhhh

#

damn

earnest phoenix
#

you can only do so to slash commands iirc

spark flint
#

temp banned from what

pulsar bone
spark flint
#

Which API

pulsar bone
#

discord api

#

hey guys my bot keep on getting temp ban for even after using sleep fucntion of 2 sec before sending any message help please

earnest phoenix
#

I dont think sending a message every 2s is good idea

sudden geyser
neat ingot
#

step 1: write module to track current ws ping and an average,
step 2: use statsd to send that infomation to netdata
step 3: view the information in realtime on web dashboard or use bot command to poll netdata for info over time, then send image containing graph of the data.

#

now... how to profit? 😂

earnest phoenix
#

?

#

wrong channel

quartz hill
#
const filter = (reaction, user) => { 
    return reaction.emoji.name == ':heart:' && !user.bot;
}
var collector = msg.createReactionCollector({filter, maxUsers: 1, time: 10000});
 collector.on('end', async collected => {
   if(collected.size){
        ... // etc.
   }
});

I have a problem this I changed discordjs version 12 to 13 and I looked docs and edited but this part not working. collected size always return 0
It's like the filter isn't working at all. and I tried to print something with console log into the filter, it still didn't write.

signal estuary
#
    let site = 0;
    let embed = new Discord.MessageEmbed()
        .setTitle('Setup')
        .setDescription('Site: ' + site + '\nLanguage:\nTheme:')

    let row = new MessageActionRow().addComponents(btns.getBtn('next'))
    let reply = await inter.reply({ embeds: [embed], components: [row], fetchReply: true })

    const filter = (filter) => { if (inter.user.id === filter.user.id) return true }
    let collector = reply.createMessageComponentCollector({
        filter,
    })
    const rowChanger = (site) => {
        switch (site) {
            case 0:
                return
            case 1:
                row = row.addComponents(btns.getBtn('german'), btns.getBtn('english'), btns.getBtn('next'))
                return row
            case 2:
                return row = row.addComponents(btns.getBtn('next'))
        }
    }
    collector.on('collect', async (i) => {
        i.deferUpdate()
        switch (i.customId) {
            case 'next':
                site++;
                inter.editReply({ embeds: [embed], components: [rowChanger(site)] })
                break
        }
    })

btns.getBtn is an exported function which returns buttons which works fine.
I get this error when pressing on the button with the custom id 'next'

    let type = data.type;
                    ^

TypeError: Cannot read property 'type' of undefined
sudden geyser
quartz hill
#

I tried but same

neat ingot
#

i think they recommend you to listen for buttons instead of reactions now

#

can also have buttons that show emoji's 🙂

sudden geyser
# quartz hill I tried but same

Made a little mistake. You'd remove the colons for custom emojis, but since you're using a standard emoji, you'd use its raw unicode. So rather than ❤️ or :heart:, you'd use \❤️.

There's also buttons to consider, as Dekita said.

quartz hill
#

I fixed I forgot Intents.FLAGS.GUILD_MESSAGE_REACTIONS this

#

mybad sorry

earnest phoenix
#

Is there a bypass around rate limiting?

#

Because I have 1100 people interested in a event, and it involves them all clicking buttons.

shrewd orbit
#

Can i make bot edit it's own message 1st on 5 sec and then 2nd one after 2 sec? with 2 normal interaction buttons? (queue time is tooooooo long i don't want want my bot got reject so asking)

quartz kindle
earnest phoenix
#

Thought not.

signal estuary
summer hinge
#

did i do something wrong , says TypeError: Topgg.api is not a constructor

sudden geyser
#

Yes, you did something wrong.

summer hinge
#

and that is ?

wheat mesa
#

Topgg.api is not a constructor

#

Aka you can’t make an object of Topgg.api

pale vessel
wheat mesa
#

^^

#

Uppercase

summer hinge
#

capital A , damn

#

it changed

#

last time when i was coding , it was small a

#

thenks btw

earnest phoenix
#

Is there a way to remove this after someone clicks a button?

#

Button's work but it always says "This interaction failed"

signal estuary
harsh tusk
#

when i get node js, do i have it install nessacary updates

sudden geyser
#

When you install Node.js, you install updates as you choose to.

#

You can stay on a vulnerable version as long as you want, but it's probably not the best thing to do

compact pier
#

how I can use function as a type?

#

like

interface Something {
  callback: function
}
modest maple
#

👏 In what language

quartz kindle
#

im guessing typescript

compact pier
#

fuck this ts

earnest phoenix
#

🤔

compact pier
#

yeah thank you

earnest phoenix
#

All you gotta do is capitalize the f

compact pier
#

yeah

earnest phoenix
#

How can I see if my chrome extension get's uninstalled?

#

Cant

#

Chrome doesn't allow the detection of such a thing

#

Oh, some websites make it so when you install an extension it'll redirect you to a page like why did you uninstall it etc

#

You can only set a uninstall url

spark flint
#

It does

earnest phoenix
#

which gives you like a survey

#

ohh

spark flint
#

uninstall URL, track the amount of users who view that page

earnest phoenix
#

oh okay

#

ty

#

Well yea you can track how many uninstall it

#

👍

#

but you can set a uninstallURL which can lead to a survey

#

okay

#

there ya go

#

okay

#

ty

#

npnp

signal estuary
#
    let site = 0;
    let embed = new Discord.MessageEmbed()
        .setTitle('Setup')
        .setDescription('Site: ' + site + '\nLanguage:\nTheme:')

    let row = new MessageActionRow().addComponents(btns.getBtn('next'))
    let reply = await inter.reply({ embeds: [embed], components: [row], fetchReply: true })

    const filter = (filter) => { if (inter.user.id === filter.user.id) return true }
    let collector = reply.createMessageComponentCollector({
        filter,
    })
    const rowChanger = (site) => {
        switch (site) {
            case 0:
                return
            case 1:
                row = row.addComponents(btns.getBtn('german'), btns.getBtn('english'), btns.getBtn('next'))
                return row
            case 2:
                return row = row.addComponents(btns.getBtn('next'))
        }
    }
    collector.on('collect', async (i) => {
        i.deferUpdate()
        switch (i.customId) {
            case 'next':
                site++;
                inter.editReply({ embeds: [embed], components: [rowChanger(site)] })
                break
        }
    })

btns.getBtn is an exported function which returns buttons which works fine.
I get this error when pressing on the button with the custom id 'next'

    let type = data.type;
                    ^

TypeError: Cannot read property 'type' of undefined

the code let type = data.type; isnt my hand written code. Must be in the discordjs libary

pale vessel
slender wagon
#

so i am using slash commands and incase a user skips a option i'd like to set a default one

#

is there a way i can do that

signal estuary
# quartz kindle show the full error
    let type = data.type;
                    ^

TypeError: Cannot read property 'type' of undefined
    at Function.create (C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\BaseMessageComponent.js:62:21)
    at C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\MessageActionRow.js:58:85
    at Array.map (<anonymous>)
    at MessageActionRow.addComponents (C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\MessageActionRow.js:58:55)
    at rowChanger (C:\Users\Flo\Documents\GitHub\noah-bot\bot\slashCommands\other\setup.js:23:21)
    at InteractionCollector.<anonymous> (C:\Users\Flo\Documents\GitHub\noah-bot\bot\slashCommands\other\setup.js:34:29)
    at InteractionCollector.emit (node:events:388:22)
    at InteractionCollector.handleCollect (C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\interfaces\Collector.js:108:12)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
quartz kindle
#

so the problem is row.addComponents(btns.getBtn('german'), btns.getBtn('english'), btns.getBtn('next'))

#

first of all the function expects an array

#

so ([a, b, c])

#

not (a, b, c)

slender wagon
#
.setImage(image || interaction.guild.iconURL())
#

what's wrong abt this

sudden geyser
#

What's wrong is trying to set an image on a promise resolving to a message

#

doesn't make sense

#

You probably meant to use that on an embed

slender wagon
#

it is a embed

wheat mesa
#

What

slender wagon
#

i was just showing where image is defined

#

here is the embed

wheat mesa
#

Did you not read the error...?

slender wagon
#
 if (i.customId === 'primary') {
                const embed = new MessageEmbed();
                 await i.message.delete();  
                interaction.channel.send({ embeds: [embed
                    .setTitle(title || "New Message")
                    .setColor(255)
                    .setThumbnail(thumbnail || interaction.guild.iconURL())
                    .setDescription(`${cool.content}`)] }) 
                    .setImage(image || interaction.guild.iconURL())
#

thumbnail works just fine

#

and so does title

#

i collect all of them the same way

wheat mesa
#

You can’t call .setImage on a message promise as klay said

tawny lava
#

you're calling sendImage after sending it instead of on the embed

wheat mesa
#

^^

slender wagon
#

oh

wheat mesa
#

Also just don’t construct embeds like that, if you’re going to chain after making a new embed then do it all at once and not inside of your reply function

slender wagon
#

oh fuck

#

i am stupid

#

didn't even see

#

the beers got me like that

#

can u get a image from a message

#

like only the image

#

discord.js

sudden geyser
#

look in discord.js's documentation for message attachments

wheat mesa
#

message.attachments should be a Collection<string, Attachment> iirc

#

Or something similar

eternal osprey
#
 let number;
  
   const maka = Math.floor(Math.random() * 101);
   if(maka >= 50){
      number = answer3
   }else{
      number = Math.floor(Math.random() * 101);
   }
      
        
      
  let g = await setInterval(() => {
      
   
         console.log(number)
        console.log("Message initialized and logged:");
        const messagelinks = fs.readFileSync('./messages.txt', 'utf8');
        const links = messagelinks.split('\n');
        const link = links[Math.floor(Math.random() * links.length)];
        console.log(link)
ClearInterval(g)
      }, number * 1000);
     ```does anyone know how i can let the timer run again with a new number variable, after the clearinterval?
#

because now it does the first part (defining the number), but i need a way to keep on chancing those number variables and starting the timer again

quartz kindle
#

also, intervals are not promises

#

you dont need to await them

eternal osprey
#

no this code was a pure tumor

#

i used a recursive function

#

so i am running the function and before it ends stopping it with a timeout

wheat mesa
#

could’ve been worse

#

You could’ve used goto mmulu

#

Goto is a thing in js right?

#

Never mind it’s not

harsh nova
#

it is I think just not widely used

wheat mesa
#

It’s not

#

Looked it up

sudden geyser
#

like labels?

quartz kindle
#

goto doesnt exist but labels do, although they only have a single use case

wheat mesa
#

If you think about it functions are kinda like labeled goto statements

solemn latch
#

👀 make sure to make your storage buckets private.

Someone figured out one of my bucket read URL, and loaded 400gb by refreshing a single image over and over for the past month.
only a few dollars in fees, but still

solemn latch
#

guess what I did today KEKW

spark flint
#

what flooshed

solemn latch
#

dealt with that KEKW

spark flint
#

how

solemn latch
#

set it to private, and added authentication to all the webserver fetches.

spark flint
#

ah makes sense

#

i pinged you there

#

a pro harker

solemn latch
#

dnd 😔 no pings

spark flint
#

sorry

solemn latch
#

i mean i didnt get it

spark flint
#

ahhhh

solemn latch
#

nothing to do with that one since they left 😔 will add a note though

#

ty ❤️

spark flint
#

also you might know a solution for this, what is the best way to make a cdn faster

#

i'm using a 512gb vps that costs £3.50 a month, is it worth going lower storage and getting one with SSD storage?

solemn latch
#

imo, your mass storage and "serving" storage should be separate servers.

hdd for storing everything, ssd/ram for serving to the user.

However, if images show in a few seconds hdd alone is probably enough.

spark flint
#

they do load pretty quick atm

solemn latch
#

as you scale youll need something faster

#

yeah, then I wouldnt worry about it

spark flint
#

and for 2k+ images its only 1.7gb

#

the reason I use a storage VPS is because its faster uploading

solemn latch
#

If you want something cheaper, backblaze is a great option.
would handle all your storage needs for free currently.

#

$5 per tb of data

spark flint
#

I'm looking at scaleway

solemn latch
#

charged based on how much you use, etc

#

👀 looks about the same price

#

more free data, so seems like a good option.
not seeing any egress fees listed, which is odd

#

slightly higher egress fees, but its 75gb free, so likely cheaper to use at the moment.

#

the nice thing is they are both s3 compatible, so you can swap quite easily down the line.

#

and free data transfers in on both, so realistically free to move platforms.

modest maple
#

Im forever against scaleway

solemn latch
#

Oo

modest maple
#

Had nothing but issues from them

solemn latch
#

Why

modest maple
#

We've had about 4 servers experience almost total failure and had to deal with their support responding over days only to be told "yeah not much we can do"

solemn latch
#

👀 that's spooky

modest maple
#

Wasnt even with the same clients either. 1 server issue was on a completely unrelated project which basically causes the entire database node to die and be unrecoverable. Had to be loaded from snapshot.

#

the other 3 Were another client

#

so yeah, never going near them again

#

It wouldn't be as bad if their support wasn't so slow and then almost just seemed like they didnt care

quartz kindle
#

its cheaper for them to lose a client than to find and fix the issue i guess

#

i wonder how many big companies operate on the same principle

sudden geyser
#

every one of them

#

I can guarantee you that

#

except for maybe the san francisco startup with 3 three employees

solemn latch
#

Kind of why I like galaxygate so much.

Every issue I've had has been fixed so fast and communicated so well.

Small enough to offer customer service, but big enough to fix your issues quickly still

#

(Small enough to have been waiting for storage servers for 2 years though kek)

slender wagon
#

Yee been using galaxygate too

sudden geyser
#

For my REST API, I want certain endpoints to accept entity IDs or maps representing said entity. For example, POST /user's body may be represented like so:

{
  "name": "Klay", // User name
  "favorites": [1, 2, 3] // Entity IDs (must already exist)
}
{
  "name": "Klay", // User name
  "favorites": [{ "name": "Book 1" }] // Entity maps (will be created)
}

Is there a specific name for this pattern? I know it involves references.

solemn latch
#

Foreign keys?

sudden geyser
#

not quite it

#

those are references

modest maple
#

It only asks to verify after you've paid teh fucker and then find yourself mildly locked out

#

not sure if they fixed that issue or not since I tried them last

solemn latch
#

👀 thats strange

spark flint
#

literally every ticket i open is replied to within 5 mins

#

no matter what time of the day

coral palm
#

C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\rest\RequestHandler.js:298
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Invalid Form Body
34: Application command names are unique
at RequestHandler.execute (C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
at async ApplicationCommandManager.set (C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\managers\ApplicationCommandManager.js:146:18)
at async Client.<anonymous> (C:\Users\ruben\Desktop\BOT-100-CMDS-main\handler\index.js:45:9) {
method: 'put',
path: '/applications/921924043043643444/commands',
code: 50035,
httpStatus: 400,
requestData: {
json: [
{
name: 'apagar',
description: 'Apaga um canal',
type: 1,
options: undefined,
default_permission: undefined
},

#

Someone know what is this error?

sudden geyser
#

check if you have a duplicate command name

lyric mountain
#

Specifically command "apagar"

opaque acorn
#

What is the difference of run and execute?

solemn latch
#

depends

opaque acorn
#

in speed is any difference?

solemn latch
#

depends 👀
in what way are you talking about?

#

run and execute are extremely popular words in programming

#

and can mean hundreds of things

opaque acorn
solemn latch
#

like as in the function name?

opaque acorn
#

yes

solemn latch
#

function names have zero impact on performance

#

you could name it anything

opaque acorn
#

so is the same

solemn latch
#

function adinaipodnmsoakdDSAKMNdsADkskamdpAD() {}
would work too ^_^

#

its just a name

opaque acorn
#

nono

#

wait

#

in a handler

solemn latch
#

a function in a handler is still the same thing

opaque acorn
#

like module.exports = {

#

async execute () { }

#

and

#

run: async () => { }

#

is that the same?

solemn latch
#

yep

#

well no, but the name part is

#

arrow functions have some slight differences, but not performance wise

opaque acorn
#

so the performance is the same no matter what?

solemn latch
#

its just a name, correct.
when running the name isnt even used(its converted into machine code! names are not used there)
its just for you to be able to read it.

opaque acorn
#

ah ok

#

thx for explaining

pulsar bone
round cove
#

Is it possible to pass an array of role IDs to roles.remove() with a single invalid roleID, or will the entire call fail and no roles be removed?

member.roles.remove(['abc', '(valid ID)', '(valid ID)', 'etc'])```
hidden gorge
#

My bot has ai

wheat mesa
#

or it has a function that takes user input and responds with Where (userInput)? 😛

solemn latch
round cove
blissful copper
#

How do I create things like this for top.gg

earnest phoenix
#
  1. Make a webpage
  2. Embed the page with iframe
blissful copper
#

Okay

#

Oh woah that's actually really useful

signal estuary
#

Is there a function to set components instead of adding components?

row.addComponents([buttons])

I dont want to add components to the current components I want to set new components to a row.
Thanks in advance

discord.js

earnest phoenix
#

please not another multi purpose bot with discord.js 🙏

earnest phoenix
#

tf

#

I dont get what you want to do here

#

Can you elaborate more?

signal estuary
earnest phoenix
#

k

signal estuary
#

"k" 😐

earnest phoenix
#

Eh

#

Ig

eternal osprey
#
 client.on('messageReactionAdd', async (reaction, user) => {
    if(reaction.emoji.name === "✅" && user.id === args1.id) {
      if (!database[args1.id]) database[args1.id] = {
        balance: [50]
      };
      fs.writeFile("./userdatabase.json", JSON.stringify(database), (err) => {
        if (err) console.log(err)
      });
      if(Number(database[args1.id].balance) < 5 ){
        message.channel.send(`**The balance of ${args1} is lower than ``5``:small_blue_diamond: ! Therefore he cannot accept the duel!**`)
        return 0;
      }```args1 is not a function?
#

how would i possibly fix this

#

as all i am doing is literally pinging the user

#

args1 is a message.mentions.members.first()

earnest phoenix
#

and json is not a database

eternal osprey
eternal osprey
#

it's temporary

earnest phoenix
earnest phoenix
earnest phoenix
earnest phoenix
#

@rustic nova cringe.dev looking very cringe

rustic nova
#

thinking about yeeting my website/remaking it entirely anyways

rustic nova
#

for how much

earnest phoenix
#

0$

rustic nova
#

nah

earnest phoenix
#

well my nitro's expiring on 15th

rustic nova
#

$20 for it

#

I'll think about it tho

earnest phoenix
rustic nova
#

can do both

earnest phoenix
#

crypto then

rustic nova
#

Will think about it sure2

earnest phoenix
#

you can always just fork my own site

rustic nova
earnest phoenix
#

ok time to do history assignment

#

then i'll decide what framework to use to clone your abysmal site

silver perch
#

guys but how do I send a message in a random channel on the servers where my bot is?

#

In the v12 discord.js

compact pier
#

it is bad to send in random channels

modest maple
#

It's the world's most annoying thing for a bot to do

#

Not only ignoring the fact that Discord dislike you doing it in the first place

silver perch
#

Why isn't it okay?

sudden geyser
#

It's often unsolicited.

#

Of course, if you tell us "why" you want to send a message in a random channel, that may help.

silver perch
#

To make announcements of the bot

modest maple
#

Oml no

#

Just have an announcement channel in your support server people can subscribe to themselves

sudden geyser
#

See? Unsolicited.

#

I don't want to invite your bot and unexpectedly get messages about that 8ball command you added.

#

You should make it solicited.

#

e.g. using announcement channels or allowing the user to set the channel before sending any messages

#

The better alternative being the former.

#

Since it's standardized.

silver perch
#

Ok I'll do as you say

quartz kindle
#

that nickname lmao

#

mods do be creative

spark flint
#

yes

earnest phoenix
#

I thought any domain with cringe in it would be expensive asf

rustic nova
#

Am surprised it was free

earnest phoenix
#

wait what

compact pier
#

where?

earnest phoenix
#

How the hell did you get it for free

#

student dev pack through github?

rustic nova
#

I mean free in the sense of not used yet

earnest phoenix
#

Oh

compact pier
#

ah

earnest phoenix
#

How much did it cost?

compact pier
#

dude u just shocked me for a momment

earnest phoenix
#

.dev domains shouldnt be extraordinarily expensive

compact pier
#

they are like 12-15 euro

rustic nova
#

Renewal is 12 euros

earnest phoenix
#

dang

compact pier
#

ig .xyz is the cheapest here

#

0.8x per month

earnest phoenix
compact pier
#

:0

#

dang

earnest phoenix
#

all the good domains using cringe are expensive

compact pier
earnest phoenix
#

registered in 1995

compact pier
#

woah

#

ppl in 1995 know the word cringe

sudden geyser
#

lots of .xyz sites are scams so they're cheap

#

since no one wants them

compact pier
#

my website...

earnest phoenix
#

I dont think it was actually registered in 1995

sudden geyser
#

zyx looks cooler anyway

earnest phoenix
#

xyz is what most websites for bots use now adays

sudden geyser
#

at one point I think google blocked xyz sites from showing up

earnest phoenix
#

unless they are like dyno and can pay 60+ for a .gg

compact pier
sudden geyser
#

I'd rather spend 4-5 extra on .com than .xyz

earnest phoenix
#

same

compact pier
#

bruh

#

fuck

earnest phoenix
#

xyz is good for people who aren't serious

compact pier
sudden geyser
#

even googlers don't like xyz

earnest phoenix
#

lmaoo

compact pier
#

fuk

sudden geyser
#

think about the naive user who's going to visit your site

#

they're probably going to think twice about clicking on your site if it has .xyz in it

#

given the scams they've probably seen with it

rustic nova
#

Time to make a fortune with cringe.dev

sudden geyser
#

but not take the same consideration into a .com

earnest phoenix
#

idk

#

a lot of scam sites are on .com now as well

#

really no tld is safe

sudden geyser
#

the tld usually doesn't make one site safer than the other

#

but the kind of sites you view usually fall into some domain camps

earnest phoenix
#

that is what I mean

compact pier
#

what is tld

sudden geyser
#

top level domain

compact pier
#

ah

earnest phoenix
#

yea

compact pier
#

the fact that i misspell what to that but ppl still understand

#

lol

sudden geyser
#

the point is, if you care about having a shiny site, you should consider more popular, reputable domains like .com, .org, .dev, etc.

split hazel
#

does .com have virus

earnest phoenix
#

yes

#

factual

compact pier
#

idk man

#

maybe after 2 year, I will buy new one

#

:))

earnest phoenix
#

here comes woo

compact pier
#

I already paid for it

earnest phoenix
#

time to woo us woo

solemn latch
#

👀

earnest phoenix
#

paying for more than a year imo is a bad idea unless you know you're going to keep that project going

compact pier
#

it is my profile website

earnest phoenix
#

portfolio?

#

nice

compact pier
#

yeah

solemn latch
#

I would think the lower visit count of xyz matters less when paired with a bot.

If its for just a site it probably is more of an issue.

earnest phoenix
#

mee6.xyz

compact pier
#

yey finaly a good example

#

for a safe website

earnest phoenix
#

who said it was safe

compact pier
#

fuk

#

well it is kinda popular tho

earnest phoenix
#

but it takes ur money for half the features of the bot

sudden geyser
#

mee6 itself is a virus that spreads to other servers

earnest phoenix
#

😩

sudden geyser
#

you should look at what they were doing with auctions

earnest phoenix
#

mee6 might as well be a well played out scam with how much money it be making

sudden geyser
#

yeah bro we use your money to maintain mee6 for years to come but we'll gladly dash out 3k on having a top spot

earnest phoenix
#

Lmao

compact pier
#

they paid a lot for ads

spark flint
#

mee6 owns mee6.bot

#

why not use that

earnest phoenix
#

They dont even need the top spot anymore which is why I think they stopped

#

mee6 is popular enough now that it gains servers from the servers its already in

compact pier
#

yeah

#

and the bot is kinda new (then dyno or some other bot)

#

but grow much faster

earnest phoenix
#

Imagine how much money they make from the 16m servers

compact pier
#

13k

#

a month

#

:0

earnest phoenix
#

where is that at tf

sudden geyser
#

and they said bots can't be profitable

compact pier
earnest phoenix
#

icic

compact pier
sudden geyser
#

oh

#

yeah that's not the actual amount mee6 racks in

earnest phoenix
#

their premium lifetime plan is 90$

compact pier
#

like paying once?

#

or every month?

earnest phoenix
#

12$ a month for premium

spark flint
earnest phoenix
#

So it is enticing to buy lifetime if you have the money

spark flint
#

thats how much servers are making

#

not mee6

earnest phoenix
#

yea

spark flint
#

thats their membership feature to monitize servers

earnest phoenix
#

I read it further

#

lol

compact pier
#

ahhh

#

like server boost

earnest phoenix
#

mee6 wont publicly show how much they are making

compact pier
#

yeah

earnest phoenix
#

But its easy to guess when they used to bid 10k for top spot

compact pier
#

imagine a legend copy all feature that mee6 have and give to discord comunity for free

earnest phoenix
#

maybe even ore lmfao

spark flint
#

3 spots, $10k each, one week

earnest phoenix
#

I wouldnt be surprised

#

Someone could do that

#

but it would be pointless

compact pier
#

discord is kinda sweat spot to earn money, if you how to

#

for bids

lyric mountain
earnest phoenix
#

coca cola case?

earnest phoenix
#

is that some copyright case that happened or smth

compact pier
#

i think it is about branding

#

like ppl prefare to use something familiar with them

#

instead something new

lyric mountain
#

But would it be coca cola?

earnest phoenix
#

lol

compact pier
#

like u drink pepsi and cola when ur eyes are closed, it will taste the same

#

but with eyes open

#

cola will be better

lyric mountain
#

Not even joking, it's not hard at all, but the name "coca cola" is what makes you auto lose against it

earnest phoenix
#

pepsi is better by far

compact pier
#

I alway buy pepsi

lyric mountain
#

Coke is bad, it's just cuz many tried to do it

#

So it's a known case

earnest phoenix
lyric mountain
#

It does, cuz you won't be able to maintain the cost

compact pier
#

if one day cola change the name to something else and sell it, ig nobody gonna buy it

earnest phoenix
#

hm?

lyric mountain
#

Coca can profit cuz their branding is widespread and very famous

#

So they can use expensive machinery and ingredients and still profit heavily

sudden geyser
#

and because it can't stop trying to make its name sound cool ("the coca cola company")

lyric mountain
#

Yours would taste exactly the same, but you'd lack the "famous" part, so your brand would slowly die

earnest phoenix
#

the coke company would be better

#

thats what is was back in the day

compact pier
#

yeah, so if u make a moderation bot, there is no way to beat those giant rich ass bot (dyno, mee6 bla bla)

lyric mountain
#

Kinda

#

Cuz you'd not come anywhere near its profit

compact pier
#

well if u have a lots of money

#

u can

#

with ads

#

but a lots

sudden geyser
#

know your target market

lyric mountain
#

So you'd not be able to maintain the hardware and ads

earnest phoenix
#

I mean as long as you can make yours appeal more to the people you could probably do so

lyric mountain
#

A big software should be able to pay for itself

earnest phoenix
#

Yea

#

you shouldn't be constantly spending money out of your own pocket

compact pier
#

yea, if u spend money but it won't return any profit and u will die

earnest phoenix
#

yo haku you use java right?

lyric mountain
#

Ye

compact pier
#

i can't imagine how mee6 are risking their life to spend those money for ads

earnest phoenix
#

What do you even make most of the time?

lyric mountain
compact pier
#

when they just created it

lyric mountain
#

Oh, they didn't

earnest phoenix
#

they werent spending a lot when htey first started

compact pier
#

oh

earnest phoenix
#

back when mee6 came about not many bots were like mee6

lyric mountain
#

Mee6 is from the very beginning of discord

#

When the market was small

earnest phoenix
#

yea

modest maple
#

When the market was tiny

lyric mountain
#

So mouth spread took em far

compact pier
#

lol

earnest phoenix
#

the market was almost non-existent

lyric mountain
compact pier
#

what is that

lyric mountain
#

And occasional bug fixing

lyric mountain
compact pier
lyric mountain
#

Kinda like yugioh or hearthstone

earnest phoenix
#

You are making your own trading card game?

lyric mountain
#

Already did abt a year ago

earnest phoenix
#

O thats cool

compact pier
#

But kinda sad, cause those bots aren't impressing the interviewers

lyric mountain
#

But since all cards have to be manually done...yeah it takes a lot of time

earnest phoenix
#

oliy is a super rare card :^)

lyric mountain
earnest phoenix
#

is the tcg available to other people to mess with

lyric mountain
#

But in portuguese

earnest phoenix
#

trying to beat mee6 is like beating a dead dog with a stick

#

its utterly useless

lyric mountain
#

Didn't have enough wills to i18n it yet

earnest phoenix
#

Oh lord have fun

#

I hate implementing i18next

lyric mountain
#

More than a million strings? Nah thanks

#

One day maybe

earnest phoenix
#

Just get a bunch of volunteer translators

#

ez

#

or google translate the fuck out of shit

lyric mountain
#

The hard part is that I still need to collect the strings into a file

#

Most of it is still hardcoded

earnest phoenix
#

oof

lyric mountain
#

Yeah, the pain

earnest phoenix
#

One of the reasons why if ima implement localization ima lay the foundation down closer to the beginning

#

So it wont be nearly as annoying later on when I start translating multiple languages

lyric mountain
#

I didn't know early enough about i18n, when I started it was already a big ball

earnest phoenix
#

lol

lyric mountain
#

If only I knew java had a native way to i18n

earnest phoenix
#

even I dont know much about i18n

#

wait java has native way to i18n?

lyric mountain
#

To support it, yeah

#

Locale bundles

earnest phoenix
#

damn

lyric mountain
#

I18n is basically a big file of strings in a property format

#

Then u clone that file and translate to another lang

sudden geyser
#

i18n is usually a mess since everything's strings

#

and it's hard to manipulate

lyric mountain
#

I remember u when u found out everything is a string there

#

But well, since java has positional placeholders you can just format it

#

The hardest part would be making that file

sudden geyser
#

imo positional placeholders isn't good enough

#

it helps with variables but not when those variables need edgecases as well

#

like how many items are in a list: no items, 1 item, or N items

#

functions are cool for that

#

or the localizer will get fancy and do that for you

#

or you'll make a localized key for each item

lyric mountain
#

Oh for that I make custom collectors

#

Inside those collectors you can also i18n captions

sudden geyser
#

example pls

lyric mountain
#

Like, make a file of singular/plural values

#

And use those like u mentioned above

#

Unless you also allow custom values, but then you can always use "s" or custom regex to detect whether s is a valid plurality

#

English has regex for that iirc

sudden geyser
#

yeah but that's english-specific

lyric mountain
#

Multiple regexes

#

Or plurality file

sudden geyser
#

sounds interesting

#

I just think functions would be simpler to work with

#

the most I've done with localization is with an Xcode project

#

but it didn't have functions and instead handled edge cases for you

worn sonnet
#

How can I get the text something like this

sudden geyser
#

fetch a message and access it's .content?

worn sonnet
#

the hyperlink in message content

sudden geyser
#

well it's markdown so you'd need to parse the message content and extract the link

#

you probably have a library for that

worn sonnet
#

No No No.... my friend I want my bot to be able to send a message with hyperlink

#

in message body content

sudden geyser
#

Ah, you can only do that with webhooks.

worn sonnet
#

Oh that's unfortunate

sudden geyser
#

But it's regular markdown: [Google Search](https://google.com/)

worn sonnet
#

Yeah I understand that. Still thanks for the info

#

Didn't knew webhooks are capable of hyperlinks in message body content

compact pier
#

it is only for the embed

#

as I remembered

sudden geyser
#

Webhooks can use links in the content and embeds

#

Regular bots can only use it in the embed

solemn latch
#

Oh that's intresting.

signal estuary
sudden geyser
#

depends on your library

earnest phoenix
#

a obvious question but I'll ask it anyways. Can I make my bot send the invite of all the servers he's in? Or individually by name

slender thistle
#

Why

sudden geyser
#

You can, but it's likely unsolicited.

earnest phoenix
#

oh ok

sudden geyser
#

Most likely for backdoor functionality.

earnest phoenix
earnest phoenix
sudden geyser
#

If you need an invite to a server, you should ask a member (excluding your bot).

earnest phoenix
#

ok

lyric mountain
#

Not only a member, someone from the server's staff