#development

1 messages · Page 2074 of 1

oak cliff
#
async function getSelfroles(client, guild) {
    let data = await models.guild.findOne({ guildID: guild.id });
    return data.selfroles;
}```
round cove
#

I manually do ctrl+s after everything I type so I never worry Xd

oak cliff
#

i guess i dont really need to pass client do it

round cove
#

hell yeah xiuh

oak cliff
#

do i*

sharp geyser
#

You could make that shorter

round cove
#

no you don't need client OR the guild object

#

just pass guildId

oak cliff
#

oh true

#

work smarter not harder

sharp geyser
#
async function getSelfroles(client, guild) {
    return (await models.guild.findOne({ guildID: guild.id })).selfroles
}```
#

This works doesn't it Dylan?

oak cliff
#

yes we must one line EVERYTHING

round cove
#
export const GET_GUILD_SELFROLES_BY_GUILD_ID = (guildID) => models.guild.findOne({ guildID }).selfroles;```
sharp geyser
#

I don't remember I haven't used js in a while

oak cliff
#

what

#

i can read that but barely

#

lmao

round cove
#

You don't need the async/await btw

#

Since it

#

s already a promise

sharp geyser
#

I mean saving the result to a variable is useless if all you're going to do is returns prop from it

oak cliff
#

oh true

round cove
#

there

#

edited

oak cliff
#
async function getSelfroles(guildID) {
    return models.guild.findOne({ guildID: guildID }).selfroles
}
#

?

round cove
#

yeah

oak cliff
#

i plan on having a bunch of functions in this file and exporting them all

#

into client.functions

round cove
#

I personally like all caps for mongo methods so I can easily spot then in code blocks

sharp geyser
#

weirdo

quartz kindle
#

i never had problems with it, it doesnt auto-save, but saves the in-progress changes in the session, so next time you open it, the changes are still there

oak cliff
#

is it better to export them one by one or all at once

round cove
#

That's a personal thing

oak cliff
#

my old functions folder has this:

round cove
#

I like barrel exporting/importing and only importing what I ened

oak cliff
round cove
#

So I export everything by itself

sharp geyser
#

How do you even do a barrel file in normal js

oak cliff
#

ill get to condense that a lot this go round danceDuckFluff

round cove
#

I literally have never coded normal js

#

so idk how exports work in it

oak cliff
#

i feel so much more confident as a coder than i did when i first wrote una a year ago

round cove
#

I went straight from C++ to TS

sharp geyser
#

I did ages ago but I didn't know barrel files were a thing until ts

round cove
sharp geyser
#

Just wait until you make a dashboard if you haven't already xiuh

oak cliff
#

i dont know

#

ANY

#

web dev

sharp geyser
#

Same

#

I just know backend

round cove
#

people that make dashboards do them all wrong and insecure I feel

oak cliff
#

my website right now is made with carrd LMAO

round cove
#

I haven't even finished mine out of being scared

sharp geyser
#

Dylan shut up

round cove
#

and i have all my jwt stuff done 😭

sharp geyser
#

I've seen your bot's dashboard

#

it is 10/10

round cove
#

Oh really? Where.

#

Go on

#

What dashboard

#

link it rn

oak cliff
#

btw is this correct

#

i couldnt find a list of PermissionFlagsBits

sharp geyser
round cove
#

Oh interesting

#

Is that a d.js thing?

oak cliff
#

im using the discord.js slashcommandsbuilder yeah

sharp geyser
#

But i've seen it during your streams

round cove
oak cliff
#

the example has KickMembers and BanMembers but then i couldnt find a list of all of them in terms of "permissionFlagsBits"

round cove
#

ads ads ads

#

!!!

oak cliff
#

banned

sharp geyser
#

ah

#

Honestly I just call anything bot related a dashboard at this point

round cove
oak cliff
#

they did yeah with the most recent update

sharp geyser
oak cliff
#

okay cool

round cove
boreal iron
#

Yeah very as well as accurate member permissions running the command

sharp geyser
#

that method takes in a PermissionResolvable which can be a bit flag

round cove
#

oh there it is lmao

oak cliff
#

yeah what the default permission does is hide the command in the list unless they have the perm

round cove
#

I might need to change that

#

But is that PER command or when generating?

oak cliff
#

uh

#

idk?

boreal iron
round cove
#

like you're not making your help command manager server only right

oak cliff
#

oh no this is for the settings command

round cove
#

so it's per command then ok

boreal iron
#

iirc they removed all that guards and force you to check the interaction.type yourself now

oak cliff
#

do i need to await interaction.replys

round cove
#

I mean that's not hard with TS typeguards so it's not going to be a big change

round cove
#

what's the context

oak cliff
#

well im just returning so i dont thik so

boreal iron
#

Better don’t ask why

oak cliff
#

i only need to await if i need the code to wait, right

#

im so dumb

round cove
#

Yes

#

If you want that line of code to finish before the code below it runs then yes you need to await it

boreal iron
round cove
#
async function func() {
  // await..
  await someAsyncFunction();
  //this code has to wait for the above to finish and resolve
  otherfunction();
}```
oak cliff
#

right, gotcha

#

i should await like

#

db fetches

round cove
#

Only if you want to like show the data or want to use that data then and there

boreal iron
#

If they’re async then yes you should

round cove
#

You'll see your IDE complain that you're trying to access a promise otherwise.

#

If you DON'T need to wait then you can use .then()

boreal iron
#

Imagine using notepad ++

#

It will never complain

#

I like it

quartz kindle
#

look into the documentation of tje stuff you use, if they return a Promise, they need awaitinf

oak cliff
#

why are they called promises

#

i promise this is the right thing you want

