#development

1 messages · Page 48 of 1

neon leaf
lyric mountain
#

u cant ack twice

#

are u using .reply to answer?

neon leaf
#

ye

lyric mountain
#

u cant

#

unless ur not deferring before executing the command

#

like, either reply OR defer

boreal iron
#

In the name of fuck… that fucking code bin site trims down to my mobile screen size

boreal iron
#

lol

neon leaf
lyric mountain
#

normal send()

#

but I cant say much without looking at the code

#

your link is dead, results in a white screen

neon leaf
#
                               ^

TypeError: interaction.send is not a function```
lyric mountain
#

.channel first

boreal iron
#

send() is a method available on messages or channels

#

And it’s not a proper interaction response

#

Without responding accordingly your interaction will fail

lyric mountain
#

available on messages
djs has send() on messages?

lyric mountain
#

which is why he cant use reply for the response

boreal iron
neon leaf
lyric mountain
#

send ur code again

boreal iron
#

Why do you wanna respond with a message via the gateway?

#

Use interaction.reply()

neon leaf
neon leaf
boreal iron
#

Or you will have to make sure your bot has the permission to send messages

wheat mesa
#

followUp

boreal iron
neon leaf
#

I can respond in 3s

#

it works when the bot has the permission for timeouts

boreal iron
#

Also You can reply only once

lyric mountain
#

I wouldn't trust fetch to return anything in time

#

actually, same for any api calls

boreal iron
#

If you want to send an additional message, you use followUp() as waffle mentioned

neon leaf
boreal iron
#

Then respond using return interaction.reply()

wheat mesa
#

Defer, reply, followup (optional)

neon leaf
#

and Im confused because that exact thing dont work

wheat mesa
#

That’s the chain of events

neon leaf
#

everywhere else it does

boreal iron
#

The permission check is sync and doesn’t require any awaiting

lyric mountain
#

I don't see any second reply btw, might be something outside of ur command

#

like a *gasp* "please wait" message

boreal iron
#

Show me how you check the permissions and how you respond if they are missing please

#

Lemme get to my pc

#

Mobile sucks hard

lyric mountain
#

btw, use a loop

neon leaf
boreal iron
#

setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages)

#

Are you sure ManageMessages is needed to do timeouts?

neon leaf
#

ManageMessages is what the user needs

boreal iron
#

Without knowing I would guess it's manage members etc

#

Yes to use the command

neon leaf
boreal iron
#

I don't any bot permission check

#

looking at this atm

lyric mountain
#

I don't see anything at all

boreal iron
#

yeah

lyric mountain
#

like, I cant understand the code I mean

#

you could cut the length of it by like 70% by using handlers and loops

neon leaf
#

the main file was like 1000 lines before i did that global.*** = require thing

boreal iron
#

The thing is your command handler also has no permission check

lyric mountain
#

index should really only have 2 things: the bot client and handlers instantiation

neon leaf
#

we are in bot.js right now doe, index.js is also a file I have with sharding

boreal iron
#

What you need to add to your command is a permission check to make sure the bot has the permission to timeout a member, not the command user

neon leaf
#

ok, what do I have to check for that? I for some reason cant find anything online to check if the bot has X permission

boreal iron
#
if(!interaction.appPermissions.has("ManageMembers"))
{
  return interaction.reply({ content: "bot needs manage members, fucker", ephemeral: true });
}

// go on with your stuff
#

has() takes a permission resolvable in this case

#

can be anything

#

Now... once again

neon leaf
#

btw, its ModerateMembers

boreal iron
#

Replace const member = await interaction.guild.members.fetch(user.toString().replace(/\D/g, '')) by const member = await interaction.guild.members.fetch(user.id)

#

as next

#

member.timeout returns a promise as well

#

await it

#

The docs (I mentioned) usually tell you what the method or property returns

#

catching the error works only if you await it

#

also catching it like you did, makes no sense as well

#

returning '» I dont think I have the **MODERATE MEMBERS** Permission!' can be wrong

#

Technically the member could leave the guild in the second or seconds before using the command while fetch could still return the member object

neon leaf
#

btw, do you know the bot permission needed to do const messages = channel.messages.fetch()?

neon leaf
boreal iron
lyric mountain
#

yes

#

and ViewChannel if it's not the same channel

boreal iron
#

oh also

#

return interaction.channel.send({ embeds: [message.toJSON()], ephemeral: true }) inside your timeout catch clause

#

It's still await interaction.reply(...)

#

refrain from sending messages via. the gateway, not responding to the interaction properly

#

this will cause an Interaction failed response in the client UI

#

also anywhere you're using [...].user.id.replace(/\D/g, '') remove that

#

it's nonsense

#

An user id does not contain any non-digits

#

never

neon leaf
boreal iron
#

well fetching the channel is a different permission

neon leaf
boreal iron
#

There's is a reason why it does that

boreal iron
#

The reason is this nonsense: user.toString()

#

When concatenated with a string, this automatically returns the user's mention instead of the User object.

#

stop concating this with other strings

#

using user.toString() makes sense only if you want to show an user mention

#

if you want to log the user id which seems to be what you actually wanna do, then use user.id

#

console.log('[0xBOT] [i] [' + new Date().toLocaleTimeString('en-US', { hour12: false }) + '] [' + interaction.user.id + ' @ ' + interaction.guild.id + '] [CMD] TIMEOUT : ' + user.id + ' : ' + time + 's')

#

also just as tip, since you're continuesly logging a similar format

#

create a function, for example called log and add and concat your string to log

#
function log(string)
{
  console.log(`[0xBOT] [i] [${new Date().toLocaleTimeString('en-US', { hour12: false })}] ${string ?? ""}`);
}
#

technically the null-coalescing operator isn't required but why not

neon leaf
boreal iron
#

Did you try that one?

#

I'm the wrong one to ask when it comes to permissions

neon leaf
boreal iron
#

but view channel seems to be the logical consequence

#

what error do you get?

neon leaf
boreal iron
#

Yeah that’s the reason I asked

#

Either that or you tried to fetch a channel your bot hasn’t any access to

#

Aka a guild youre bot isn’t in

neon leaf
#

I think im too stupid to find the perm on discord though

#

isnt this it?

#

if yes, it doesnt work

lyric mountain
#

member overrides > channel perms > role perms > everyone perms

#

read > as overrides

eternal osprey
#

Het

#

Hey*

#

Is anyone here familiar with parse trees?

lyric mountain
#

waffle

eternal osprey
#

For my university I have to know parse trees. However I don’t really understand the concept

#

And there’s like no videos or something online

wheat mesa
#

Like ASTs?

boreal iron
#

man I found something I can only shake my head

#

when deferring a response of an interaction, the ui shows the "bot is thinking" state

#

if you delete that message (which is possible for some reason) the deferred response will fail with an Unknown Message error

#

but the webhook itself isn't invalidated

#

(since it got deferrred)

#

so sending a follow up is still possible

#

so editReply() simply does const message = await this.webhook.editMessage('@original', options);

#

I mean I get why the error since the original message isn't there anymore

#

but still since I'm still able to send follow ups (because the webhook id is still valid) why doesn't discord still let me "edit" the original message even if it's gone

#

what a nonsense this "thinking" state can actually be deleted

#

that should only hide it in the UI imo

lyric mountain
#

what the fuck you're talking about jesse?

boreal iron
#

R E A D I T

#

deleting the thinking state of a deferred message doesn't let you edit the original response anymore

#

but technically there's no original response, since deferring is just an ACK

#

(with the hint, hey fucker i still need some time to respond)

lyric mountain
#

might be just an api loophole

boreal iron
#

no

#

you can try it yourself

#

defer an interaction response

#

put a timeout in there, let's say 20s editing the original reply

#

while running delete the message saying "bot is thinking"

#

boom error - unknown message (to edit your reply)

#

that's nonsense for interactions

#

makes sense to deal with that for gateway messages

#

I basically need to rethink any deferred (edit) reply now

#

while the command handler catches error while execution, an user deleting the "bot is thinking" state prevending the bot from editing the response means that's not an execution error but an user decision

#

so each time I defer a response I would need to separately catch the editReply() method

#

since the user could have decided to remove the original response (defer state message)

#

technically that isn't a code execution error

#

what a stupid bullshit

#

@quartz kindle can't send you a DM anymore - sadness

#

hey, how's your time spending limit atm?
I mean I saw you talking about you're helping building a house...

#

actually got something relativelly small to do

#

gonna need to follow a protocol to handle a remote connection, sending heartbeats and need to ack the response as well as incoming messages

#

need to split those connections (to different remote servers) into child processes

#

and have a way to broadcast messages to each child

#

(JS)

lyric mountain
#

help, fake is having a catharsis

boreal iron
#

that has nothing to do with my complainment

#

that's just total nonsense how interactions being handled at least deferred responses

#

I mean I have fucking 15min to respond

#

but if somebody decides to delete the "bot is thinking" message I am fucked

#

since he might think my bot died, is stuck or whatever

#

such a nonsense

boreal iron
#

probably removed fake from your friend list?!

quartz kindle
#

no?

boreal iron
#

yes!

quartz kindle
#

didnt touch my friend list in ages

boreal iron
#

you devil

quartz kindle
#

nor changes any prvacy settings

boreal iron
#

same btw

#

gotta sent a new request

quartz kindle
#

weird

boreal iron
#

indeed

#

so... what about the shit i mentioned above?

#

regarding your time

#

it's not something you have to do for free

#

to be fair

quartz kindle
#

i can spare some time

#

what kind of protocol is it?

#

web stuff?

#

not usb stuff i hope

#

lmao

boreal iron
#

ehmm uhmm IM NOT PREPARED shit

#

lemme get the shit together real quick

lyric mountain
#

fake is having a harsh day today

boreal iron
#

Imagine you could see the dms

#

Lol

#

But for real that webhook shit triggers me

#

I found out the webhook id doesn’t become invalid

#

But even if it’s valid you can NOT do anything with it anymore

#

Deleting the initial response in this case the bot is thinking deferred state is fucking you up

wild silo
#

my bot got denied for verification due to inorganic growth that came from top.gg (i didn't advertise my bot, just listed it) is adding my bot to top.gg isn't allowed? do i appeal?

earnest phoenix
#

Till the growth goes down again

wild silo
#

ill copy the email, its not a message in the dev portal

wild silo
#

i got in 2.5 days sudden hit of servers

#

idk how

earnest phoenix
#

Bc you need to verify your bot

rustic nova
#

listing your bot can cause your bot to grow too fast as per discord, thus them denying your verification

#

your bot cap gets increased to 250 to attempt to get organic growth now

boreal iron
#

It is allowed to advertise your bot but an unexpected fast growth is as they say inorganic

rustic nova
#

also is not appealable

wild silo
rustic nova
#

listing it is indirectly advertising it

rustic nova
#

a inorganic growth decision is not appealable

#

you can re-apply after a bit

boreal iron
#

Still people can find it easier than if you wouldn’t put it on the platform

wild silo
boreal iron
#

You should also make sure it hasn’t been invited multiple times by the same users

rustic nova
#

well if your application was denied multiple times for that reason, then lol

boreal iron
#

Which is also a reason for inorganic growth

rustic nova
#

still unappealable

rustic nova
#

then get organic growth by filtering your guilds on dead ones/empty ones, and yeeting guilds owned by the same user

wild silo
#

do i take it down from top.gg and wait 2 weeks and appeal again?

rustic nova
#

shrug try it

wild silo
dense ridge
neon leaf
#

lets say I have a string '1+4/2', whats the best way to get the mathematic result of that? (3) (js)

earnest phoenix
#

Math.count()

#

or use npm package of mathjs

jaunty plank
#

Omagad

lyric mountain
#

it's a great lib but be careful with some "exploits" that might hang ur bot

pure sage
#

its work to use firebase in my bot?!!

lyric mountain
#

yes?

pure sage
earnest phoenix
lyric mountain
#

I dont really get your question, any database will work for anything

lyric mountain
pure sage
neon leaf
lyric mountain
pure sage
#

idont now how

lyric mountain
lyric mountain
pure sage
lyric mountain
#

no I wont

#

just show a print

neon leaf
#

btw, is there any way to translate choices like Descriptions and Names in discord.js v14?

wooden ember
#

the only way that comes to mind is if you have all the text in a json file with the name and string for each. then have multiple jsons with the text in diferent languages and make a setting that uses one or the other

lyric mountain
#

wouldn't work for slashes unless u register as guild-local commands

wooden ember
#

bruh i dont use those so idk

pale vessel
neon leaf
#

normal bomb 😄

wicked pivot
#
let arrayStaffRole = [
        {'id' : '1016397163514826822', 'number': 1},
        {'id' : '1016397249871364236', 'number': 2},
        {'id' : '1016397371933999117', 'number': 2},
        {'id' : '1016397417651896364', 'number': 2},
        {'id' : '1016397510278910064', 'number': 2},
        {'id' : '1016397873996386335', 'number': 4},
        {'id' : '1016397933245108304', 'number': 2},
        {'id' : '1016397967940407377', 'number': 2},
        {'id' : '1016398076971319337', 'number': 3},
        {'id' : '1016398172039434261', 'number': 3}
    ]

    let arrayFields = []

    for(let i = 0; i <= 8; i++){
        let arrayMembers = []
        client.guilds.cache.get('1013101563625082920').roles.cache.get(arrayStaffRole[i].id).members.map(r => {
            arrayMembers.push("`-` <@!" + r.user.id + ">")
        })
        let text = ''
        for(let a = 0; a <= arrayStaffRole[i].number-1; a++){
            if(arrayMembers[a] == undefined) text + "`-` in search \n"
            else text + `${arrayMembers[a]}\n`
        }

        console.log(text)

        /*arrayFields.push({
            name: "**" + client.guilds.cache.get('1013101563625082920').roles.cache.get(arrayStaffRole[i]).name + ":**",
            value: text
        })*/
    }```  the method I'm using doesn't work, I'm not sure I'm using the right method, does anyone have an idea of ​​what I can do?

