#development

1 messages · Page 2076 of 1

eternal osprey
#

Uncaught DiscordAPIError DiscordAPIError: Invalid Form Body
communication_disabled_until: Invalid communication disabled timestamp

boreal iron
#

I guess the number is too large

eternal osprey
# quartz kindle can you show the full error?
Uncaught DiscordAPIError DiscordAPIError: Invalid Form Body
communication_disabled_until: Invalid communication disabled timestamp
    at DiscordAPIError (d:\Games\wallet saver - Copy\node_modules\discord.js\src\rest\DiscordAPIError.js:9:5)
    at execute (d:\Games\wallet saver - Copy\node_modules\discord.js\src\rest\RequestHandler.js:350:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)```
boreal iron
#

Also it’s NOT 4 weeks

eternal osprey
#

I am using exactly the maximum

sharp geyser
#

That is 4 weeks fake

#

If you're representing it in milliseconds

eternal osprey
#

Did the api block me or anything lol

boreal iron
#

ya ms didn’t ready carefully

#

not s

sharp geyser
#

Lol

earnest phoenix
eternal osprey
boreal iron
quartz kindle
#

i wonder why discord uses iso8601 timestamps

#

instead of numbers

eternal osprey
quartz kindle
#

i dont know

#

did you try with a smaller number?

#

like 1 day?

eternal osprey
#

I am trying it again

#

one sec

#

huh 1 week worked

spark flint
#

very odd

#

using djs webhook thingy and following their docs

eternal osprey
#

maybe i should set the time to a few ms below 4 weeks?

boreal iron
#

Well like my first guess, the value was too large

earnest phoenix
quartz kindle
#

^^^

spark flint
earnest phoenix
#

Show your code perhaps?

quartz kindle
#

you did something wrong then

#

^

spark flint
#
const webhookClient = new WebhookClient({ url: 'https://discord.com/api/webhooks/id/token' });
webhookClient.send({ content:`API started` })
eternal osprey
spark flint
#

thats all I'm doing

eternal osprey
#

why is it saying that my value is too large?

boreal iron
#

I mean try 27 days?

#

If that works

#

Back to the day only has 23 hours @quartz kindle

eternal osprey
#

27.9988 days works as well

#

2419100000

#

They are scamming people in their docs

boreal iron
#

Does it say SMALLER THAN 28 or 28 days max

quartz kindle
earnest phoenix
spark flint
#

ok fixed it, for some reason it went to djs 12.5.3 even tho it deffo shouldn't

sharp geyser
#

Using an old ass version of djs damn

boreal iron
#

Hmm maybe the clock of discords backend is a little bit behind

quartz kindle
#

discord wants an actual timestamp
djs takes your timeout and does Date.now() + timeout, then sends the resulting timestamp
so it uses your pc's current date + 28 days
if your pc's current date is 1 second out of sync with discord server's current date, then it could make it send a timestamp that when received by discord it becomes 28 days + 1 second, which is invalid

#

its very common for computers to be several seconds out of sync with each other

sharp geyser
#

Stupid issue but common

ancient nova
sharp geyser
#

Is that a prefix command I see

boreal iron
ancient nova
#

the !member if statements activates meaning somehow it's not getting the member?

sharp geyser
#

Shame 🔔

ancient nova
#

😠

quartz kindle
#

have fun having a dead bot in 2 months

sharp geyser
boreal iron
#

Thinks it’s 1s per year

#

Or more

quartz kindle
#

tidal acceleration

ancient nova
#

anyway what's wrong?

boreal iron
sharp geyser
#

By the time it matters I'll be dead

#

So idc

boreal iron
#

if you know the English word for

ancient nova
#

guys

#

what's wrooong?

quartz kindle
ancient nova
#
``` this doesn't seem to work??? why?
sharp geyser
#

Ain't no way it's 1s per year

earnest phoenix
boreal iron
#

Yes 1s per year

#

iirc

sharp geyser
#

False

quartz kindle
#

astronomy software has to keep updating itself for "leap seconds"

sharp geyser
#

Tim pull the documentation out

quartz kindle
#

every few years there is a second added or removed from utc

boreal iron
# sharp geyser False

This is already happening for a few years now becoming an issue in a few years likely

ancient nova
sharp geyser
#

Again as long as I can do what I love idc

earnest phoenix
boreal iron
#

Which has to be absolutely in sync

sharp geyser
#

Why do you need it for gps

quartz kindle
sharp geyser
#

Just use maps

boreal iron
#

Wtf

sharp geyser
#

Going back to the dark ages sounds fun

#

No law and order mmmm

boreal iron
#

Aka zomby apocalypse?

#

Yikes

quartz kindle
#

yes pls

sharp geyser
#

Either works

quartz kindle
#

i want a zombie apocalypse

sharp geyser
#

No law to tell em what I can and can't do

boreal iron
quartz kindle
#

much better than nuclear apocalypse

#

at least you can fight the zombies

boreal iron
#

True

quartz kindle
#

you cant fight nukes

#

or radiation

sharp geyser
#

Now I don't have to feel guilty when I steal the hygiene products in a hotel room

boreal iron
#

lol

#

Calling 911

quartz kindle
#

921

sharp geyser
#

Nooo

sharp geyser
#

Not 921

#

😔

boreal iron
#

SHUT UP

#

Damn auto correct

#

I hate it

sharp geyser
#

Lmao

boreal iron
#

Will soon nuke the headquarters it gets developed

earnest phoenix
#

No way 921, must be higher priority

sharp geyser
#

It is

#

It's for those who steal from hotels

#

And only for that one purpose

quartz kindle
#

hotel jail

boreal iron
#

He’s save in jail

sharp geyser
#

Also why is the number for the police so short

boreal iron
#

Zombies won’t get into his cell

earnest phoenix
#

Yeah they're save in there

sharp geyser
#

I feel it should be the same as normal numbers

#

Gotta keep it fair

quartz kindle
#