round cove
#
function func() {
  // some promise 
  someAsyncFunction()
    .then(data => {
      // do something with data
     });
  //this code doesn't have to wait
  otherfunction();
}```
sharp geyser
#

cause they promise to do what you want

quartz kindle
#

because they promise to return the value sometime in the future

#

but not right now

round cove
#

they can throw

#

then we cry

sharp geyser
#

that is when you throw back

#

use them hands

round cove
#

lmfao

#

boreal iron
#

lol

sharp geyser
#

you tell me to check out prisma but now I have a new problem dylan

boreal iron
#

Yes loop the promise until it returns what you want

sharp geyser
#

idk what the fuck to make

round cove
#

random number api

quartz kindle
#

prisma bad

#

use lmdb :^)

round cove
#

hot tim take incoming

sharp geyser
#

dont make me

quartz kindle
#

lmao

#

how about

boreal iron
quartz kindle
#

an image-based storage

boreal iron
sharp geyser
#

I will just finish tims astrology api

quartz kindle
#

that stores data in png files

sharp geyser
#

so we can finally use it

quartz kindle
#

as binary

#

ans then you open tje image to see how your data looks like

sharp geyser
#

tim's api coming soon in 2025

boreal iron
round cove
#

@oak cliff any other Qs?

sharp geyser
#

do you have any more As?

oak cliff
#
for (const key in settings) {
        if (data[key] !== settings[key]) {
            data[key] = settings[key];
        };
    };
quartz kindle
#

only QTs

oak cliff
#

this will update my thing correctly right?

#

its what i had before but im not sure if i understand what its saying properly

round cove
oak cliff
#

i think i just copied it for

round cove
#

show more of the code and where data is coming from

oak cliff
#

from

#

a tutorial

boreal iron
#

lol

oak cliff
#

i know im a bad child

boreal iron
#

Can’t be wrong then

oak cliff
#

okay so i am creating an "updateselfroles" function

#

ill pass the guildID and the new selfroles array

sharp geyser
#

can't you just use the normal update method mongo provides?

round cove
#

yes

#

the push method

oak cliff
#

this is the old function

async function updateSelfroles(client, guild, settings) {
    let data = await client.functions.getSelfroles(client, guild);

    if (typeof data !== 'object') data = {};
    for (const key in settings) {
        if (data[key] !== settings[key]) {
            data[key] = settings[key];
        };
    };

    console.log(`[${data.guildID}] updated SELFROLE settings.`);
    return await data.updateOne(settings);
};
sharp geyser
#

👀

round cove
#

I ltierally have the code here

sharp geyser
#

That is way cleaner

oak cliff
round cove
#

Keep in mind my joinRoles property is a string array. I don't know what your selfroles property is.

#

I assume it's also an array of just role IDs

oak cliff
#

a string array yeah

round cove
#

Cool

oak cliff
#

of role IDs yeah

round cove
#

Then yeah my code is what you want

sharp geyser
#

dylan spoon feeding

#

smh

round cove
#

sorry

sharp geyser
#

just kidding

round cove
#

she's making MY bot

sharp geyser
#

Lmfaooo

oak cliff
#

okay so the first {} is what im searching for

#

the second {} is what im updating

#

and im noT MAKING YOUR BOT

round cove
#

Yes

oak cliff
#

mines DIFRFERENT

round cove
#

my bad

sharp geyser
#

Lol

round cove
#

partnership time?!?! Una X RoleBot???

oak cliff
#

wait so you don't need to specify what key youre searching for?

round cove
#

rolebot hit 3300+ recently

oak cliff
#

you have just { guildID}

oak cliff
#

and not {guildID: guildID}

#

is it cause its the indexed thing

round cove
#

In JS if the object name si the same as the property you don't have to do that

oak cliff
#

OOH

boreal iron
sharp geyser
#

Xiuh's first dev question in development wew

#

xiuh you very old member

round cove
#

xig accepted my bot back in 2018 or something

oak cliff
#

i remember that issue

#

it fucking SUCXKED

#

never figured it out

#

wait so can i do this models.guild.findOne({ guildID }).selfroles

sharp geyser
#

lol

round cove
#

no

#

What are you trying to do with that

oak cliff
#

i have to put { guildID: guildID} ?

sharp geyser
#

no

round cove
#

no

oak cliff
#

im just confused when i have to specify the key

sharp geyser
#

but you are doing .selfroles on a promise

round cove
#

you dont if the variable is the same

#

I thought you were trying to update selfroles there

#

If you were you're wrong

oak cliff
#

thats from earlier

round cove
#

if not the finding is fine

#

yeah that's fine

oak cliff
#
async function getSelfroles(guildID) {
    return models.guild.findOne({ guildID }).selfroles
}```
round cove
#

yeah that's fine

sharp geyser
#

ah

oak cliff
#

thats pog

sharp geyser
#

ye that is fine I was confused for a sec sorry xiuh

oak cliff
#

okay

sharp geyser
pale vessel
#

Promiseee

oak cliff
#

sorry im dumb

round cove
#

no you're not

#

you're LEARNING first of all

#

i just misunderstood what youw ere asking

sharp geyser
#

wait dylan am I dumb or shouldn't that error?

pale vessel
#

await it

round cove
oak cliff
#

what does $each mean

sharp geyser
#

until the promise is awaited wont .selfroles error?

pale vessel
#

It won't error it'll probably just say undefined

round cove
sharp geyser
#

well yea

round cove
#

basedbasedbased

#

sorry that was weird

oak cliff
#

do i need to do return await models.guild.findOne

round cove
#

lol

sharp geyser
#

yea you just return the promise entirely

#

and probably await it when calling the func

pale vessel
#

return (await get())?.selfroles

round cove
#

my snippet above shows if you pass the property you want found from the object it'll return it when the promise resolves

oak cliff
#

im confused again

sharp geyser
#

selfroles doesn't exist on a promise so you have to await ti first

oak cliff
#

so this?

async function getSelfroles(guildID) {
    return await models.guild.findOne({ guildID }).selfroles
}
sharp geyser
#
async function getSelfroles(guildID) {
    return (await models.guild.findOne({ guildID })).selfroles
}
round cove
# oak cliff what

joinRoles is the property on my guild object, so I find by guild Id and return the joinRoles array from it

#

removes the need for async func

sharp geyser
pale vessel
#

Use ?. since it might not find it by guild id unless you're sure it exists

oak cliff
#

oh so i could do this:

async function getSelfroles(guildID) {
    return models.guild.findOne({ guildID }, 'selfroles')
}
round cove
#