```js
console.log(text)

return in terminal \n```
lyric mountain
#
  • number-1 u dont need to do this, simply use < instead of <=
  • arrayMembers[a] == undefined can be done with just arrayMembers[a]
  • you shouldn't use map for no-return operations, map is for mapping not iterating (for that use forEach)
  • your outer loop will never get the last role
  • I dont get what you're even trying to do
wicked pivot
#

i try to do this

wooden ember
#

it looks like this is to list the total members combined with deferent roles

#

is that what this is

lyric mountain
#

well, the issue is mostly here

wicked pivot
#

in fact it is the staff roles the number of members per role is defined, so if there is not the number of people write '- in search'.

lyric mountain
#

you're never assigning the new value to text

wicked pivot
#

ow !

#

text = text + '...'

#

no ?

lyric mountain
#

text += '...'

#

make sure to fix the other stuff I noted up there

wicked pivot
#

it seems to work thanks!

#

it works very well thank you, I made some stupid mistake x)

lyric mountain
#

I don't see anything interactable there

#

oh nvm, now I do

#

yes it's possible

#

even easy I'd say

#

it'd be easier to do it without node tho

#

like, pure html + js

#

canvas gives u the click coordinates, u just divide that by the number of slots to get the position on the grid

#

u cant track clicks on discord,