ah yes, need the police? call 0800 738 348 358

sharp geyser
#

Why not

#

Seems fair

boreal iron
#

Misty on his way to the TOP 10 most stupid ideas ever

sharp geyser
#

Nah it's a good idea

ancient nova
sharp geyser
#

During the dialing process they can really think whether they need them or not

ancient nova
#

and easy to dial in case ur running away from a murderer lmfao

boreal iron
sharp geyser
#

What you don't wanna dial 878 897 8987

earnest phoenix
#

Me looking up the police number I forgot about with a slow internet connection as a murderer chases me

earnest phoenix
#

Oh you forgot and don't have internet? Too bad

sharp geyser
#

Should of paid off your data plan

boreal iron
sharp geyser
#

Poor planning if you ask me

ancient nova
boreal iron
#

Exactly

#

In order to not feel discriminated

sharp geyser
#

Okay but have you ever thought about turning the tables and chasing the murderer

earnest phoenix
boreal iron
#

Voltrex again… and his terroristic activities

sharp geyser
#

He/she is already about to kill you

#

So just chase them instead

earnest phoenix
sharp geyser
#

It might work

ancient nova
sharp geyser
#

8675309

earnest phoenix
sharp geyser
#

Area code depends on your area

sick agate
#

112 moment

sharp geyser
#

If no one gets the reference I just made I'ma be sad

sick agate
#

what's the emergency number in iran May i ask

sharp geyser
#

Just scream you need help

boreal iron
#

Probably 827263781

earnest phoenix
boreal iron
sharp geyser
#

Fake didn't get my reference

#

I'm sad

boreal iron
#

Can’t follow any message on mobile

#

Doing stuff meanwhile

sharp geyser
boreal iron
#

You know, like real life activities

sick agate
sharp geyser
#

You have no life don't lie

#

Every time we talk to you you're always driving

boreal iron
#

Not atm

earnest phoenix
#

Proof?

sharp geyser
#

Right cause you're parked

earnest phoenix
#

FakE's car is his house

sharp geyser
#

Yes send proof specifically your vin

boreal iron
#

Does that look like I’m on the street?

sharp geyser
#

Looks like you're fucking Jesus

#

But what do I know

boreal iron
#

@.@

sharp geyser
#

Only looks like you're 50 feet in the air

earnest phoenix
sharp geyser
#

You heard me

#

I didn't stutter

#

If there's a hole there's a goal my child

boreal iron
#

lmao

#

But complaining about me being called hot

earnest phoenix
boreal iron
#

lol nvm the pic is quite a few days old

sharp geyser
#

John Cena is driving your car

#

Your car is John Cena

ancient nova
#

important question: salt vs pepper?

boreal iron
#

Tf is wrong with you

#

Take your drugs

sharp geyser
#

I don't take drugs

#

I take sleep deprivation

boreal iron
#

Then TAKE SOMR

#

my gosh

sharp geyser
#

It's only 8am no sleep

#

Calm down

boreal iron
#

8am wtf

#

You’re living in the past Sir

sharp geyser
#

No

#

You're just too fast

boreal iron
#

May I tell you the lottery numbers since im living in the future

sharp geyser
#

Sure

boreal iron
#

Damn my eyes read fat instead of fast

#

Dunno why

sharp geyser
#

Either works /s

boreal iron
raw nest
#

About git:
I have pushed some changed etc. to a branch (master) in a repo. Now it says compare & create pull request. If I click on it, it says "There isn’t anything to compare. main and master are entirely different commit histories.". What to do?
It's a repo of my org if this matters. Do I have to fork it first, create a branch and after push then create a pull request?? ThinkO_O

compact frost
#

Can I have Credits please

boreal iron
near stratus
sudden geyser
fossil bronze
pine nova
#

is it better to connect to database before starting node server or discord client or after?

fossil bronze
#

I don't think it matters too much, unless you need to get some data from there, I do it after.

raw nest
boreal iron
#

Not only to connect it before also make sure the connection works

pine nova
#

i see

#

thank u

ancient nova
#

any idea why this doesn't work?

#

no errors btw, it just doesn't log anything

lyric mountain
#

could u...say what doesn't work?

ancient nova
#

it doesn't log

#

anything

lyric mountain
#

ok, so it should be logging?

ancient nova
#

yes

lyric mountain
#

what is it supposed to log?

ancient nova
#

well I tried changing the guilds name as an example but it didn't work

lyric mountain
#

do u have the partial enabled?

#

did u try adding console.log("something") to the first line of the event to see if it's being called at all?

ancient nova
#

I haven't, but I'll do it right now

lyric mountain
#

always do that when trying to debug events

ancient nova
#

yea it's logging

lyric mountain
#

don't u need to await this?

ancient nova
lyric mountain
#

console.log(channelCheck) before this line

boreal iron
#

!== undefined oldEyes

lyric mountain
#

also u don't need to compare with undefined, it's falsey by default

#

if (channelCheck)

ancient nova
#

awaited still doesn't work

ancient nova
lyric mountain
#

doesn't matter, do it

#

also why are u saving the channel as a mention?

#

just save the id

ancient nova
#

but sure ig I'll try

boreal iron
ancient nova
lyric mountain
#

you do have

#

u can get mentioned channels

#

or apply the regex before saving

#

there're 0 reasons to save a mentionable as a mention

ancient nova
#

it logs the guild properly

lyric mountain
#

ur send message is inside if (!oldGuild.vanityURLCode && newGuild.vanityURLCode) scope

ancient nova
#

🤣

lyric mountain
#

it took me a while to figure out the formatting

#

please use brackets for if clauses

#

even if it's a single line

boreal iron
#

Never seen such a terrible formatting especially inside statements

#

Confusing as fuck

lyric mountain
#

I mean, it does have proper tabs, but the missing brackets just makes everything confusing

boreal iron
#

Which missing brackets?