yes

oak cliff
#

and that just returns the selfroles property

round cove
#

right

pale vessel
#

An object that has the property

oak cliff
#

when i call the function, i need to await it

sharp geyser
#

This is why dylan is handling this

#

I didn't even know you could do that in mongo

round cove
ashen orbit
#

ok

sharp geyser
oak cliff
#

const selfsettings = await client.functions.getSelfroles(interaction.guild.id);

pale vessel
#

It's projection

round cove
oak cliff
#

then "selfsettings" will be the array of roleIDs

ashen orbit
#

ok

#

i here

sharp geyser
oak cliff
#

big brain

pale vessel
#

It returns an object that has selfroles

proven escarp
# ashen orbit i here

Ok so basically you want to listen for a GET request to a specific route and then send a specific .html file on request to that route...

pale vessel
#

Use selfsettings.selfroles

proven escarp
#

you can use express for that

oak cliff
#

ah

proven escarp
#

infinity free isn't hosting right?

ashen orbit
#

it is

sharp geyser
pale vessel
#

It's for only grabbing specific properties

oak cliff
#

like this ?

round cove
sharp geyser
#

Yea but if you are grabbing it won't you just get the values

pale vessel
#

If you want to mutate the result you'd have to aggregate them

proven escarp
oak cliff
#

what does the ? do?

ashen orbit
#

im using it for mt websitre

#

i dont have any other hosting

proven escarp
#

i have to leave but maybe someone here more experienced with infinityfree could help you

round cove
#

it means if it's null it'll not crash and ignore it

ashen orbit
#

ok

#

guys

sharp geyser
oak cliff
#

but it shouldnt be null right

#

cause you set a default

round cove
#

how the FUCK is there 40240320 convos goin on in here

ashen orbit
#

how to host my domain with nodejs

round cove
#

someone jump into VC

sharp geyser
#

if you know it exists then you dont

#

Account got banned

#

😔

ashen orbit
#

how do i host my website with nodejs

#

ive got a domain

oak cliff
#
async function updateSelfroles(guildID, roleID) {
    return models.guild.findOneAndUpdate(
        { guildID },
        { $push: {
            selfroles: {
                $each: [roleID]
            }
        }}
    );
};```
round cove
#

<MMIST?

real rose
#

ou everyone spying

ashen orbit
#

hey

#

how do i host my website with nodejs

pale vessel
oak cliff
sharp geyser
oak cliff
wheat mesa
#

battle of the documentation

boreal iron
#

lmao

boreal iron
#

Be aware

round cove
oak cliff
sharp geyser
#
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
round cove
boreal iron
#

Oof Dylan using the builders pepowot

round cove
#

?

boreal iron
#

MessageSelectMenu constructor

#

Which is part of the builder tools

#

Why if you can easily use an object 😮

round cove
#

fuck that

round cove
sharp geyser
boreal iron
sharp geyser
#

wtf

#

why is it just black

boreal iron
#

Just removed the labels and values okeh

#

Top secret stuff KEKW

round cove
boreal iron
#

Well that’s how the API expects it

#

No reason to use the continuously changing djs methods to build that

#

But I see

#

We need some general exorcism in here

boreal iron
sharp geyser
bright hornet
#

Someone knows how to sort inside of .exec function on mongoose?

 account.find({})
     .exec((err, res) => {
         for (i = 0; i < res.length; i++) {
             if (res.length === 0) {
                 embed.setDescription("NO DATA")
             } else if (res.length > 0) {
                //Over here I wanted to sort bank and cash individually
             }
         }

         message.channel.send({
             embeds: [embed]
         })
     })
bright thorn
#

anyone can help me in hybride shard

#

am unable to send a msg

eternal yarrow
bright thorn
#
 let evaled = await client.cluster.evalOnCluster(
            (c, ctx) => {
              let guild_name = c.guilds.cache.get(ctx.guild).name;
              c.channels.cache.get("962900407686946876").send({
                  embeds: [
                    new (require("discord.js").MessageEmbed)()
                      .setColor(c.settings.embed_color)
                      .setFooter({ text: `c` })
                      .setDescription(
                        `Removed premium from a guild.\n\nGuild's Name: \`${guild_name}\`\nGuild's ID: \`${ctx.guild}\`\nReason: \`Validity Expired\``
                      ),
                  ],
                });
              return { success: true };
            },
            {
              context: {
                guild: data.id,
              },
              guildId: "827383182630322267",
            }
          );
rose warren
round cove
#

Haven't had issues so far but yeah v14 isn't out yet.

rose warren
#

I'm not looking forward to v14 why_ducky it feels like I just upgraded to v13 last week kekw

round cove
#

I trust d.js to update accordingly, it's not like they haven't been doing this for awhile so I don't have any issues or qualms.

#

Just as easy if discord changes what the request body should be like.

sharp geyser
#

dylan you done with your 3m run?

rose warren
#

Yeah but I figured if I use the request body instead of the builder at least that's only one way it can change. Either discord can change the request body or djs can change the way builders work so i figured it was one less way it could change darkAYA

round cove
sharp geyser
#

nice nice

#

get them steps in

round cove
#

the incline is the important part

#

yeah 10k steps

rose warren
#

Pog

#

Touching grass

round cove
#

planning a trip to Japan in the spring with friends so wanting to be fit, so doing 3mile walks each night.

rose warren
#

Amazing!

round cove
#

3mile walks, eating more protein, eating less in general

#

So gotta prep

rose warren
#

Nice

round cove
#

Japan aint READY

rose warren
#

That's gonna be awesome

#

In the spring too

#

It's gonna be so pretty

round cove
#

Yeah I wanna see the cherry blossoms bloom.

rose warren
#

Fr

round cove
#

They are in such a small window.

rose warren
#

That's when I want to go too darkAYA

round cove
#

I'll be seeing you there

#

😏

sharp geyser
#

Mac and Dylan meet

#

o sheet

rose warren
#

Not this year... 👀 Or maybe I will?

round cove
#

Yeah that's why I said next Spring

#

NEXT year

#

2023