#

that site use clicks to draw

#

...I don't think u understand what I mean

#

but well, u can draw anything with canvas, just need some logic

boreal iron
neon leaf
boreal iron
#

you wanna disable 4 buttons when receiving this interaction?

neon leaf
#

yuh

boreal iron
#

which sort of interaction is it, a button interaction?

neon leaf
#

yuh

boreal iron
#

ok the issue is your wrapping the components array into another array

#

lemme show you

#
interaction.message.components[0].components[0].data.disabled = true;
interaction.message.components[0].components[1].data.disabled = true;
interaction.message.components[0].components[2].data.disabled = true;
interaction.message.components[0].components[3].data.disabled = true;
interaction.message.components[0].components[parseInt(solbutton)].data.style = ButtonStyle.Success;

return interaction.update({ embeds: [message.toJSON()], components: interaction.message.components })

// not [interaction.message.components]

interaction.message.components is an array of components already

#

also [message.toJSON()] is completelly unnecessary, djs internally converts your data anyways

lyric mountain
#

please assign interaction.message.components[0] to a variable thanks

boreal iron
#

nope

lyric mountain
#

hmmm no, you're repeating the same thing on all 5 lines (context deleted)

boreal iron
#

yeah and?

lyric mountain
#

4 extra array accesses?

boreal iron
#

calling the property is less memory than creating a new var

#

since yours is just a reference, not more or less

lyric mountain
#

?

#

you don't need to access an array N times if you'll be getting the same index everytime

#

plus it'll not use less memory since it'll be loaded in memory regardless

boreal iron
#

before running into another useless discussion, let him decide what he likes

#

or not

lyric mountain
#

that's not a matter of liking or not tho, it's good practice

boreal iron
#

if I would criticize each part of shared code here, which I don't like or which is nonsense then I would have to spend 24/7 in that discord, I guess

lyric mountain
#

that's no excuse not to give advice on how to write better code

boreal iron
#

1st thing I would complain about is using the builders

#

:D

boreal iron
#

MAYBE keep in mind what kahuwakabanklokoloko said

#

as good advice

neon leaf
#

I'll pass, its more readable to me directly seeing what im editing

boreal iron
lyric mountain
#

bad choice on the long run, but ok

spark flint
#

Getting this when trying to connect to redis

#

currently redis://PASSWORD@localhost:6379

lyric mountain
#

u forgot the user

sick agate
#

welp

spark flint
#

I just got it working

#

moved to ioredis

lyric mountain
#

why ur using redis btw?

spark flint
#

caching server configs

#

so it doesn't have to make a DB request everytime someone uses the report/appeal button

#

working much better already

lyric mountain
#

ain't that better done with an in-memory map?

spark flint
sick agate
#

hety

#

anyone has any web editor recommenditions for embedding

lyric mountain
#

wdym embedding?

#

like, putting in a site?

#

for what content? text, comment, forum, code, etc?

sick agate
lyric mountain
#

vscode web

sick agate
#

well

#

meh?

lyric mountain
#

if u want something simple just grab any text editor that allows highlighting

sick agate
#

yea i asked for htat

#

probably gonna use quilljs

neon leaf
#

what am I doing wrong? components[1].components[5] is where it stops working

lyric mountain
#

TIH everything about that code lmao

neon leaf
#

this is how the buttons are positioned if that helps

neon leaf
lyric mountain
#

time to make your current code your new previous code then

neon leaf
#

my previous code took almost a second to execute 😬

lyric mountain
#

I'm not talking abt speed or running at all, it's just (sorry) ugly

#

but well, what are those evals doing there?

neon leaf
#

I didnt find any other way of getting dynamic var names

lyric mountain
#

why do u need dynamic var names?

neon leaf
#

to store temporary data

lyric mountain
#

that's why maps exist

neon leaf
lyric mountain
#
{
  this: 1,
  is_a: "map"
}
neon leaf
#

I dont think I can dynmapically name the this: part, etc though

lyric mountain
#

theMap["prop_name"] = stuff