ancient nova
#
    const settings = getSettings(invite.guild);
    
    if (invite.guild && settings.modLogChannel !== undefined) {
        const modLogChannel = settings.modLogChannel;
        const modLogChannelRegex = /^<#(\d+)>$/;

        let channelCheck, channelID;
        if (modLogChannelRegex.test(modLogChannel)) {
            channelCheck = invite.guild.channels.cache.get(modLogChannel.replace(/<#(\d+)>/, "$1"));
        } else if ((channelID = modLogChannel.match(modLogChannelRegex)) !== null) {
            channelCheck = invite.guild.channels.cache.get(channelID[1]);
        } else {
            channelCheck = invite.guild.channels.cache.find(_ch => _ch.name.toLowerCase() === modLogChannel.toLowerCase());
        }
        
        if (channelCheck !== undefined) {
            const inviteCreateLog = new MessageEmbed();
            inviteCreateLog.setTitle("Moderation Logs (Action: Invite Create)");
            inviteCreateLog.setColor(commandColor);
            inviteCreateLog.addField("Code", invite.code);
            inviteCreateLog.addField("Channel", invite.channel || "None");
            inviteCreateLog.addField("Creator", invite.inviter);
            inviteCreateLog.addField("Indefinite", toProperCase(invite.temporary));
            
            if (channelCheck.permissionsFor(invite.guild.me).has(
                [
                    Permissions.FLAGS.VIEW_CHANNEL, 
                    Permissions.FLAGS.SEND_MESSAGES, 
                    Permissions.FLAGS.EMBED_LINKS
                ]
            )) {
                return channelCheck.send({embeds: [inviteCreateLog]});
            }
        }
    }
lyric mountain
ancient nova
#

since we're talking events do you have an idea why this might not work either?

#

I'm pretty sure it's all correctly formatted this time

boreal iron
lyric mountain
ancient nova
lyric mountain
#

they don't, trust me

#

else things like that happen

#

the only, I said ONLY allowed usage of bracketless ifs is for guards```
if (something) return

// code

or ```
while (stuff) {
  if (otherStuff) break;

  // code
}
boreal iron
lyric mountain
#

for anything else, please use brackets

ancient nova
#

yeah no worries

ancient nova
#

I don't really see anything wrong with this

#

unless they lied to me and inviteCreate event doesn't exist

lyric mountain
#

log channelCheck

boreal iron
#

Did you check the docs?

ancient nova
#

I don't think they were official but ye

boreal iron
#

I mean all events are listed

ancient nova
#

I'm adding every single event that's listed there

boreal iron
#

I better don’t ask

ancient nova
#

yeah I just checked it's a real thing

ancient nova
lyric mountain
#

for that I'd suggest making a generic log generator

#

that can accept any event and return a pre-made embed or something

#

single-responsability rule

ancient nova
#

fuckkkkk my docker is stuck wtf

#

I can't start my bot up

ancient nova
#

and it would probaby be messier

lyric mountain
#

having one big, streamlined code is better than having 50 repeated and 99% identical code

boreal iron
#

I mean It literally needs to log all args that’s all

#

Which the event handler could already handle, like include it

lyric mountain
#

since js allows transforming everything into json, simply do an intersection of both old and new

#

identical properties get removed, only different ones remain

#

then log that

ancient nova
#

lol I literally can't start my bot up anymore wut happened

lyric mountain
#

Object.entries(new).filter((k, v) => v !== old[k])

lyric mountain
#

maybe u hit the identify limit

ancient nova
lyric mountain
#

u can only login so many times in a set timeframe

boreal iron
#

Do you suppress all errors?
I mean awaiting all promises as well as having an error handler literally tells you anything

ancient nova
#

it's not my bots fault I think

lyric mountain
#

check the logs for a reason

ancient nova
#

I know I'm literally camping there I'm not stupid

#

if any error showed there I would've sent it here

lyric mountain
#

not the bot logs, docker logs

ancient nova
#

I don't have access to the docker

#

I just know if it's stuck or not

lyric mountain
#

is it a shared vps?

ancient nova
lyric mountain
#

maybe the other people hit cloudflare limit?

boreal iron
ancient nova
#

it's possible but I have no idea of knowing lol

lyric mountain
#

well, you'd need the logs

#

if they did hit cloudflare ratelimit, then rip until tomorrow

ancient nova
#

bruh just when I was editing the bot they did me dirty

#

😭

boreal iron
#

Just try to start the rocker container without starting the bot

#

Wow

ancient nova
#

might as well add all the events I wanted to add and check if they're working later

lyric mountain
#

rocker

boreal iron
#

Ik

#

Fuck auto correct

#

For real

ancient nova
#

can I ping u guys if my bot goes active again?

lyric mountain
#

well, you could try debugging it urself first

#

there are a ton of tools for that

#

but my best tip is try to make a handle-it-all solution instead of writing the same thing for all events

boreal iron
#

What sort of environment you’re playing around with which has no access to logs?

lyric mountain
#

trust me, you DON'T want to have 50 copies of the same code spread along your codebase

boreal iron
#

Actually why not

#

Editing code with search all and replace can’t be faster

lyric mountain
lyric mountain
#

I don't plan to thanks, willing to keep my sanity

round cove
ancient nova
#

I think that's fair

boreal iron
#

Rip

lyric mountain
#

lmao

round cove
#

did speedy get banned lmao

boreal iron
#

Yeah KEKW

round cove
#

for what OMEGALUL

boreal iron
#

He somehow managed to

#

Idk

#

@wheat mesa knows iirc

round cove
#

damn

lyric mountain
#

I mean, speedy is the master of disguises, he could be me, he could be you, he could even be...dylan!

boreal iron
#

He couldn’t be me

#

Only I like PHP

#

FUCKING AUTO CORRECT

lyric mountain
#

ah yeah, I forgor

boreal iron
#

what the heck is pho

lyric mountain
#

food

round cove
#

pho is viet noodles

lyric mountain
boreal iron
#

I doubt my phone knows that

pine nova
#

😳

ancient nova
#

if I have roleUpdate event how exactly do I detect which permission is changed if I only can get the bitfield of the permission?

lyric mountain
#

err....using the bitfield

boreal iron
#

By resolving it to its flags if you need to

ancient nova
#

how tho?

lyric mountain
#

bitfield is just a boolean array compressed into an integer

boreal iron
#

Lemme open the docs only I can open it seems like

lyric mountain
#

every perm is stored as a bitflag

wheat mesa
lyric mountain
#

like 1 is the first perm, 10 is the second, 100 is the third, and so on

wheat mesa
#

and got a 1 month mute for it

round cove
wheat mesa
#

then ban evaded and got perma banned

ancient nova
#

VPS booted up, but it doesn't wanna auto boot

#

it's just stuck at "node index.js" and doesn't respond at all

wheat mesa
lyric mountain
#

just a question, is the vps a free service?

boreal iron
ancient nova
boreal iron
#

soon to be banned

lyric mountain
boreal iron
#

The docs say what it returns

lyric mountain
#

read this, good knowledge to have

boreal iron
#

Returns: Array <string >

cinder patio
wheat mesa
#

the bro

#

the one you said was his alt

cinder patio
#

I knew it

ancient nova
#
<role>.permissions.toArray()[bitfield]
```?
ancient nova
lyric mountain
#

[bitfield] will literally try to grab negative indexes depending on the perm

#

bitfield is a boolean array compressed into an integer, think about it like arrays not like values

boreal iron
#

You can then log them or use the flags to check if they are included

#

Which would be nonsense since the permissions resolver already comes with any() and grt() methods but still

ancient nova
#

I think something like this is fine

                const oldPerms = oldRole.serialize(),
                      newPerms = newRole.serialize(),
                      permUpdated = [];
                
                for (const [key, element] of Object.entries(oldPerms)) 
                    if (newPerms[key] !== element) permUpdated.push(key);
                
                roleUpdateLog.addField(
                    `Permissions ${oldRole.permissions > newRole.permissions ? "Lost" : "Gained"}`,
                    permUpdated.join(", ");
                );
boreal iron
#

It’s possible

lyric mountain
#

brackets

boreal iron
#

Sheesh

ancient nova
boreal iron
#

That’s totally okay

#

He’s talking about your push line

ancient nova
#

oh

lyric mountain
#

btw, u could remove that for loop and simply use filter

ancient nova
boreal iron
#

Totally okay if it doesn’t cause a syntax related issue

ancient nova
#

something like this?

lyric mountain
#

don't u need Object.entries() there?

ancient nova
#

I don't think it's needed

#

noooooo after waiting like 10 minutes

#

😭

lyric mountain
#

👌

boreal iron
#

I wonder if it actually would be faster to turn both bitfields into arrays and eliminating all identical items

#

To show which perms you got or lost

lyric mountain
#

just do bitwise nand

boreal iron
#

Tim benchmark when?!

ancient nova
#

btw is there any events I missed?

#

I think I got all of them

boreal iron
lyric mountain
#

oh wait, not nand, xor actually

ancient nova
#

/home/container/events/roleUpdate.js:62
permUpdated.join(", ");
^
SyntaxError: missing ) after argument list

boreal iron
#

Turning into an array of flags before or later doesn’t make a big difference

ancient nova
#

that's impossible

boreal iron
#

Since we’re talking only about a few items

#

Not like millions

lyric mountain
#

instead of twice

ancient nova
#
            if (oldRole.permissions.bitfield != newRole.permissions.bitfield) {
                // Log the bitfield change.
                roleUpdateLog.addField("Bitfield Changed", `${oldRole.permissions.bitfield} -> ${newRole.permissions.bitfield}`);
                
                // Create some variables.
                const oldPerms = oldRole.serialize(),
                      newPerms = newRole.serialize(),
                      permUpdated = [];
                
                // Filter out permissions.
                for (const [key, element] of Object.entries(oldPerms)) 
                    if (newPerms[key] !== element) permUpdated.push(key);
                
                // Update the embed.
                roleUpdateLog.addField(
                    `Permissions ${oldRole.permissions > newRole.permissions ? "Lost" : "Gained"}`,
                    permUpdated.join(", ");
                );
            }
#

is this not valid?

lyric mountain
#

it isn't

ancient nova
#

oh I just noticed why

#

I need a better syntax check

cinder patio
#

huh

#

are you writing code on notepad

boreal iron
#

I hope you mean the windows original one

ancient nova
#

what the fuck

ancient nova
cinder patio
#

why

boreal iron
#

Thought you wanna log the flags he lost or got not the IDs

ancient nova
#

gonna paste the entire code to pastebin one sec

boreal iron
#

Dude for real

ancient nova
boreal iron
#

At least use source bin

ancient nova
boreal iron
#

Or hastebin

ancient nova
#

why the paste bin hate?

boreal iron
#

Because it’s ugly, especially on mobile and bloated with pop ups

#

As bad as discord embeds

lyric mountain
boreal iron
#

Actually most concerning fact is that is locks the code width to your screen size like discord

#

Not showing the full width letting you scroll through

ancient nova
#

oh ic

boreal iron
#

Which is like I said the same as the discord embeds

ancient nova
#

hastebin is my second fav so I'll switch to that

#

it looks normal to me cuz I'm on PC and I got like 3 adblockers on

lyric mountain
#

hatebin (no "s") >>>

ancient nova
#

so I don't see any bloat

boreal iron
#

So it won’t pop up anymore

ancient nova
#

I'm not that stupid believe me lol

#

nothing pops up because the adblock I use is connected directly to my routers tunneling

#

everything works besides the permissions gained

#

quite annoying

lyric mountain
#

hmmm...that color is wrong

ancient nova
lyric mountain
#

no, it's decimal

#

u converted to the wrong format

ancient nova
#

rgbo

#

red green blue opacity

lyric mountain
#

discord doesn't allow alpha

ancient nova
#

o

lyric mountain
#

and even then, the digit count doesn't match

ancient nova
#

I'm just doing <role>.color so idk

lyric mountain
#

ur getting the rgb bitfield

#

u need to convert to hex

ancient nova
#

how to?

boreal iron
#

Just use the color resolver of djs

ancient nova
#

hold on before we do that can we fix the permissions gained field?

ancient nova
lyric mountain
boreal iron
lyric mountain
#

old ^ new

ancient nova
#

^ is a thing in JS?

lyric mountain
#

it'll get u the difference between both

lyric mountain
ancient nova
#

hold on can u use that in a snippet?

#

I've either forgotten or never heard of that before

#

need to remind myself

lyric mountain
#

that...that was a snippet already

ancient nova
#

an actual functional one?

#

:>

lyric mountain
#

ye, it'll get u the difference between 2 bitfields

boreal iron
#

the fuck?

lyric mountain
#
XOR

0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0
ancient nova
#

I don't get how to use that

#

hold on

lyric mountain
#

arithmetic operators = + - / *
comparison operators = || && !
bitwise operators = | & ~ ^

boreal iron
#

didn't you want to upload the code to hastebin?

ancient nova
boreal iron
#

This page is no longer available.

ancient nova
lyric mountain
#

for example```js
let oldVal = 0b01100
let newVal = 0b01010

result = oldVal ^ newVal
// result = 0b00110

ancient nova
#

no idea why it auto detected this as typescript tho

lyric mountain
#

0b is to declare binary values

ancient nova
ancient nova
lyric mountain
#

I could simply have written ```js
let oldVal = 12
let newVal = 10

but u don't simply use decimal when doing bitflags
boreal iron
#

these random new lines on method arguments or sometimes literally when passing a template string is killing me

#

I thought you're going to log the permissions some role got or lost

#

but it seems you only wanna log the bitfield

#

so we started the entire conversion wrong

lyric mountain
#

I don't think logging the bitfield is to any use for server admins

boreal iron
#

yeah, that's what I mean

lyric mountain
#

me too, after u XOR the bitfields just convert to permission array

boreal iron
#

I mean dunno why you would log this at all, but still logging a bitfield is like nonsense

ancient nova
#

I'm so confused lol

lyric mountain
#

the issue is that ur looking at those stuff at the wrong angle

#

u need to understand what each thing represents

#

like that color log, u can't simply show it as decimal, it's not a decimal value

boreal iron
#

then turning it into an array

#

i mean the methods are already there

lyric mountain
#

because it's not an add or remove, it's an intersection

ancient nova
#

are we still talking about the permissions or the color? cause I feel like the permissions not listing is a bigger issue

boreal iron
lyric mountain
#

I believe u would want the difference, not simply what was added

boreal iron
#

and i thought he wants what's left

ancient nova
boreal iron
#

Do you want something like

role changed

permissions lost:
administrator,
manage guild

role changed

new permissions:
administrator,
manage guild
ancient nova
#

yeah

boreal iron
#

so finally

#

then comparing the bitfields and using add() or remove() for the new bitfield then toArray() then join("\n") to list the flags is probably the easiest solution

lyric mountain
#

add will simply merge both

#

remove will only show the added

boreal iron
#

oh good point

lyric mountain
#

that's what I'm talking about

#

unless u do xor, u cant get what was removed

boreal iron
#

then even easier just work with the arrays of flags

#

since you need them to return them anyways

ancient nova
#

I want to cry

lyric mountain
#

xor both values, then turn into an array of permissions

#

then use that array to compare with old to get what was added, and with new to get what was removed

#

or do that but before converting to array

ancient nova
#

any way I can update an event without having to restart the bot?

#

I feel like that should be possible but I honestly I have no idea how

boreal iron
#

I will tell you what

lyric mountain
#
let oldVal = ...;
let newVal = ...;

let difference = oldVal ^ newVal;
let removed = oldVal & difference;
let added = oldVal & ~difference;

...convert removed and added to permission array
#

I might need to test to see whether difference needs to be inverted or not

sudden geyser
#

Are you playing around with Discord permissions?

lyric mountain
#

yes, to see what perms were added and removed

sudden geyser
#

Ah

#

That makes sense.

ancient nova
sudden geyser
#

Are you using a particular library?

ancient nova
#

discord.js

sudden geyser
#

Check out the PermissionsBitField class.

ancient nova
sudden geyser
wheat mesa
#

I feel like you never actually look at the docs, you just say you can never find them

#

You said the same thing like the last 4 times

raw nest
#

Could and should I use Prisma in an NPM package I'm building? It's not about creating a DB (if the user doesn't specify in configs) just to connect and execute the users commands.

sudden geyser
#

Discord.js's search bar sucks

wheat mesa
#

I've never had a problem with it

#

But even if it does, it really doesn't take long to find it

lyric mountain
#

also could just google discordjs <class here>

wheat mesa
#

Especially when you have the name of the class

ancient nova
#

the website never pops up and I keep forgetting the URL

sudden geyser
#

you have to use the website docs

boreal iron
#
const flags_old = oldRole.permissions.toArray();
const flags_new = newRole.permissions.toArray();

const difference = (oldRole.permissions > newRole.permissions) ? flags_old.filter((flag) => !flags_new.includes(flag)) : flags_new.filter((flag) => !flags_old.includes(flag));

console.log(difference);
lyric mountain
#

hm, true

sudden geyser
#

likely because they use the old twitter-style #

boreal iron
#

now hate me

lyric mountain
#

how tf doesn't it get indexed?

#

how did discordjs manage to mess google results?

boreal iron
#

I might miss some ()

#

no syntax highlighting

sudden geyser
#

Go outside.

boreal iron
#

quiet

#

could be possible you need to switch the operator to > in the statement

#

guess you can figure that out yourself

ancient nova
#

btw is there anyway to reload events like you do commands?
do you just rebind them or something?

sudden geyser
#

You'd need to remove old instances of your command and add them back.

#

From your program memory specifically

boreal iron
#

@ancient nova you wanted some non-with-bitfield-messing-around-solution, see above

boreal iron
#

oh I see there's an issue with it

ancient nova
#

what's the issue?

boreal iron
#

lemme update it quickly

ancient nova
#

I bet you really hate my synatx lol

boreal iron
#

happens when you copy and paste your own stuff to minimize the time

#

if old perms > new perms it should be gained not loist

#

if I'm not wrong

ancient nova
#

TypeError: Cannot read properties of undefined (reading 'toArray')

#

lol wut

boreal iron
#

spelling

#

is hard

ancient nova
#

it's spelld correctly though

boreal iron
#

permissionss

#

I wasn't aware it now has two s

ancient nova
#

oh me neither lmfao

#

I should probably be using vsc

boreal iron
#

anyway I updated my code block

#

as I said

#

actually that's also not what we want

#

wait

#

:D

#

i want the difference not Intersection

ancient nova
#

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.

#

or do I have to cast it to string?

#

😄

boreal iron
#

ok got it now

#

one second

#

lemme bring that all up to your weird coding style

ancient nova
#

anyway that seems to work properly now we just need to format it nicely

boreal iron
#
if(oldRole.permissions.bitfield !== newRole.permissions.bitfield)
{
    const oldPermissions = oldRole.permissions.toArray();
    const newPermissions = newRole.permissions.toArray();
    
    const permissionsChanged = oldPermissions.filter((permission) => !newPermissions.includes(permission)).concat(newPermissions.filter((permission) => !oldPermissions.includes(permission)));
    
    roleUpdateLog.addField("Permissions have changed", ((oldPermissions > newPermissions) ? "Lost permissions:" : "Permissions added:") + "\n" + permissionsChanged.join("\n"));
}
ancient nova
#
const permType = {
        CREATE_INSTANT_INVITE: 'Create Instant Invite',
        KICK_MEMBERS : 'Kick Members',
        BAN_MEMBERS : 'Ban Members',
        ADMINISTRATOR : 'Admin'
}
``` now to do that for every freaking perm flag ![KEKW](https://cdn.discordapp.com/emojis/727825308404940800.webp?size=128 "KEKW")
boreal iron
#

ok list or added in the field title then

ancient nova
boreal iron
#

nah appears sometimes in here

ancient nova
#

probably really rarely lol

ancient nova
#

I wonder if this is going to work

boreal iron
#

you can also get rid of concat if you like to

ancient nova
#

is that going to work?

boreal iron
#

change
const permissionsChanged = oldPermissions.filter((permission) => !newPermissions.includes(permission)).concat(newPermissions.filter((permission) => !oldPermissions.includes(permission)));
to
const permissionsChanged = [...oldPermissions.filter((permission) => !newPermissions.includes(permission)), ...newPermissions.filter((permission) => !oldPermissions.includes(permission))];

#

if you don't like concat

ancient nova
#
                let formatting = difference.split(",");
                formatting = formatting.forEach(text => toProperCase(text.replace("_", " ")));
``` something like this probably has a higher chance
boreal iron
#

This will NOT WORK

#

AS I SAID ABOVE

ancient nova
#

huh why?

boreal iron
#

I SAID I updated my code block

#

Then actually posted it AGAIN

ancient nova
#

no I have ur updated code block and it worked

boreal iron
#
if(oldRole.permissions.bitfield !== newRole.permissions.bitfield)
{
    const oldPermissions = oldRole.permissions.toArray();
    const newPermissions = newRole.permissions.toArray();
    
    // const permissionsChanged = oldPermissions.filter((permission) => !newPermissions.includes(permission)).concat(newPermissions.filter((permission) => !oldPermissions.includes(permission)));
    
    const permissionsChanged = [...oldPermissions.filter((permission) => !newPermissions.includes(permission)), ...newPermissions.filter((permission) => !oldPermissions.includes(permission))]; // you hate concat? use this
    
    roleUpdateLog.addField(((oldPermissions > newPermissions) ? "Lost permissions" : "Permissions added"), permissionsChanged.join("\n"));
}
ancient nova
boreal iron
#

one last time

#

this is the updated version showing the permissions difference

#

not the intersection

#

actually the symmetric difference for both permissions arrays

ancient nova
#

oh I see so the old one showed which permissions changed, yes?

boreal iron
#

no the old one only showed the intersection of the first array

#

aka old role

ancient nova
#

I see let me update that rq

boreal iron
#

this version merges both differences into a single array

#

which will contain ONLY different permissions between old and new permission bitfield

#

just paste the code like this and you will see the magic

#

did even adjust the field title, just for u

ancient nova
#

I'm still waiting for my stupid docker to boot my bot up

#

💀

boreal iron
#

you just need to check for permissionsChanged.length to make sure not to post a field without a value

#

lemme

#

adjust that, too

#

there we go

#

updated

#

nvm doesn't make sense at all

#

can't be changed from nothing to nothing

lucid tapir
#

Anyone know how I would go around trying to create top.gg vote logs in Python?

boreal iron
#

you can begin with taking a look into the topgg docs

#

there are examples for py as well

lucid tapir
boreal iron
#

in order to receive webhooks

lyric mountain
#

examples, please dont just copypaste it

lucid tapir
#

Hm, is there a way I can do it without webhooks?

boreal iron
#

then it's your job to manage to save them in a database for example

lucid tapir
#

Or is it strictly webhooks?

lyric mountain
#

to receive notifications, only with webhooks

ancient nova
#

😭

boreal iron
#

technically yes, by doing api requests

lyric mountain
#

talk about being ratelimited tho

lucid tapir
boreal iron
lucid tapir
ancient nova
lyric mountain
boreal iron
lucid tapir
#

I guess I’d take the webhook route then

#

where could I find the docs & examples on this with py?

boreal iron
#

which requires the same fundamental knowledge but about webhooks tho

lyric mountain
#

ur not escaping http no matter how much u try

lucid tapir
#

😭

boreal iron
ancient nova
#

just trying to format the permission field from THIS_IS_A_PERMISSION to This Is A Permission

lyric mountain
#

regex

#

or a for loop

ancient nova
#

toProperCase() is a function that I made specifically for that

lyric mountain
#

well then, what's the issue?

#

also, it's technically toTitleCase then

boreal iron
#

diferrence is an array

#

not a string

#

also that shorthard statement for the value is not needed

#

if you check both bitfields for a difference before

#

if(oldRole.permissions.bitfield !== newRole.permissions.bitfield)

#

updating from no permission to no permission would work

#

so remove the statement as in my code block

#

and once again your replace all expects a string not an array

#

if you wanna edit each item, look the array BEFORE using join OR get rid of join

ancient nova
#

almost got it right

boreal iron
#

last time I'm updating my code now

#
if(oldRole.permissions.bitfield !== newRole.permissions.bitfield)
{
    const oldPermissions = oldRole.permissions.toArray();
    const newPermissions = newRole.permissions.toArray();
    
    // const permissionsChanged = oldPermissions.filter((permission) => !newPermissions.includes(permission)).concat(newPermissions.filter((permission) => !oldPermissions.includes(permission)));
    
    const permissionsChanged = [...oldPermissions.filter((permission) => !newPermissions.includes(permission)), ...newPermissions.filter((permission) => !oldPermissions.includes(permission))]; // you hate concat? use this
    
    roleUpdateLog.addField(((oldPermissions > newPermissions) ? "Lost permissions" : "Permissions added"), permissionsChanged.map((permission) => permission.replaceAll("_", "")).join("\n"));
}
winter pasture
boreal iron
#

there u go

#

oh no

#

at this terrible state it is?

#

still hasn't fixed the nickname change error

quartz kindle
#

so djs just releaed v14 lol

winter pasture
#

Kinda weird it came out now...

winter pasture
boreal iron
quartz kindle
#

skill issue

boreal iron
#

shut up bitch

boreal iron
winter pasture
#

Gonna read the changelog later

#

Not really kept up to date what they have changed

boreal iron
#

is that an issue?

#

13.9.0 has been released 3h ago

ancient nova
#

I don't think I'll ever update

#

to v14 KEKW

boreal iron
#

well then suffer the consequences

quartz kindle
winter pasture
#

Well it is that or stop supporting your bot lol

quartz kindle
#

they just pulled an apple move

winter pasture
#

nice /s

boreal iron
#

yeah after introducing all those guards, now they have been removed again

quartz kindle
#

thats literally what we used to do in v12

boreal iron
#

as I said today already

quartz kindle
#

and early v13

boreal iron
#

or yesterday

quartz kindle
#

then they added these isText() methods out of nowhere

#

and just dropped them again

boreal iron
#

absolutelly inconsitent mess

quartz kindle
#

incontinent mess

boreal iron
#

tim please

#

not my fault auto correct isn't a thing here

#

which I hate anyways

#

anyways some guards have been removed, similar guards have been added or not been removed

#

their logic simply follows no logic at all

#

you literally need to go through the entire documention or changelog to find any absurd change to update your code

#

since it deosn't follow any logic at all

#

or consistency

winter pasture
boreal iron
winter pasture
#

Builders are now included in v14
Thats kinda nice tbh

ancient nova
#

amazing

boreal iron
#

WHO IS FUCKING using them seriously

ancient nova
boreal iron
#

only people don't know what they do

#

or am I wrong

winter pasture
#

Enum values are PascalCase rather than SCREAMING_SNAKE_CASE, i.e., .CHAT_INPUT -> .ChatInput
Ah, they wont scream at me anymore

boreal iron
#

it's not even they are more effient, less code or have any advantage

winter pasture
#

Who cares about caching / ram issues

quartz kindle
#

idgaf im still gonna use screaming snakes on my libs

winter pasture
#

when you no longer have screaming snake case

quartz kindle
#

consistency with the discord api > case preference

winter pasture
#

Yes!

ancient nova
#

THIS_IS_CALLED a screaming snake?

boreal iron
#

Yes!

ancient nova
#

everyday you learn something new

winter pasture
#

Thats whats important in life

boreal iron
#

That's what I always say, the API hasn't changed exisiting values it expects at all

#

or expected data

#

still prefer snake_case

#

doesn't scream at me :D

#

ok english is fully broken today

ancient nova
#

I'm gonna add one more event

winter pasture
#

I am stupid

Methods that return CDN URLs will now return a dynamic image URL (if available). This behavior can be overridden by setting forceStatic to true in the ImageURLOptions parameters.
What does a dynamic image URL mean in the context of discord? 🤔

ancient nova
#

which is guildMemberUpdate

boreal iron
#

isn't there an internal cdn url you can only access in discord?

winter pasture
#

Ah so static as a not moving gif?

quartz kindle
#

ye

#

before you had to set dynamic:true to get the gif version

#

now dynamic is default

winter pasture
#

I see

boreal iron
#

ah

#

14.1.0 tomorrow when 14.0.99 has been reached

lyric mountain
quartz kindle
#

lmao

#

what did they fuck up?

winter pasture
#

What did they change tho xD

quartz kindle
#

Lol

boreal iron
#

wait the stable branch in the docs is 13.9.0 it seems

#

the main branch is v14

#

huh

#

i don't get that but okay

spark flint
#

8 mins ago

stable eagle
quartz kindle
#

Unsafe Builders
Unsafe builders operate exactly like regular builders except they perform no validation on input. Unsafe builders are named by adding an Unsafe prefix to a regular builder

#

lmao

boreal iron
#

ok lemme see real quick if it's now possible to edit an username

quartz kindle
#

fuck me

boreal iron
lyric mountain
#

the change:```diff

  • import * from "./whatever"
  • import * from "./libs/whatever"
winter pasture
#

Oh no. DJS docs trying to trick me

boreal iron
winter pasture
#

No idea why it started doing it xD Worked like 5min ago, so Chrome must just have started flagging it lol

quartz kindle
#

djs being lowkey political

#

not that i disagree

boreal iron
#

fuck they fixed the nickname bug

#

wanted to make fun it

#

how was it still a bug like 3 hours ago in the latest dev build

quartz kindle
#

what was the bug?

boreal iron
#

you couldn't change somebodys nickname

#

djs internally fucked up the api request

#

sending the wrong data to it

#

it included data you would send when timing somebody out

#

don't ask me why

boreal iron
#

probably just internally copy and pasted code

#

I think so

ancient nova
#

poggers?

#

should I make a boosted module?

#

since I already wrote code for it might as well?

boreal iron
#

at least it works now

#

it always fucked up my config reset command

#

nice... so at the end nothing has really changed to the latest dev built

#

means I don't have to touch anything

#

great

#

good for me Iguess

ancient nova
ancient nova
boreal iron
#

@quartz kindle have fun updating your lib, once you're done 14.5 will bring the next breaking changes

ancient nova
#

so many events

quartz kindle
#

tbh idk if i even will update it

#

i mean

#

first i'll need a good reason to

boreal iron
#

I know this has been rude

quartz kindle
#

what does djsl do that djs v14 cant?

boreal iron
#

i'm gonna send you some cash to motivate you

quartz kindle
#

yes send me a million dollars

#

:^)

boreal iron
#

OK SIR I WAS ABOUT TO SEND some

#

but since you beg for it

#

canceled

quartz kindle
#

:^)

#

evil

stable eagle
#

Boredom

boreal iron
ancient nova
#

I want to make a boosting module but I don't know if I should

stable eagle
ancient nova
#

my setting embed is alrady kinda messy and I would have to add a check and a channel for the module so that's 2 more fields

quartz kindle
boreal iron
quartz kindle
#

:^)