eternal yarrow
rose warren
#

Wait when's spring in Japan

eternal yarrow
#

as you do with top..gg links

round cove
#

Japan is in the northern hemisphere

#

So March-April

round cove
rose warren
#

Yeah that's what I thought it's the same

eternal yarrow
bright hornet
sharp geyser
#

Seems like no one else faced this issue enough to talk about it in the repo either at least I couldn't find it

eternal osprey
#

hey guys, i am trying to create a json element that looks like this:

{
variable1 : 0
}``` how would i try to pass that variable1 tho? As i tried ${} and ` marks, but it needs to be a "".
sharp geyser
#

pass?

#

What exactly are you asking for

sharp geyser
#

What does that have to do with what they are asking

near stratus
eternal osprey
#
 {
        interaction.options._hoistedOptions[1].value : 0
       }``` This won't work because of the . and _. I am finding a way to pass this variable as a new element key.
sharp geyser
#

but stringifying it doesn't do that

eternal osprey
sharp geyser
eternal osprey
eternal osprey
sharp geyser
#

stringify turns it into a stringified json, parse turns it back into a usable json format

near stratus
sharp geyser
eternal osprey
near stratus
#

object > json

eternal osprey
#

this is the issue i am encountering

sharp geyser
#

That is a string dingus

near stratus
sharp geyser
#

that isn't valid json

eternal osprey
#

yeah i know, so i am trying to find a way to use that variable as key name

sharp geyser
#

What you are trying to achieve can be done by writing the json beforehand and then saving it to the json file

#

but I am wondering why you want to even do this in the first place

eternal osprey
sharp geyser
#

Wdym

#

If you wanna add anything new then just append to it?

eternal osprey
#

for example, /test 5. If the number 5 isn't in the file, it should add it.

sharp geyser
#

then do so

#

What you wanna achieve can't be done in the json file itself

eternal osprey
#

well yes, but i am working with options and for that i need to get that variable name and use it

sharp geyser
#

Why are you even saving them to a json file

near stratus
#

when your machine doesn't support sqlite

eternal osprey
#

nvm i fixed it

#
let k =interaction.options._hoistedOptions[1].value ```
#

and just pass that k as key name

sharp geyser
#

I am still confused why you wanna save the options ot a json file

eternal osprey
#

i was thinking stupid

eternal osprey
sharp geyser
#

yes but what is the benefit of saving them

#

are you going to use them later for other things?

eternal osprey
#

yeah

sharp geyser
#

and will this json file have a constant read/write?

near stratus
#

shouldn't storing at memory be enough

eternal osprey
sharp geyser
#

depends if they need it outside the current scope or not

#

if they only need it in the scope of the current running command then saving it is pointless

eternal osprey
#

If you guys know an easy alternative to use, i could instead of json use that ofc

sharp geyser
#

especially for info you will need for the bot to function

sharp geyser
#

its a disk oriented db as it saves it to a file on the disk

eternal osprey
eternal osprey
dry imp
#

corrupted

uneven tartan
sharp geyser
#

It's far easier than something like postgres

#

I also suggested SQLite as it doesn't require you to have a server going to use

eternal osprey
#

Wow i am really appy that i switched to djs v13.

#

It's so cool to work with those modals, etc etc.

#

Pretty hard at first, but really fun

proven escarp
#

"the discord api is really fun" 💀

#

famous words before dying of cringe

vivid fulcrum
#

the discord api is a programmer's representation of the bipolar disorder

pearl trail
near stratus
#

see ya in 9 month

boreal iron
eternal osprey
#

again

winged linden
#

yo anyone know why this aint working? i got the SchemaTypes as numbers

eternal osprey
#

they need to fuck off with their updates. v13 is enough