neon leaf
#

🤔

#

how do I init a map?

lyric mountain
#

theMap = {}

neon leaf
#

mhm, well back to the root problem though

lyric mountain
#

which was...?

neon leaf
#

I need to go through every button and edit it

boreal iron
#

What are u actually trying to do?

neon leaf
#

go through every button and edit it

boreal iron
#

Can’t watch this code on mobile without dying

#

Go on

neon leaf
#

thats it

#

just go through every button and edit it

boreal iron
#

Disabling it again?

neon leaf
#

no, well yes, in this case but the other things need to be updated too

boreal iron
#

Ok so message components is an array of components

neon leaf
lyric mountain
#

well, the entire code is a problem tbh, why are u using while to loop over a 2d array

boreal iron
#

You just loop that one and edit each item inside

neon leaf
#

but it stops working after I reach 5 buttons done

#

aka 1 row

boreal iron
#

Lemme go to the pc and give you an example

#
let components = interaction.message.components; // to make the java weirdo happy

for(const row in components)
{
  for(const component in row)
  {
    component.data.disabled = true;
    // and other shit
  }
}

await interaction.update({ components: components });
#

you gonna loop the rows, then loop the components inside

lyric mountain
#
const structure = [
  {
    "emoji": "123454321",
    "style": "somestyle",
    "disabled": true
  },
  ...
]

for (const i = 0; i < 20; i++) {
  const row = Math.floor(i / 5);
  const button = interaction.message.components[row].components[i % 5];
  const values = structure[i];

  button.data.emoji = values.emoji;
  button.data.style = values.style;
  button.data.disabled = values.disabled;
}
#

considering structure is ur desired structure (an array of objs)

boreal iron
#

oh you wanna update buttons individually, I see

#

well then...

#
let components = interaction.message.components; // to make the java weirdo happy

for(const row in components)
{
  row.components[0].data.emoji = ...;
  row.components[2].data.style = ...;
  row.components[4].data.disabled = ...;
}

await interaction.update({ components: components });
#

don't need to skip your rows for just a max of 5

#

won't make a noticable performance difference

lyric mountain
#

he wasn't skipping

#

he was incrementing the row index, to go to the one below

#

also ur solution will require manually changing every button

boreal iron
#

yeah that seems to be exactly what he wants

#

updating each button per row individually

#

maybe all per row, maybe not

lyric mountain
#

hm...but his old code was iterating over every button, editing the value of every one

boreal iron
#

dunno each row, each button or the intention at all

#

since I literally assume he doesn't wanna have the same emoji, style and state for any button

#

At least I hope so

lyric mountain
#

nope, he was evalling to get/create dynamic variables

#

basically like a map, to store the values of each button

boreal iron
#

where do you take thatinfo from?

boreal iron
#

ahh

neon leaf
#

well its memory, so yeah; everything has different emojis

lyric mountain
#

a note for future 2d array loops, u can get the row by using floor(index / maxColumns)

#

and the column by using index % maxColumns

#

for 3d it gets a bit more complex, but you shouldn't need a 3d array ever

jaunty plank
#

Hi

neon leaf
boreal iron
#

oh no again... sender.toString.replace

lyric mountain
#

lmao

neon leaf
#

i just copy pasted, imma remove it later

lyric mountain
#

remove from your entire code anything with replace(/\D/g, '')

boreal iron
#

god safe the replace all function

neon leaf
#

already did everywhere except minigames, thats where im at now

lyric mountain
#

try replacing the eval with the definitive structure

boreal iron
#

Only dictionaries may be used in a ModelType that's sort of a different error, can't imagine that has to do with your buttons

lyric mountain
#

hard to help when it still has temporary stuff

neon leaf
#

btw I found out this is how you are supposed to make a map

boreal iron
#

just log for us what your values for emoji and style are, please

lyric mountain
#

just longer

lyric mountain
#

log marker moment

neon leaf
#

the 2 is the style

#

btw

#

its actually a ButtonStyle.Secondary

boreal iron
#

well the issue should be obvious

#

Only dictionaries may be used in a ModelType

#

your emoji structure is wrong

neon leaf
#

🧐

#

it worked before tho

boreal iron
#

example structure

{
  "id": "41771983429993937",
  "name": "LUL",
  "animated": true
}
lyric mountain
neon leaf
lyric mountain
#

put it inside

#

for (let i = 0; ...)

#

there's a shorter way to write that, I just dont remember how in js

neon leaf
boreal iron
#

in an older djs version?

neon leaf
#

no, old version of my code

boreal iron
#

my eyes

lyric mountain
#

lmao talk about unmaintainable code after a couple days

neon leaf
boreal iron
#

I'm gonna call you Mr. Bae 2 from now on

neon leaf
#

ok well, we had a problem to solve

lucid bramble
#

Hola gente toy doramion

neon leaf
# neon leaf

basically what it does it gets emojis from a lists and puts their ids into the global var that gets read in the other code

boreal iron
#

you still have to provide a valid structure since the api expects it

neon leaf
#

ok, i think im just gonna rewrite all of this to work with maps

#

rn

#

and then see if it works

boreal iron
#

button.data.emoji = { id: /* your weird eval code here */ };

neon leaf
#

that works...

#

I do not understand why the previous code worked without it

#

OOH

boreal iron
#

of course it does, what du you expect, it's me, mario

neon leaf
#

I used buttonbuilder before

boreal iron
#

I don't wanna see the words builders and using here, please

#

builders and hating or trash is okay

neon leaf
#

👀

#

why do you hate em that much

winter pasture
#

new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),

boreal iron
#

AHHHHHHHHHHHHHHHHHH

winter pasture
#

const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('primary')
.setLabel('Click me!')
.setStyle(ButtonStyle.Primary),

boreal iron
#

GO AWAY DEVIL

winter pasture
#

const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');

#

Sorry <3

boreal iron
#

SPAM

#

MOD

neon leaf
winter pasture
#

Ban me 🖐️

boreal iron
#

pepowot 🔫

#

MOVE ON VOLTREX

#

MOVE ON

earnest phoenix
#

Jarvis, redesign discord.js builders for the 8th time

boreal iron
#

NO NO that will not happen, never

#

people dont have to rework their entire code on djs v15

#

or v16

#

or whatever

earnest phoenix
#

JARVIS!!!

#

DO IT

boreal iron
#

DJS DOESN'T RANDOMLY CHANGE THEIR ENUMS OR GUARDS OR BUILDER NAMES AND IT DOESN'T MOVE RANDOMLY FROM SNAKE CASE TO PASCAL CASE OR DROPS CAMEL CASE