boreal iron
#

charge them

#

wait is that the right word

quartz kindle
#

yes

boreal iron
#

great!

quartz kindle
#

but charging for open source, let alone a hack of another open source project, its a good way to ruin your reputation

ancient nova
#

:/

#

should I or not?

sudden geyser
#

You could also do what node-ipc did

quartz kindle
#

ah yes, add a token stealer to djsl

boreal iron
#

obfuscate it

quartz kindle
#

fill the user's pc with hearts

boreal iron
#

nobody will think something bad is in it

sudden geyser
#

with love from america <3
drops carpet bombs

boreal iron
quartz kindle
#

with love from brazil

boreal iron
#

oh oh oh, brazil ain't in america

#

we know, we know

sudden geyser
#

yes it is

earnest phoenix
#

What is Module_not_found error on discord.js v13.6.0

boreal iron
#

no no it's the brazilian continent

sudden geyser
#

latin america is america's playground

quartz kindle
boreal iron
#

thought it's only full of drugs and slums

#

lmao

quartz kindle
boreal iron
#

bet wrong node version

#

or djs version

quartz kindle
#

wrong node version probs

earnest phoenix
boreal iron
#

nailed it

#

isn't mee6 already a thing?

#

update your nodejs version to at least 16.6 or 16.9

earnest phoenix
#