#
channel_id: Value "id" is not snowflake``` How do i tail where this issue is coming from>??
pearl trail
boreal iron
#

Has been like 90% for almost one year

winged linden
pearl trail
boreal iron
boreal iron
#

There are many known internal issues - still - causing lots of features to not work atm

#

Which will cause a lot of API errors but caused by the lib

eternal osprey
boreal iron
#

Well invalid form body can’t have much possibilities

#

Must be some content you wanna send to a channel using channel_id as argument for the channel resolveable

#

So… search up that var channel_id and find out

quartz kindle
#

did v14 did any improvements to caching? or does it still not support disabling channels for example

#

i really dont want to update djslight

boreal iron
#

I hope you don’t ask me

quartz kindle
#

no i hate math

boreal iron
#

meth

sharp geyser
#

Well too bad graph this function f(x)=x^(2/3)+0.85*(4-x^2)^(1/2)*sin(10*π*x)

#

It leaves a cool message

boreal iron
#

When I left school like ages ago I was sure I would never see this again

#

Damnit Misty ruining my expectations

quartz kindle
sharp geyser
#

<3

boreal iron
#

lmao

#

Google knows anything

sharp geyser
#

It only knew to graph it cause of f(x)

quartz kindle
#

i dont understand graph maths

sharp geyser
#

I'm sure if you left that out it'd try and equate it instead

sick agate
sharp geyser
#

Huh

sick agate
#

i suck at math

boreal iron
#

If so it would be a strange heart

#

flat heart theory soon, I swear

sharp geyser
#

Honestly 10 should be a variable but I set it as 10 so it could be a more well defined heart

#

f(x)=x^(2/3)+0.85*(4-x^2)^(1/2)*sin(a*π*x)

#

This is the original function

#

If you lowered what a was it'd be more stretched

tired panther
stable eagle
quartz kindle
#

neither do i

#

never got there in school

pearl trail
#

trigonometry 😩

sharp geyser
#

It is a trig method

#

It basically takes the opposite and hypotenuse of a triangle

#

And gives you the angle you're looking for

#

sin, cos, tan and then there is cos-1, sin-1, and tan-1 which are inverse and they are commonly used for finding a missing side and such

vivid fulcrum
#

i don't know whether i want to keep working on this or should i move to other projects

#

i'm currently stacking public apps as much as i can on my github profile

cinder patio
#

cool

#

although you may also want to add an online version so people don't have to install it just to try it

vivid fulcrum
#

that's actually a good idea

#

shouldn't be a problem since the frontend is react

#

tyvm

boreal iron
#

that day you finally update the packages on your servers

fossil bronze
#

Anyone know about the discord/d.js problem where you get double button presses?

earnest phoenix
boreal iron
#

yeah, I see that event being submitted two times, sometimes, too

#

at least in the current v14 dev build

earnest phoenix
#

It wouldn't be surprising in an unstable build, which is v14

boreal iron
#

yeah haven't seen this in v13 so far

fathom sonnet
#

hii guys, so i making an command which will send bot updates to assigned channel... channel and guild id are saved to db, but, now i have problem with this:

here Guild: si empty cuz idk what to actually use...

If this was some other event, like for example messageUpdate, i would use message.interaction.id

but for ready, idk what to use

#

if you guys get me

boreal iron
#

fetch the guild you wanna send updates to, then fetch the channel, then send messages to it

#

but idea of sending a message to a channel on each event is very bad

earnest phoenix
#

You're sending a message regardless of specific guild IDs, you're supposed to not pass a guild ID and get the proper documents

#

And you can send them to a single announcement channel in the bot's support server for example, and let users follow the said announcement channel in their own servers to receive messages

fathom sonnet
#

ahh good idea

boreal iron
#

so in your case, let guild = await clients.guilds.cache.fetch(...) then fetching the channel const channel = await guild.channels.fetch(...) then sending your message to it

earnest phoenix
#

All guilds and channels are already cached by default, so there's no point in fetching them

boreal iron
#

WHAT DOES FETCH DO AS FIRST

#

YES

#

you know it

earnest phoenix
#

It checks the cache, then again there's no point when all of them are cached

boreal iron
#

dingus

earnest phoenix
#

Dum dum

boreal iron
#

get() won't be available as method in v14 anymore

#

so fucking use fetch()

#

doesn't matter since the cache check

earnest phoenix
#

Who says it won't be available?

boreal iron
#

according to the docs it has been renamed to resolve()

earnest phoenix
#

The managers will still have the caches as collections, and the collections won't be removing the get() method

#

The get() method isn't bound to the managers

boreal iron
#

hmm true

#

looks like they just removed this documentation

#

since collections are documented separately

earnest phoenix
#

Exactly

boreal iron
#

but still doesn't matter to use fetch() or not

#

except the promise

earnest phoenix
#

It does matter performance-wise, you're creating a pointless promise

boreal iron
#

"performance-wise" lol

#

he wanna send a message on every event

#

fuck performance I guess

#

and rate limits

earnest phoenix
#

This isn't about what they want to do anyway, they're speedrunning getting ratelimited

boreal iron
#

also db request on every event

proven escarp
#

💀

proven escarp
boreal iron
#

is that quickdb he's using? idk tbh

earnest phoenix
#

They're using Mongoose as it seems

boreal iron
#

I will never use anything else than SQL anyways

proven escarp
proven escarp
earnest phoenix
#

Use PostgreSQL and join the cool kids club

boreal iron
#

never even heard of this

boreal iron
proven escarp
boreal iron
#

no benefit for me switching from mariadb to postgres

earnest phoenix
#

FakE news once again

proven escarp
#

i use cockroach db cause ||cockroach||

#

funni

#

💀

boreal iron
earnest phoenix
#

Also I think Discord switched from MariaDB to something else

proven escarp
#

cassandra db 💀

boreal iron
#

=> /var/database is using 87.2% of 917.09GB

proven escarp
#

wtf

boreal iron
proven escarp
quartz kindle
#

nais

proven escarp
#

too big

earnest phoenix
proven escarp
boreal iron
#

dbfs => /var/database 95.06% (934.22 GB of 982.81 GB)

#

makes me sad

#

seems like I need to invest into 2 larger SSDs

proven escarp
#

what are you storing 💀

boreal iron
#

that's a hash table

proven escarp
#

mmh

boreal iron
#

storing 4 billion hashes

#

hashes of Steam IDs

proven escarp
#

wtf

boreal iron
#

to resolve their hashes to get the Steam ID

#

since there's no other way to do it

#

4 billion is more than the current amount of steam accounts

#

so I got some time left until larger SSDs are needed

#

I do weird stuff I know

lyric mountain
#

Why are u even storing in an ssd?

boreal iron
#

to guarantee fast access times?!

#

and do you have any clue how long it takes to generate 4 billion records?

lyric mountain
#

Simply sort the hashes and partition it into chunks of ranges

#

Then access a specific chunk of data instead of iterating over all of it

boreal iron
#

Impossible as I need to provide the ID on request

#

not any coding language supports all this

lyric mountain
#

...hashes can be sorted

boreal iron
#

especially since we're tasking about game modding languages

#
[07.08.2020 19:32:23]  rcon_lookup.php  --  Task done in 1678467.279 s
[08.04.2021 13:07:57]  lookup_gen.php  --  Task done in 1317965.892 s
#

running that on a HDD will take weeks or longer to generate

lyric mountain
#

Only if u try to search the whole thing

boreal iron
#

I did already "heavily" optimise the second generation process

boreal iron
lyric mountain
#

Oh my

#

I'm not talking about matching the entire hash, I'm talking about finding a needle in a haystack

#

Simply sort the hashtable so u can get an approximate line number

boreal iron
#

which is the reason the database is that large, since they index take more than 50% of it's size

lyric mountain
#

Files don't need to be read from the beginning

boreal iron
#

ik, still makes a gigantic file

lyric mountain
#

Ik

boreal iron
#

the database is already heavily optimised, why the fuck should I not use it

lyric mountain
#

You don't get what I mean, and idk how to exemplify

boreal iron
#

even if creating a file is faster in the generation process, this will only be required if a SSD ever dies

#

yeah I feel like we're talking about two different things tbh

#

I will place a note on your profile, you're being weird sometimes if that's okay for you

lyric mountain
#

Show me how is ur hashtable structure

#

Maybe I can draw on it to show what I mean

boreal iron
#

will take some while

#

servers are currently upgrading

#

finally doing the release upgrade

lyric mountain
#

I imagine it's like hash-id pairs?

boreal iron
#

it simply is the Steam ID and two (different) hashes of it different game developers are using instead of using the Steam ID

#

idk why they're doing this

#

while the steam id actually has a static value I could technically get rid of the first 8 or 12 bytes if I remember correctly

#

but instead of puzzling things together after I gave a fuck and basically save the entire ID in the database together with the created hashes

lyric mountain
#
--------------- chunk (axxxx - bxxxx)
ahash - 1234
bhash - 5678
--------------- chunk (cxxxx - dxxxx)
chash - 9012
dhash - 3456
--------------- chunk (exxxx - fxxxx)
ehash - 7890
fhash - 1298

Not necessarily written like that, but like, break your data into sorted parts, then retrieve the part where your input hash is expected to be

#

So instead of 1b entries, u only need to search among 1m entries or so

boreal iron
#

some years ago I did save the records as binary data to reduce the size of the database but puzzling things together is annoying after since not any language have inbuilt methods to do so

lyric mountain
#

Ik most databases do this for indexed tables, alas why they're fast

boreal iron
lyric mountain
#

But you'd save on money, since even hdds would suffice

boreal iron
#

As I said I already did it differntly years ago but moved away from it again

boreal iron
lyric mountain
#

With high capacity?

boreal iron
#

those aren't SSDs using NVME protocol

#

1/2 TB aren't high cap anymore

#

4-6 is

lyric mountain
#

Ssd price to capacity ratio is way lower than hdds

boreal iron
#

yeah true, but still

#

one second

#
Data Units Read:                    2,629,944 [1.34 TB]
Data Units Written:                 26,978,377 [13.8 TB]
Host Read Commands:                 69,062,776
Host Write Commands:                501,245,975
#

estimated life time of about 300-400TBW

lyric mountain
#

How tf u write more than read?

boreal iron
#

so I guess they will still last long

#

oh wrong disks selected

#

ah shit... can't get the smart values

#

of those SSDs

#

since they being put together as hardware RAID

#

the raid controller can't share their smart data it seems

lyric mountain
#

Btw, why does steam use id hashes instead of the actual id?

boreal iron
lyric mountain
#

Or is that something u chose to?

boreal iron
#

for some reason some games don't use the Steam ID directly but hashes of it

#

idk why

#

maybe to "hide" the original Steam ID

lyric mountain
#

It's not like that's a sensitive (or even private) data

boreal iron
#

yeah don't ask me why

lyric mountain
#

It's like people hiding their bot id here when asking for help

boreal iron
#

it's stupid but there's no way to decrypt it (yeah ik there is, shut up) so a hash table is the solution

#

for every possible Steam ID

lyric mountain
#

So u basically bruteforce from 00000001 to 99999999

boreal iron
#

well unfortunately those are hashes of the Steam ID 64

#

but technically yeah I simply look up the account ID

#

from 1 to 4 billion

#

while currently only exist about 2.5 billion to 3 billion accounts

#

so I got some time left until Steam reaches 4 billion before generating more IDs

#

and hashes

lyric mountain
#

Are steam ids sequential?

#

Like discord?

vivid fulcrum
#

seems so

#

from the articles i found they increment over time

#

they don't seem to be using snowflakes though

boreal iron
#

yeah they are

#

A SteamID is broken up into four components: a 32 bit account number, a 20 bit “instance” identifier, a 4 bit account type and an 8 bit “universe” identifier.

#

this is the Steam ID 64 (bit)

#

the account ID itself is sequential

#

starting with ID 1 with the first ever created Steam account

vivid fulcrum
#

interesting

lyric mountain
#

Gaben ig?

vivid fulcrum
#

something akin to snowflakes but proprietary it seems

boreal iron
#

which is 76561197960265729

boreal iron
#

account ID 1

lyric mountain
#

Who tf tested steam before gaben?

boreal iron
#

the first created Steam accounts are all Valve employees

#

created far before the platform even got released

#

took some time to investigate all this but it's quite interesting

#

need to restart Proxmox in a few minutes, too

#

I will take a look at the smart values of the SSDs

#

about their TBR and TBW

wooden ember
#

bruh

#

i remember using proxmox to test something

#

pretty cool

#

just not good for my application

#

bought a cheep cache drive offa ebay

#

to use as a boot drive

#

but sadly its not bootable so i thought "just slap a vm on it and rung the hipervisor on another drive"

#

worked but was too clunky for my liking

boreal iron
#

proxmox really is a damn nice environment for virtualization

wooden ember
#

yeah

#

has almost vertually no processing overhead too

#

which is nice

#

was running on a dell from 2006 and didnt really notice it on the vm at all

boreal iron
#

yeah it's minimalistic but feature rich, always up to date and free

wooden ember
#

indeed

boreal iron
#

and literally needs only a few ressources to manage all containers/VMs

wooden ember
#

yeah i saw that on my dell

#

has a 2.2ghz athlon 4200+

#

not the fastest thing

#

but was still mostly idle

#

pretty good

#

also

#

whilst im here

boreal iron
#

well my hardware isn't the latest shit, too but much optimized for virtualization

#

Intel Xeon you know

wooden ember
#

in nodejs whats the diference between === and == cuz each seems to have diferent properties

#

oof Xenon

#

i mean some are still pretty good

boreal iron
#

"still" lol

wooden ember
#

lol

boreal iron
#

nr 1 architecture

wooden ember
#

i mean i cant remember the name but theres a couple of 3ghz ones and they are pretty good hovering around i7 4th gen

boreal iron
#

xeon gold, platinum or exterprise support is what makes them the nr. 1 professional architecture

wheat mesa
wooden ember
#

nice

#

what does coercion mean

#

lol

boreal iron
#

but for the private sequemt AMD EPYC currently is more interesting

#

as the amount of cores for virtualization matters here

#

not so for professional hosting

wooden ember
#

im guessing its like if the "thing" is literally what you are comparing it to like if e == true cuz its true and not a string or any other data type

wooden ember
boreal iron
#

since a string and integer are different types

wooden ember
#

i know thier uses but i just wanted to know why there was two diferent "=" things

boreal iron
#

Intel will always be the best supported and most reliable choice

#

that wont change soon

wooden ember
#

bruh amd is cool though but yeah intel is pretty rock solid

wheat mesa
boreal iron
#

"cool"? it's just cheap focusing gamers and virtualization but not much more tbh

wheat mesa
#

AMD is a very good consumer CPU manufacturer

wooden ember
#

amd is more power efficient atm though so thats why im here, that and the fact they are pretty good to their consumers using the same socket for longer and keeping older equipment suported for longer

wheat mesa
#

Intel falls behind in affordability to power ratio sometimes, but their high end CPUs almost always outperform AMDs high end CPUs

boreal iron
#

tbh, nobody give a fuck about power efficiency

wooden ember
#

like my 8 year old gpu just got a driver update lol

wooden ember
#

but i do

wheat mesa
#

Oh you were talking to him

#

Nvm

wooden ember
#

lol

quartz kindle
boreal iron
#

ALWAYS KEEP IN MIND when comparing Intel and AMD CPUs, Intel still doesn't produce chips on like 5 or 4nm like AMD and they still outperform AMD chips easily

wooden ember
#

bruh power draw is power draw

quartz kindle
#

also, low power = low heat = less cooling = more longevity

wooden ember
#

^^^

boreal iron
wooden ember
#

i use to have an fx8350

wheat mesa
wooden ember
#

those where dark and extreamly hot times

wheat mesa
#

Until you get to the really high levels of CPU like Epyc

boreal iron
quartz kindle
#

but for a laptop for example, amd cpu + vega grahpics = 9+ hours of battery easy

boreal iron
#

as nobody actually needs more than 4 or let's say 8 cores as consumer

#

but AMD comes with CPUs providing 16 cores or more for consumers which is nonsense

wooden ember
#

unless you have like 39487 chrome tabs open

#

i mean if you are doing many things at once then cores come in handy

boreal iron
#

I will still stick to my 9900ks and oc it up to 5.5GHz and will beat literally any AMD CPU with it

wooden ember
#

oh god

#

the heat

wheat mesa
#

I run a Ryzen 7 2700 that’s overclocked to 4ghz on all 8 cores, it’s been running fantastic for tens of thousands of hours over the last 3 years

wooden ember
#

lol

wheat mesa
#

And it always stays under 60c

#

(I have an AIO cooler for it)

quartz kindle
#

a lot of people are not used to fully close programs when they stop using them, for example mac users never ever actually close programs, they just click the X button and dont know the program is still open in the taskbar lol, so for those people more cores will make a perceivable difference

boreal iron
#

I can tell you that

wooden ember
#

my ryzen 5 5600x has the stock cooler and has never gone over 70*C

wheat mesa
#

I’m also not running games at 4k expecting 2 billion fps

wooden ember
#

bruh i have an hd7770 lol

boreal iron
wheat mesa
#

I run all my games at 1080p usually at or above 144fps depending on the game’s limits on framerate

quartz kindle
#

yes but many windows users are the same, they are not used to the concept of closing programs to free resources

boreal iron
#

well my bottleneck is the 1080Ti atm

wheat mesa
#

Granted I also have an RTX 2070 so it’s pretty easy to chug through games

quartz kindle
#

they dont even know the difference between closed and minimized

boreal iron
wooden ember
#

that and windows has a bunch of background crap built in anyway

boreal iron
#

same goes for their smartphone once the accidentally open their app switch

quartz kindle
#

yeah

wooden ember
#

would rather all that crap be running in cores that im not ising for the game im playing

#

cuz frame stutters piss me off alot

quartz kindle
#

get a random stranger's phone in your hands and enter the running app list, its not uncommon to see 50+ running apps

boreal iron
#

being running google maps 24/7 in the background and wonder why their location is being tracked 24/7 literally killing the battery

wooden ember
#

people having a smart phone wondering why there location is being tracked 24/7

quartz kindle
#

then they blame google for tracking them

#

:^)

boreal iron
#

well tbh

#

they're not wrong with it

#

Android makes it impossible to disable all trackers

wooden ember
#

power switch

#

ez

#

lol

boreal iron
#

while at least this isn't the case in iOS

quartz kindle
#

yeah but you can still disable location history in your google account for example

boreal iron
#

but still can not disable system services tracking your stuff

wooden ember
#

i mean we dont know that ios could still be tracking you they just aren't transparent about it

quartz kindle
#

and there are more and more privacy-friendly phones with location spoofing built in

boreal iron
#

I had an Android for one year and it was a mess

#

disabled those system services comes up with a message, many apps will not work anymore

#

and guess

#

the message was right

wooden ember
#

ive only ever had shitty androids and hoinistly its fine

#

but then id be ok running a nokia brick

#

cuz i use my phone as a phone and not a do-everything machine

quartz kindle
#

same

boreal iron
#

not to mention that any OS sends meta data around but iOS compared to Android is much more friendly in terms of what I can disable and what not

wooden ember
#

true but then how easy is it to do things apple doent aprove of

#

like install apps from somthing other than the app store

#

or actually have a file viewer

#

or a bloody headphone jack

boreal iron
#

I fucking like their environment is closed

#

prevents you from being fucked at any time like on an Android phone

wooden ember
#

i mean i would like the option to think for my self

#

not just be parented

boreal iron
earnest phoenix
#

It should be your responsibility on what you're installing and shit, not the OS's

boreal iron
#

bullshit

#

you're free to install whatever you like

wooden ember
boreal iron
#

but nothing which isn't known to be dangerous for the environment

wooden ember
earnest phoenix
#

The OS isn't supposed to decide what you should install, iOS on the other hand just hand-holds you and doesn't allow installation of untested applications

wooden ember
#

indeed

boreal iron
#

which is totally okay - called responsibility

#

a common phone user don't install weird, untested apps from unknown sources

wooden ember
#

i bought a device its my responsibility not the manufacturers

sick agate
#

nope

earnest phoenix
#

That responsibility is yours, not OS's

wooden ember
#

^^^

sick agate
#

yup

wooden ember
#

when i buy something i expect to be at liberty to do what i damn please on it or with it

sick agate
boreal iron
sudden geyser
#

"why is the app store the only place where I can install stuff"
apple: "to make your device secure, private, and consistent"
anyone who can read through corporate dogma:

wooden ember
#

lol

boreal iron
#

remember we're still speaking about the common user not what you personally expect to see

boreal iron
#

nah not all

rustic nova
wooden ember
sudden geyser
#

oh yeah that new feature is dumb af

boreal iron
#

count the cases of compromised apps or phones compared between Android and iOS

sick agate
#

💀💀

wooden ember
#

yup

earnest phoenix
boreal iron
#

YOU'RE ALWAYS limited

sick agate
#

are you really sure

earnest phoenix
#

That's an invalid argument

boreal iron
#

Not so if you root your iPhone or Android phone

#

Still that's no valid argument

sick agate
#

still android provides more

boreal iron
#

The common user installes the few apps he uses from a known source, the app store

#

and he's not really doing anything beyond that

sick agate
#

well yeah?

sudden geyser
#

Apple doesn't even run its App Store well nor treat its developers well.

sick agate
#

yup

earnest phoenix
#

And you don't "root" an iPhone, you jailbreak it which becomes way harder every update

wooden ember
# earnest phoenix It doesn't matter what type of user it is, you're not supposed to be limited to ...

yeah reminds me of a meme i saw about cars

"user manuals in cars used to tell you how to ajust the valve timings, now they just tell you not to drink the contended of the battery"

personally i hate this form of babyproofing everything has thesedays what if the ragular user wants to do somthing for them selves but the manufacturure blocks it so the may to be fucked over by a dealer charging exorbitant prices

boreal iron
sick agate
#

bruh

sudden geyser
#

Yikes.

wooden ember
#

bruh

boreal iron
#

that's how the world is

sudden geyser
#

No, that's how capitalism works.

wooden ember
#

you do realise you can choose to buy stuff made localy

boreal iron
#

that's how the world is

sudden geyser
#

The world is not fully capitalist, nor is that really relevant. You're really just spreading corporate propaganda right here and trying to assert it as "just the facts".

boreal iron
#

I didn't start drifting to that discussion

wooden ember
boreal iron
#

I don't care what they charge from their app developers, either you care or not, either you can afford or not, that's how it is

#

not even sure if free apps being charged

#

but that's not the point

sick agate
#

and you know the cost affects you

#

Mindustry is literally free in every platform except steam and app store

#

so it can affect you

boreal iron
#

wtf is Mindustry

sick agate
#

a game

boreal iron
#

ah oh lol

wooden ember
#

that and if devs get more money they have more insentive to make somthing thats not a shitty ad driven mobile game

#

but then those will be a plague nomatter what

boreal iron
#

still no valid point for me, there're more than enough free apps on iOS, too and I don't have an issue paying for something I wanna use, also supporting the developer even if they only get a small percentage of it

earnest phoenix
#

I honestly wouldn't want to see a world where the OS's actually decide everything for it's users, hand-holding the users a lot is just generally a bad idea because the user learns nothing of how things really work, and intend to get stuck on the most simple problems, let's say an app had a malware that is on the app store, the Apple users aren't gonna give a shit because they think it's "safe" and wouldn't contain anything suspicious

boreal iron
#

I remember there have been a few

wooden ember
#

interesting

#

anyway ima get food

#

this argumant will probably still be going when i get back

sick agate
#

probably unless someone goes to sleep

earnest phoenix
boreal iron
earnest phoenix
#

But a lot of Android users are aware of them, so that's a good take away as well

boreal iron
#

doesn't mean I don't prefer local stores

sudden geyser
#

I don't necessarily believe targeting a certain audience with certain features is a bad thing. My personal issue is that Apple products are used by a very wide audience with different preferences, yet Apple will not budge for those people as it's more profitable for them to be inflexible (i.e. pursue platform capitalism).

Also, buying locally is usually pointless since it may rely on services that are global.

boreal iron
earnest phoenix
sudden geyser
#

Apple users aren't one person, and Android users certainly haven't been "trained".

sick agate
#

XcodeGhost (and variant XcodeGhost S) are modified versions of Apple's Xcode development environment that are considered malware. The software first gained widespread attention in September 2015, when a number of apps originating from China harbored the malicious code. It was thought to be the "first large-scale attack on Apple's App Store", acc...

boreal iron
#

dude that's how you see things, no fucking phone user is "going through" things
they use their phone, their install and use the same 3 apps every day, make a call or two and that's it

#

nobody is actually thinking about how it works or getting into it at all

#

I never meet anyone

earnest phoenix
#

That's also how you see it on your perspective, a lot of the users install a ton of things from what I've seen, and by experience can avoid malicious apps and things that can harm the device, it's not just using a few apps or making a call or 2

boreal iron
#

I only being asked over and over again why this blobbing up on Android phones, why this is sending notifications to me, why this isn't working, why the battery is running down so quickly etc.

earnest phoenix
#

That's the old times you're thinking of, it's not how it is today

sick agate
#

i have only saw a person using ios have battery issues

#

the battery is small

boreal iron
earnest phoenix
sudden geyser
boreal iron
#

but people actually charging their phone 24/7 and ruining their battery

boreal iron
boreal iron
sudden geyser
#

Of course, because every relevant top tech company has a monopoly in that field.

earnest phoenix
# boreal iron Still... users go the app store or play store, search for an app and install it ...

I think you're completely misunderstanding things, a lot of people do that on Android phones when the app stores provided doesn't provide what they want, the iOS users just go to the app store and install things that are only tested, the iOS users aren't aware of most ways to avoid malicious things while Android users does, since they can install untested apps that contain malicious things

#

Most apps available on the app store of iOS doesn't contain malicious things, so generally the users will always install it without caring about such details, even though it may contain malicious things regardless of being available there

boreal iron
#

still don't know anyone being careful of things like that using Android phones

earnest phoenix
#

Oh you wouldn't believe, a ton of people do, a shit ton infact