#

they don't do such things

lyric mountain
#

imagine using string enums

#

Permission.MANAGE_ROLES ezpz

boreal iron
#

oh no screaming snake case

#

that's not okay

#

soon to be banned

lyric mountain
#

well who tf writes enums in any other case

boreal iron
#

weird java weirdos

#

do you know one? freerealestate

lyric mountain
#

at least we don't need to rewrite the entire codebase on any minor update

boreal iron
#

well I don't need to do so, too

#

neither using their stupid enums nor builders

#

only thing i had to change have been the gateway intents

#

because we need to rename anything from plural to singular

#

very important change if you ask me

neon leaf
#

dont want to insult words

boreal iron
#

yes, please don't hurt the feelings of our java devs

#

they are very weak

lyric mountain
#

I saw that

boreal iron
#

NO U SAW NOTHING

lyric mountain
#

deep inside you there's a java spark

boreal iron
#

fucking auto correct shit

boreal iron
neon leaf
boreal iron
#

damaging my perfect and innocent php soul

earnest phoenix
#

INNOCENT PHP SOUL

#

INNOCENT...

boreal iron
#

trying to ignore the freedom of android dude

neon leaf
#

I bet im gonna annoy someone somehow with this

earnest phoenix
#

FakE, that's far from innocent my guy

boreal iron
#

finally you remembered that the user will turn into an ID when being concated in a string

lyric mountain
boreal iron
#

at least some learning progress

lyric mountain
#

use ["name of the key"]

neon leaf
boreal iron
#

You don't deserve the title Mr. Bae 2 anymore since you made progress

lyric mountain
neon leaf
#

ah

#

but that aint really a map, thats just like a cat strapped to the back of your car

lyric mountain
#

everything is either a primitive or a map in js

#

actually, I'm not even sure if js has primitives at all

boreal iron
#

lmao, he's writing

quartz kindle
#

string, number, boolean, undefined, null

boreal iron
#

waiting for the right moment

lyric mountain
#

string aint a primitive

quartz kindle
#

it is in js

lyric mountain
#

tf

#

but primitives cant have methods, else it's a boxed value

quartz kindle
#

in js primitives simply means they are immutable and always passed by copy

#

even if they are boxed

#

numbers are also boxed, ie <number>.toString()

earnest phoenix
#

Everything in JavaScript is basically an object internally, except for null and undefined because those are "The Hole"

neon leaf
#

ok, I got a roadblock, what do I do here? Can I somehow use anything else as kinda an array?

quartz kindle
#

symbol and bigint are also primitives

quartz kindle
#

why are you using eval

lyric mountain
neon leaf
lyric mountain
#

I'm telling u

#

dont look up the context of this topic

sudden geyser
#

Thought I was the only one who looked at that and went wtf

quartz kindle
#

lmao

boreal iron
lyric mountain
#

even other collections

#

or themselves

sudden geyser
#

Like are you using user IDs as actual variables or something

neon leaf
sudden geyser
#

you sure this isn't just a map

lyric mountain
#

not for the faint of heart

sudden geyser
#

show more code

neon leaf
neon leaf
quartz kindle
#

yes

lyric mountain
#

with "" around the key

quartz kindle
#

although thats an object

#

a map would be new Map()

neon leaf
#

yeah, lemme try with tthat

lyric mountain
#

it's the same thing for both

boreal iron
#

You don’t need a map tho

#

Go with your dynamic obj keys

#

And wrap them in quotes as said

neon leaf
#

I wanna use the proper map

#

this is as far as i get with maps & arrays

lyric mountain
#

both are the very same thing buddy

#

for your use-case, a map is just an alias for object

#

unless u need very specific methods of Map

quartz kindle
slender wagon
#

hi hii

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=18" from @chakra-ui/hooks@2.0.10
npm ERR! node_modules/@chakra-ui/hooks
npm ERR!   @chakra-ui/hooks@"*" from the root project

I am tryna install @chakra-ui/hooks but for some reason it's giving me this error which my brain can't really solve

neon leaf
#

how do I push though?

quartz kindle
slender wagon
#

hm

#

so i could downgrade possibly?

lyric mountain
#

worth a try

neon leaf
quartz kindle
#

why?

neon leaf
#

because of the get, well now I get (funi joke) it

lyric mountain
quartz kindle
#
const map = new Map() // Map {}
map.set(1, []) // Map { 1: [] }
map.get(1) // []
map.get(1).push("a") // same as [].push("a")
const array = map.get(1) // array = []
array.push("b") // same as above
boreal iron
#

tim not even checking if the map has this key

slender wagon
#

anyone knows if i can use localhost redirects on Google's OAuth 2.0

boreal iron
#

smh

lyric mountain
#

so if discord works others will too

slender wagon
#

idk if u can use localhost on any oauth2's

neon leaf
#

wtf is this
await eval('memorydatapc' + interaction.user.id + '.push("' + await eval('memorydataf' + sel + sender.toString().replace(/\D/g, '')) + '")')

slender wagon
#

an eval command

boreal iron
#

I SEE IT AGAIN

#

IT'S THERE AGAIN

lyric mountain
quartz kindle
#

stay away

neon leaf
boreal iron
neon leaf
#

playercache maybe

#

BUT WHAT DOES THAT DO

earnest phoenix
#

You wrote the cursed code, you tell us

boreal iron
#

if you dont know what it does, then dont ask us

#

people in here can only handle a certain amount of pain

#

😁

neon leaf
#

I finally know what it does, its the literal same as pcn but with emojiids instead of buttonids

#

this is so cursed

sudden geyser
#

have you tried rewriting it

neon leaf
#

im not gonna full rewrite that, im gonna make the var names better and use a map but thats it

#

btw does a map need await?

lyric mountain
#

no

#

only things that return a promise do

#

although u can await anything, but it'll be no-op

boreal iron
#

you wanna see something cursed?

sudden geyser
#

no

neon leaf
#

no

boreal iron
#

for /f "usebackq delims=" %%a in (`powershell $zone ^= \"%CERTBOT_DOMAIN%\"^; $result ^= $zone.Split^(\".\"^)[-2] + \".\" + $zone.Split^(\".\"^)[-1]^; $result.toString^(^)^;`) do set ZONE_NAME=%%a

#

take that powershell in batch

#

imagine escaping any char

neon leaf
#

I did that too once because batch math is shit

boreal iron
#