ok

boreal iron
#

either this or that

#

idk

#

latest stable is 16.16.0

#

so that should be ok I guess

quartz kindle
#

mee8, the next mee6

ancient nova
#

where is mee7? skipping versions like apple iphone 9

earnest phoenix
quartz kindle
#

or windows 10

earnest phoenix
#

you want me to make MEE7 next?

quartz kindle
#

mee666

earnest phoenix
#

how do I update npm again?

ancient nova
earnest phoenix
#

didn't update npm version still same

ancient nova
lyric mountain
boreal iron
#

oh my lord, placeholders now SUPPORT new lines

#

I love it

lyric mountain
#

any other number doesn't make much sense

earnest phoenix
#

I installed node 16.16 troll

fathom sonnet
#

i got a question. so i want to send message to channel whenever someone add my bot to server, but, thing is that i want to send a message to the highest channel on the server.

sooo how could i doo that...

I need to fetch all channels on the server and find highest one? or... cuz i got no idea on how could i do that

quartz kindle
#

are you using discord.js?

lyric mountain
#

ah wait, u want to send to a channel

#

just iterate over all channels and get the first one that allows u to talk

ancient nova
#

what other bot lists do you guys know? I'm literally getting no invites from top.gg

winter pasture
#

DJS docs finally updated

sharp saddle
sharp saddle
lyric mountain
winter pasture
lyric mountain
#

but if u don't get any invite from top.gg, try re-reading ur page and see what ur doing wrong

#

you could have the best bot in the world, a bad description still wont get u any invite

earnest phoenix
#

Or try auctions troll

lyric mountain
#

even with auctions, if u dont describe properly nobody is gonna click

winter pasture
lyric mountain
#

I...I said re-reading

winter pasture
#

I am blind

#

Reading is not my thing

lyric mountain
#

lmao

ancient nova
#

:/

#

I get literally no invite

lyric mountain
#

that's the issue, don't copy

winter pasture
ancient nova
#

ever since I added my bot here, about 3-4 weeks I haven't even gotten one lol

lyric mountain
#

u could copy coke, still won't sell as many as coke

ancient nova
#

I don't know how to use auctions

gilded plankBOT
#
Top.gg Auctions
Auctions Information

You can find out more about Top.gg auctions by reading this support article.

Current Auctions Stage

We’re currently in the stage of Auctions Bidding. This stage runs from <t:1658257200:F> (<t:1658257200:R>) to <t:1658775600:F> (<t:1658775600:R>). During this stage, you will be able to bid. At the end of the auction, you will be given 12 hours to pay.

Auctions Timing Update

Next Ads Go Live / Next Auctions Starting: <t:1658257200:F> (<t:1658257200:R>)

Next Auctions Ending: <t:1658775600:F> (<t:1658775600:R>)
winter pasture