the irony actually is POWERshell in batch

quartz kindle
#

the actual curse here is writing power in caps but not shell

boreal iron
#

the actual curse here are these comments

#

weird audience I have to deal with

neon leaf
#

man, it took me 15min to upgrade 1% of my code because my var names are so stupid

#

I literally have a piece of paper next to me to document what the names do

boreal iron
#

man...

#
106.75.176.113 - - [21/Sep/2022:00:30:59] "{\"method\":\"login\",\"params\":{\"login\":\"45JymPWP1DeQxxMZNJv9w2bTQ2WJDAmw18wUSryDQa3RPrympJPoUSVcFEDv3bhiMJGWaCD4a3KrFCorJHCMqXJUKApSKDV\",\"pass\":\"xxoo\",\"agent\":\"xmr-stak-cpu/1.3.0-1.5.0\"},\"id\":1}\n" 400
#

who in the world does set that login name with the password xxoo

#

watching what sort of stuff people try to attack can be funny sometimes

lyric mountain
#

why is the pass in plaintext

boreal iron
#

guess why

lyric mountain
#

bae?

boreal iron
#

wut

#

that's a webserver request log

lyric mountain
#

a

boreal iron
#

which was made on a non-secure endpoint

#

oh i wasn't aware vmware has vulnerabilities, too

#

146.0.77.38 - - [21/Sep/2022:08:38:34] "POST /ui/h5-vsan/rest/proxy/service/com.vmware.vsan.client.services.capability.VsanCapabilityProvider/getClusterCapabilityData HTTP/1.1" 302

#

Remote Code Execution Vulnerability

#

the internet is a dangerous place

neon leaf
#

how do I properly make a style

neon leaf
#

it isnt tho

#

or did the button builder make it empty for me

#

well how to I make an empty label

boreal iron
#

null or undefined

neon leaf
#

null still errors

boreal iron
#

it's a button?

neon leaf
#

yes

boreal iron
#

well it requires a label if it ain't a emoji if im not wrong

neon leaf
#

it is a emoji tho

#

and it worked before with buttonbuilders without .setLabel

boreal iron
#

oh you're missing the emoji name

neon leaf
#

🧐

boreal iron
#

(can be null only in reaction emoji objects)

neon leaf
#

is the name the name in escaped emojis? ex
!VENT

boreal iron
#

i guess

#

in that case that's also an animated emoji

#

you have to specify this, too

neon leaf
#

-.-

boreal iron
#

I don't paste the docs for fun

lyric mountain
#

floating point moment

boreal iron
#

\<a:VENT:1019238968346284084\>
{ id: "1019238968346284084", name: "VENT", animated: true }

neon leaf
#

how did the button builder grab that automatically

boreal iron
#

haven't seen it, so...

neon leaf
#
                    .setEmoji('1020411843644243998')
                    .setCustomId('MEMORY-17-' + bet)
                    .setStyle(ButtonStyle.Secondary),```
quartz kindle
#

btw you know you can use string templating instead of concatenation right?

lyric mountain
#

inb4: "tell me more"

boreal iron
#

Tim trying again

quartz kindle
#

for example ```js
bot.memory.get(D_EMOJI-${i+l}-${sender})

boreal iron
#

now he has to rewrite it another time

#

how dare you, Tim

neon leaf
#

I know it exists, but its so hard for me to write the `

quartz kindle
#

your keyboard doesnt have it easy?

neon leaf
#

I need to press it twice

#

if I dont my literal code disappears

quartz kindle
#

well, i also press it twice, because on my keyboard its an accent character

neon leaf
#

à

quartz kindle
#

if i only press it once, it waits until i press another character

#

yes

#

so what i do is press twice then arrow-left

boreal iron
#

You press the key then space

#

Works as well

quartz kindle
#

yes

#

but its less performant

#

:^)

boreal iron
#

Ik

#

Imagine pressing 4 keys

#

Damn hard work

quartz kindle
#

:^)

neon leaf
boreal iron
#

I hope they invent a machine soon makes you breathing…
Coding and breathing is too much

lyric mountain
#

isn't that literally traqueostomy?

#

or iron lung

neon leaf
boreal iron
#

webm pandasad

#

Imagine being able to play that

pale vessel
boreal iron
#

Err wtf

#

Discord cache being trash again

#

So each channel has its own cache

#

Interesting

lyric mountain
#

flaze at morning / flaze at evening

boreal iron
boreal iron
neon leaf
#

that aint memory

boreal iron
#

@lyric mountain translation please

lyric mountain
#

the memory game isn't behaving like a memory game

#

like, it doesn't reset after u select a non-match

boreal iron
#

That’s the consequence when you use the code of a Java user

lyric mountain
#

I showed how to update buttons based on structure, not how to write a memory game

boreal iron
#

Shameless excuses anywhere

neon leaf
#

Last Thing For today; Can I somehow make the map Not be empty when I restart the bot but instead have the previous Keys?

boreal iron
#

Yeah having a database to save the data in and load it on a startup initiating your maps and set the data

neon leaf
#

Cant I somehow let the map write to File and load it in Startup?

boreal iron
#

That’s literally the “same” than using a database

#

You should keep in mind apps can crash unexpectedly

neon leaf
#

Well there is no Important Data in there anyway

boreal iron
#

So updating the database anytime you update your map ensures its always up to date

#

Well then it check if the current game (keys) still exists in your map

#

If not respond with a message the game ended unexpectedly

quartz kindle
#

if you want something designed for newbies, check out quickdb

#

if you want a proper database, check out sqlite

#

quickdb uses sqlite behind the scenes, but makes it look similar to a map so its easier to use

boreal iron
#

_or jasondb _

neon leaf
#

Does that also use set, get in the exact Same way? With Arrays possible n stuff?

lyric mountain
#

kinda

neon leaf
#

Kinda?

lyric mountain
#

n stuff is the only part that's not possible

#

databases store data, there's no "n stuff"

#

some databases allow storing collections in columns (read: maps and arrays), but it's somewhat frowned upon

#

(not including serialized collections)

wicked pivot
#

how to make 4.5 for example written with emoji like this?

solemn latch
#

have 4 emoji's in a row with full stars, and one with a half star

#

🌟🌟🌟🌟⭐

wicked pivot
#

I found it thank you x)

lyric mountain
#

u can also add 5 star emotes to ur server

#

each star being 25% more filled than the other

glossy bone
#

#credits @grizzled blade 50000

lyric mountain
#

not here

rustic nova
#

mfw I wanted to look into couchdb

check out tinydb for python that is couchdb but local

mfw JSON based and technically stores data in json

#

i have yet to figure out the advantages over Key:value databases

lyric mountain
#

json-based database sounds awful

rustic nova
#

yes

mint mulch
#

tl;dr: if you can get away with an embedded KV store, use that for simplicity

quartz kindle
#

almost everything in a database is a complex multilayered KV thing

brittle lantern
#

Hey, so i’m extremely new to ts. But is it possible for me to develop a bot on mobile or will i need to be on a laptop or desk top?

quartz kindle
#

possible yes

dry imp
#

its possible in mobile

quartz kindle
#

recommended no

dry imp
#

recommended yes trollbutbetter

quartz kindle
#

ill recommend you to them

brittle lantern
#

Oh

wheat mesa
#

Developing things on mobile is a truly terrible experience, but it is possible

brittle lantern
#

Oooohhh….

#

nevermind then

lyric mountain
sudden geyser
#

graph databases reign supreme

neat ingot
#

anyone know if its possible to define routes in next.js similar to how routes are defined using express.js? ie: someroute/:optionalparam

mint mulch
#

SQL is in its own league with it’s own problems

blissful remnant
#

Has anyone been able to get a rejection from the Discord official verification service and then fix it?
They just rejected us, they're in a similar situation, and I'd love to hear their experiences if anyone can be verified.

surreal sage
#

2 Node Processes, Running on the same port (e.g :80) but 1 domain goes to the first process and the second to the other

#

How to?

#

Or, how to work on different ports and make the requests still be on port 80

spark flint
#

Use NGINX as a reverse proxy, assign each node process a different port and proxy the requests

surreal sage
#

Time to Google NERD

#

Seeing stuff for html etc but not processes

spark flint
#
sudo apt-get install nginx```

cd /etc/nginx/sites-enabled
nano yourdomain.tld```
write:

server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.tld www.yourdomain.tld;

    location / {
        proxy_pass http://127.0.0.1:PORT/;
    }
}```

then

sudo service nginx restart```

#

there

spark flint
#

I presume you're using Cloudflare?

surreal sage
#

Yeah

spark flint
#

alright, what SSL level are you on?

surreal sage
#

Transform is more for headers

spark flint
#

ah

surreal sage
#

Second from top to bottom I believe

spark flint
#

for Cloudflare, use Flexible

#

yea

surreal sage
#

Yeah

#

Full likes to break sometimes

spark flint
#

otherwise it would return error, if you want to increase to full make sure to setup SSL cert

surreal sage
#

I don't even have anything related to auth anyway

#

Awesome, thanks for helpin' out

#

At school rn so gon take a hour of 2 til home

spark flint
#
sudo apt install certbot python3-certbot-nginx```
if using ufw do:

sudo ufw allow 'Nginx Full'
sudo ufw delete allow 'Nginx HTTP' finally
sudo certbot --nginx -d yourdomain.tld -d www.yourdomain.tld```

#

thats how to use SSL

surreal sage
#

This stuff should be pinned tbh

spark flint
surreal sage
#

Thanks 😄

rustic nova
#

mfw I don't bother with certbot and just use Cloudflare

surreal sage
rustic nova
#

it uses the port 80

surreal sage
#

Or does it just steal the port you enabled

rustic nova
#

443 for the HTTPS certificate

#

also fyi if you're using SSL, then make sure to firewall 443 too

spark flint
surreal sage
#

Would I e.g have to change my process with port 80 to smthn else?

rustic nova
spark flint
surreal sage
rustic nova
#

very dangerous bub_pog

spark flint
#

i love how SSL certs can be watched

rustic nova
#

HTTP is port 80, SSL is port 443

surreal sage
#

"hey bozo, your cert expired"

spark flint
#

aka singapore2818 and 1334 was renewed today

surreal sage
#

hmmm

pale vessel
spark flint
#

so close to 1337 sobby

surreal sage
pale vessel
surreal sage
#

problemos

#

Why is this server not partnered or verified lol

spark flint
#

tbh theres not much benefit for verified apart from the badge

rustic nova
spark flint
rustic nova
#

ohhhh

spark flint
#

I just have an SSL monitor

surreal sage
#

downtime monitor is good

spark flint
#

checking for possible scam domains to get them Discord flagged before they can be spread

rustic nova
#

ye, just didn't know why discord used these domains

surreal sage
#

"hey bozo ur site is down"

spark flint
#

ah

surreal sage
#

I totally didn't use vue's default page for my "portfolio"

spark flint
#

lol

eternal osprey
#

hey in c++, how would i do this:

surreal sage
eternal osprey
#
Design and implement the function void inclusion (double eps, double v) that approximates √
v
through a sequence of pairs of values (a0, b0),(a1, b1), . . . ,(an, bn) having the property:
ai
· ai ≤ v and bi
· bi ≥ v
The value of a0 is 0. The value of b0 is the maximum of v and 1. If a0 happens to be the square root
of v (that is, a0 · a0 = v), then you are done (and a0 is the result). If b0 happens to be the square root
of v (that is, b0 · b0 = v), then you are done (and b0 is the result). In these cases, print the message:
Inclusion square root of v is (with the value of v) followed by the value of the variable carrying the result.
Otherwise, you iterate over i. In iteration i, the average of the values ai and bi
is xi = (ai + bi)/2. If xi
satisfies the halting-criterion (that is, |xi
· xi − v| ≤ ϵ), then you are done (and xi
is the result). Otherwise,
you continue with:
(ai+1, bi+1) = (
(xi
, bi) if xi
· xi < v
(ai
, xi) otherwise
When you find a solution for xi
, print the message: Inclusion square root of v is xn for epsilon ϵ (with
the values of v, xn, and ϵ)
```okay so basically i want no code spoonfeed. I just need to know what the fuck they try to make me do here XD
rustic nova
#

sounds like some sort of code interview question

eternal osprey
#

nah it's for my uni. And i need a bit of help to just understand the steps to undertake, no code feeds or something

#

Right now i have got this: ```c++
double i = 0.0;
double j = 0.0;
double x = (i + j) / 2.0;

do{
i++;
j++;
cout << i << endl;
x = (i + j) / 2.0;
cout << (abs(x*x - v)) << endl;
cout << (x) << endl;
cout << v << endl;

}
while(((abs(x*x - v)) <= epsilon));

#

but this doesn't make sense as epsilon is always smaller than the rest. So this means that i am interpreting the question wrong, but my mind just can't wrap around it

surreal sage
neon leaf
#

whats the best way to make a js function to tell me the row and position in the row for a button? the one used for doing button edits without buttonbuilder, aka interaction.message.components[therow].components[thebutton].data.disabled

surreal sage
#

ig forEach and add each of them to a json you can navigate thru

surreal sage
#

filler indeed

#

Oh I know nvm lol

spark flint
surreal sage
#

Yeah fixed that

#

How do I get the original hostname?

spark flint
#

Ah ok

#

Wdym

surreal sage
#

req.headers.host, is just 127.0.0.1:81

#

referer

#

ah

#

nvm

#

req.headers.host = req.headers["x-forwarded-host"]; ThumbsUp

#

proxy_set_header X-Forwarded-Host $host;

surreal sage
neon leaf
lyric mountain
neon leaf
#

i was trying with maths for 5 minutes and gave up lol

lyric mountain
#

row = floor(button / maxColumns)
column = button % maxColumns

#

Next time try for 10 minutes

lyric mountain
surreal sage
#

I don't have redirects

lyric mountain
#

not u

surreal sage
lyric mountain
#

headers can be edited at will

surreal sage
#

blank page shrug

lyric mountain
#

the source site can just send fake x-forwarded-host

#

or remove it entirely

surreal sage
#

Do you hear me complain? thinkAboutIt

lyric mountain
#

well, just keep it in mind because your code might crash or be exploited, depending on how ur using it

surreal sage
#

I just have 2 domains pointing to it

#

It's a switch (host) {}

#

Nothin' much

lyric mountain
#

what if someone tries to access it externally?

surreal sage
#

Access what?

lyric mountain
#

your endpoint

surreal sage
#

How would they accomplish that lol

lyric mountain
#

isn't it public?

surreal sage
#

My site is

#

My code ain't

lyric mountain
#

your site calls your code right?

surreal sage
#

No

#

It's just a page

#

e.g portfolio

#

Well yes

#

It can't access any data

#

It's hard coded

#

url ... replies with ...

lyric mountain
#

nvm then

surreal sage
#

:p

manic crane
#

is there a discord interaction ratelimit?

surreal sage
manic crane
#

then

#

the interaction failed

surreal sage
#

Are you talking user or server end?

manic crane
#

user

surreal sage
#

Probably a fault on Discord's end

manic crane
#

so

#

the bot is fine?

surreal sage
#

You'd get an error

manic crane
#

i didn't

#

TypeError: Cannot read properties of undefined (reading '0') maybe this?

surreal sage
lyric mountain
#

that error alone doesn't make much sense

lament rock
lyric mountain
#

js uses the same error for variable.prop and variable[0]?

#

well, stopping to think, it'd be the same as doing variable.0 (not valid code) since js uses maps for arrays too

wheat mesa
#

Yeah properties are keys

#

array["length"] is valid and does exactly what you would expect it to

lyric mountain
#

just js things ig

#

yay, it works

surreal sage
#

Tryin' to make a proxy
Don't you dare comment on how I'm making it Gun

As test I'm trying to send a message on Discord using Postman

The headers are modified and the url is fetched from the params

app.post("/*", (req, res) => {
    let url = req.query["url"] ?? null;
    if (!validURL(url)) return res.end("invalid_url");
    delete req.headers["host"];
    delete req.headers["x-forwarded-for"];
    delete req.headers["x-forwarded-host"];
    delete req.headers["x-forwarded-proto"];
    delete req.headers["cf-ray"];
    delete req.headers["cf-connecting-ip"];
    delete req.headers["cdn-loop"];
    delete req.headers["cf-visitor"];
    delete req.headers["cf-ipcountry"];
    axios({
        method: "POST",
        url: url,
        data: req.body,
        headers: req.headers,
    })
        .then((response) => {
            res.end(response.data);
        })
        .catch((err) => {
            if (err.response && err.response.data) {
                res.end(err.response.data);
            } else {
                console.error(err);
                res.end("proxy_error");
            }
        });
});```

But after sending this, Discord replies with a ECONNRESET
viral swift
#

It shows this: (image) on my server i made when i make a request,
this is my current server: ```js
const http = require("http");
const { logInfo, logError } = require("../util/commands/log");

const server = http.createServer((req, res) => {
res.setHeader("Content-Type", "application/json");

if (req.method !== "POST" || req.url !== "/user") {
res.statusCode = 405;
return;
}

let body = "";

req.on("data", (data) => {
body += data;
});

req.on("end", () => {
let parsed;

try {
  parsed = JSON.parse(body);
} catch (e) {
  res.statusCode = 400;
  res.end('{"error":"CANNOT_PARSE"}');
}

res.end(
  JSON.stringify({
    error: false,
    username: parsed.username,
  })
);

});
});

server.listen(3000, () => {
logInfo("Server", "Connected");
});

surreal sage
#

Looks like an express error to me

#

But you aren't using express

#

You sure you are using e.g "127.0.0.1:3000"?

lament rock
#

Your code "works" fine for if you were to submit a GET request

lyric mountain
#

ah true

quartz kindle
#

to get or not to get, that is the question

spark flint
#

om nom nom

eternal osprey
#

is someone good with the terms safety, anonymity , privacy?

lament rock
#

some of the status codes are whack

viral swift
# surreal sage Looks like an express error to me

I've only made my server with http

const port = 4000;
const express = require('express');
const { Webhook } = require(`@top-gg/sdk`);
const app = express()
const webhook = new Webhook('YourAuthToken')

app.post('/dbl', webhook.listener(vote => {

  if (!vote) return false;

  if (!vote.user) return false;

  console.log(`${vote.user} has voted`)
    .catch(console.log);

}));

app.listen(port, () => {
  console.log(`Webhook server online at ${port}`)
});

When i do Sent Test from top.gg that error shows

lyric mountain
viral swift
surreal sage
#

Send us an image of how you're trying to access

surreal sage
#

Full screen browser screenshot

lyric mountain
viral swift
lyric mountain
#

...you're both missing the entire point

lyric mountain
#

he's trying to access a POST endpoint using the browser

#

the error would be if it didn't error

surreal sage
#

Ah I see it now yeah lol

viral swift
#

Oh wait this time when i did send test it shows this error on console and server

lyric mountain
#

yes, NOW you have an actual error

#

you're trying to get the username from the response, but it doesn't exist

#

print what vote is returning

viral swift
#

Ohk

#

Idk why is it spamming this now

#

It's showing this on top.gg when i send test

viral swift
lyric mountain