#development
1 messages · Page 48 of 1
ye
u cant
unless ur not deferring before executing the command
like, either reply OR defer
In the name of fuck… that fucking code bin site trims down to my mobile screen size
it's not only on mobile tho
lol
what do I use then?
normal send()
but I cant say much without looking at the code
your link is dead, results in a white screen
^
TypeError: interaction.send is not a function```
.channel first
send() is a method available on messages or channels
And it’s not a proper interaction response
Without responding accordingly your interaction will fail
available on messages
djs hassend()on messages?
he's deferring
which is why he cant use reply for the response
Err badly written, it’s reply then
im not, actually
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
that errors out
Or you will have to make sure your bot has the permission to send messages
^
followUp
You need to defer the interaction before replying when you can’t respond within 3s
Also You can reply only once
I wouldn't trust fetch to return anything in time
actually, same for any api calls
If you want to send an additional message, you use followUp() as waffle mentioned
currently, I just wanna send a message if the bot is missing a permission
Then respond using return interaction.reply()
Defer, reply, followup (optional)
and Im confused because that exact thing dont work
That’s the chain of events
everywhere else it does
The permission check is sync and doesn’t require any awaiting
I don't see any second reply btw, might be something outside of ur command
like a *gasp* "please wait" message
Show me how you check the permissions and how you respond if they are missing please
Lemme get to my pc
Mobile sucks hard
nop, lemme send you the bot.js; https://github.com/rotvproHD/0xBOT/blob/beta/bot.js
btw, use a loop
ah, I think i know, its this https://github.com/rotvproHD/0xBOT/blob/beta/bot.js#L197
setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages)
Are you sure ManageMessages is needed to do timeouts?
ManageMessages is what the user needs
which I didnt change from the clear command yet
I don't see anything at all
yeah
^ ?
like, I cant understand the code I mean
you could cut the length of it by like 70% by using handlers and loops
the main file was like 1000 lines before i did that global.*** = require thing
The thing is your command handler also has no permission check
index should really only have 2 things: the bot client and handlers instantiation
we are in bot.js right now doe, index.js is also a file I have with sharding
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
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
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
btw, its ModerateMembers
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
btw, do you know the bot permission needed to do const messages = channel.messages.fetch()?
yeah, Ill edit that now that I know how to check for the perm
I would guess it's ReadMessageHistory
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
hmm, it passes the check but still errors no permission to fetch the channel
well fetching the channel is a different permission
for some reason it actually sometimes still contained <@ and >, (not the user.id, but user)
There's is a reason why it does that
which?
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
do you know which?
ye
nvm, had typed an additional letter by accident
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
I think im too stupid to find the perm on discord though
isnt this it?
if yes, it doesnt work
member overrides > channel perms > role perms > everyone perms
read > as overrides
waffle
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
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
what the fuck you're talking about jesse?
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)
might be just an api loophole
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)
help, fake is having a catharsis
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
wat
probably removed fake from your friend list?!
no?
didnt touch my friend list in ages
you devil
nor changes any prvacy settings
idk cant see you in my friend list anymore
same btw
gotta sent a new request
weird
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
i can spare some time
what kind of protocol is it?
web stuff?
not usb stuff i hope
lmao
fake is having a harsh day today
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
Just wait some days
Till the growth goes down again
ill copy the email, its not a message in the dev portal
its capped at 100
i got in 2.5 days sudden hit of servers
idk how
Bc you need to verify your bot
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
It is allowed to advertise your bot but an unexpected fast growth is as they say inorganic
also is not appealable
advertising no
it is, its just doesnt happen often
listing it is indirectly advertising it
nope its not
a inorganic growth decision is not appealable
you can re-apply after a bit
Still people can find it easier than if you wouldn’t put it on the platform
same
You should also make sure it hasn’t been invited multiple times by the same users
nope check that
well if your application was denied multiple times for that reason, then lol
Which is also a reason for inorganic growth
still unappealable
this 1st deny
then get organic growth by filtering your guilds on dead ones/empty ones, and yeeting guilds owned by the same user
try it
good idea
you're confusing it with suspicious growth, the automated inorganic error doesnt go away with time and doesnt give you an extended server cap
lets say I have a string '1+4/2', whats the best way to get the mathematic result of that? (3) (js)
Omagad
worthy to note, be wary of mathjs
it's a great lib but be careful with some "exploits" that might hang ur bot
its work to use firebase in my bot?!!
yes?
!?
I dont really get your question, any database will work for anything
member is undefined (if you're getting from cache, it's not guaranteed to be there)
but i ise npm i firebase
igot somme errors
what would these be? Or do they not apply for simple evaluation?
then fix those errors
idont now how
https://mathjs.org/docs/expressions/security.html official docs
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
neither do I if you don't give the slightest info
if u want please try install firebase and see
btw, is there any way to translate choices like Descriptions and Names in discord.js v14?
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
wouldn't work for slashes unless u register as guild-local commands
bruh i dont use those so idk

normal bomb 😄
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```
number-1u dont need to do this, simply use<instead of<=arrayMembers[a] == undefinedcan be done with justarrayMembers[a]- you shouldn't use
mapfor 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
i try to do this
it looks like this is to list the total members combined with deferent roles
is that what this is
well, the issue is mostly here
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'.
you're never assigning the new value to text
it seems to work thanks!
it works very well thank you, I made some stupid mistake x)
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
yes, set the nameLocalizations property for choices when registering the command
for descriptions what you're doing is already the right way
thank you!
Ok, so currently im making a button which I dont want to be too complex so I used your, fakes method of disabling buttons; https://hastebin.com/nirogitoku.typescript but it returns a discordapi error
you wanna disable 4 buttons when receiving this interaction?
yuh
which sort of interaction is it, a button interaction?
yuh
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
please assign interaction.message.components[0] to a variable thanks
nope
hmmm no, you're repeating the same thing on all 5 lines (context deleted)
yeah and?
4 extra array accesses?
calling the property is less memory than creating a new var
since yours is just a reference, not more or less
?
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
that's not a matter of liking or not tho, it's good practice
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
that's no excuse not to give advice on how to write better code
yup, works
I'll pass, its more readable to me directly seeing what im editing

bad choice on the long run, but ok
Getting this when trying to connect to redis
currently redis://PASSWORD@localhost:6379
u forgot the user
welp
it didn't like when I had the user either
I just got it working
moved to ioredis
why ur using redis btw?
caching server configs
so it doesn't have to make a DB request everytime someone uses the report/appeal button
working much better already
ain't that better done with an in-memory map?

wdym embedding?
like, putting in a site?
for what content? text, comment, forum, code, etc?
yea
code
vscode web
what am I doing wrong? components[1].components[5] is where it stops working
TIH everything about that code lmao
this is how the buttons are positioned if that helps
man, my previous code was even worse
time to make your current code your new previous code then
my previous code took almost a second to execute 😬
I'm not talking abt speed or running at all, it's just (sorry) ugly
but well, what are those evals doing there?
I didnt find any other way of getting dynamic var names
why do u need dynamic var names?
to store temporary data
that's why maps exist
tell me more 🧐
{
this: 1,
is_a: "map"
}
I dont think I can dynmapically name the this: part, etc though
theMap["prop_name"] = stuff
theMap = {}
mhm, well back to the root problem though
which was...?
^
I need to go through every button and edit it
What are u actually trying to do?
go through every button and edit it
Disabling it again?
no, well yes, in this case but the other things need to be updated too
Ok so message components is an array of components
❤️
well, the entire code is a problem tbh, why are u using while to loop over a 2d array
You just loop that one and edit each item inside
yeah, thats what im trying to do
but it stops working after I reach 5 buttons done
aka 1 row
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
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)
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
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
yeah that seems to be exactly what he wants
updating each button per row individually
maybe all per row, maybe not
hm...but his old code was iterating over every button, editing the value of every one
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
nope, he was evalling to get/create dynamic variables
basically like a map, to store the values of each button
where do you take thatinfo from?
ahh
well its memory, so yeah; everything has different emojis
this should do what u want
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
Hi
ok, so I temporarily still have it with eval and im getting this error Only dictionaries may be used in a ModelType
oh no again... sender.toString.replace
lmao
i just copy pasted, imma remove it later
remove from your entire code anything with replace(/\D/g, '')
god safe the replace all function
already did everywhere except minigames, thats where im at now
try replacing the eval with the definitive structure
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
hard to help when it still has temporary stuff
btw I found out this is how you are supposed to make a map
just log for us what your values for emoji and style are, please
not really, that's the exact same as using {}
just longer
log marker moment
well the issue should be obvious
Only dictionaries may be used in a ModelType
your emoji structure is wrong
for some reason I do, else it jsut errors
put it inside
for (let i = 0; ...)
there's a shorter way to write that, I just dont remember how in js
in the old, working version I just ya know, set that to "emojiid"
in an older djs version?
no, old version of my code
my eyes
lmao talk about unmaintainable code after a couple days

ok well, we had a problem to solve
Hola gente toy doramion
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
you still have to provide a valid structure since the api expects it
ok, i think im just gonna rewrite all of this to work with maps
rn
and then see if it works
button.data.emoji = { id: /* your weird eval code here */ };
of course it does, what du you expect, it's me, mario
I used buttonbuilder before
I don't wanna see the words builders and using here, please
builders and hating or trash is okay
new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),
AHHHHHHHHHHHHHHHHHH
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('primary')
.setLabel('Click me!')
.setStyle(ButtonStyle.Primary),
GO AWAY DEVIL
const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');
Sorry <3
Ban me 🖐️
Jarvis, redesign discord.js builders for the 8th time
NO NO that will not happen, never
people dont have to rework their entire code on djs v15
or v16
or whatever
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
well who tf writes enums in any other case
at least we don't need to rewrite the entire codebase on any minor update
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
I saw that
NO U SAW NOTHING
deep inside you there's a java spark
fucking auto correct shit
take that back

damaging my perfect and innocent php soul
trying to ignore the freedom of android dude
I bet im gonna annoy someone somehow with this
FakE, that's far from innocent my guy
finally you remembered that the user will turn into an ID when being concated in a string
u dont need get
at least some learning progress
use ["name of the key"]
I cant use delete otherwise, dont aks me why
You don't deserve the title Mr. Bae 2 anymore since you made progress
delete memory["name of the key"]
everything is either a primitive or a map in js
actually, I'm not even sure if js has primitives at all
lmao, he's writing
string, number, boolean, undefined, null
waiting for the right moment
string aint a primitive
it is in js
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()
Everything in JavaScript is basically an object internally, except for null and undefined because those are "The Hole"
ok, I got a roadblock, what do I do here? Can I somehow use anything else as kinda an array?
symbol and bigint are also primitives
dafuq
maps can have arrays
why are you using eval
don't look at the context tim
🧐 🧐 🧐
What in God's name
Thought I was the only one who looked at that and went wtf
lmao
Mr Bae 2
all collections can hold any type of value
even other collections
or themselves
Like are you using user IDs as actual variables or something
yuh, dynamic var names for storing game data
you sure this isn't just a map
not for the faint of heart
show more code
im replacing everything with maps rn
uh, so "map"
memory[pcn57566765676] = []
memory[pcn57566765676].push ?
yes
with "" around the key
yeah, lemme try with tthat
it's the same thing for both
You don’t need a map tho
Go with your dynamic obj keys
And wrap them in quotes as said
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
yes that is correct usage
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
how do I push though?
.get().push()
broken dependency
worth a try
that makes 0 sense to me but works
why?
because of the get, well now I get (funi joke) it

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
tim not even checking if the map has this key
anyone knows if i can use localhost redirects on Google's OAuth 2.0
smh
I believe all oauth2's behave the same
so if discord works others will too
idk if u can use localhost on any oauth2's
wtf is this
await eval('memorydatapc' + interaction.user.id + '.push("' + await eval('memorydataf' + sel + sender.toString().replace(/\D/g, '')) + '")')
an eval command
it's just a redirect, to tell the flow where to send the user after authorizing
that is cursed code doing black magix
stay away
how did I make it that unreadable, wtf is memorydatapc again

You wrote the cursed code, you tell us
if you dont know what it does, then dont ask us
people in here can only handle a certain amount of pain
😁
I finally know what it does, its the literal same as pcn but with emojiids instead of buttonids
this is so cursed
have you tried rewriting it
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?
no
only things that return a promise do
although u can await anything, but it'll be no-op
you wanna see something cursed?
no
no
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
I did that too once because batch math is shit
the irony actually is POWERshell in batch
the actual curse here is writing power in caps but not shell
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
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
why is the pass in plaintext
guess why
bae?
a
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
how do I properly make a style
🧐
it isnt tho
or did the button builder make it empty for me
well how to I make an empty label
null or undefined
null still errors
it's a button?
yes
well it requires a label if it ain't a emoji if im not wrong
oh you're missing the emoji name
🧐
-.-
I don't paste the docs for fun
floating point moment
\<a:VENT:1019238968346284084\>
{ id: "1019238968346284084", name: "VENT", animated: true }
how did the button builder grab that automatically
haven't seen it, so...
.setEmoji('1020411843644243998')
.setCustomId('MEMORY-17-' + bet)
.setStyle(ButtonStyle.Secondary),```
btw you know you can use string templating instead of concatenation right?
inb4: "tell me more"
Tim trying again
for example ```js
bot.memory.get(D_EMOJI-${i+l}-${sender})
I know it exists, but its so hard for me to write the `
your keyboard doesnt have it easy?
well, i also press it twice, because on my keyboard its an accent character
à
if i only press it once, it waits until i press another character
yes
so what i do is press twice then arrow-left
:^)

I hope they invent a machine soon makes you breathing…
Coding and breathing is too much
yas, its broken has heck but is showing emojis again
Err wtf
Discord cache being trash again
So each channel has its own cache
Interesting
flaze at morning / flaze at evening

What’s the issue? I don’t get it
that aint memory
@lyric mountain translation please
the memory game isn't behaving like a memory game
like, it doesn't reset after u select a non-match
I showed how to update buttons based on structure, not how to write a memory game
Shameless excuses anywhere
Last Thing For today; Can I somehow make the map Not be empty when I restart the bot but instead have the previous Keys?
Yeah having a database to save the data in and load it on a startup initiating your maps and set the data
Cant I somehow let the map write to File and load it in Startup?
That’s literally the “same” than using a database
You should keep in mind apps can crash unexpectedly
Well there is no Important Data in there anyway
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
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
_or jasondb _
Does that also use set, get in the exact Same way? With Arrays possible n stuff?
kinda
Kinda?
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)
how to make 4.5 for example written with emoji like this?
I found it thank you x)
u can also add 5 star emotes to ur server
each star being 25% more filled than the other
#credits @grizzled blade 50000
not here
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
json-based database sounds awful
yes
it's more-so about what features you need from a database. Every database sucks in its own way. JSON (document) databases typically have better features for searching and accessing nested properties, whereas KV databases generally don't care about the serialized format, simpler to use & implement, but only one entrypoint which is the key
tl;dr: if you can get away with an embedded KV store, use that for simplicity
almost everything in a database is a complex multilayered KV thing
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?
possible yes
its possible in mobile
recommended no
recommended yes 
ill recommend you to them
Oh
Developing things on mobile is a truly terrible experience, but it is possible
JSON (document) databases typically have better features for searching and accessing nested properties
Postgres entered the chat
graph databases reign supreme
anyone know if its possible to define routes in next.js similar to how routes are defined using express.js? ie: someroute/:optionalparam
Postgres has column support for JSON too 😂
SQL is in its own league with it’s own problems
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.
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
Use NGINX as a reverse proxy, assign each node process a different port and proxy the requests
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
Yeah
alright, what SSL level are you on?
Transform is more for headers
ah
Second from top to bottom I believe
otherwise it would return error, if you want to increase to full make sure to setup SSL cert
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
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
👍
This stuff should be pinned tbh

Thanks 😄
mfw I don't bother with certbot and just use Cloudflare
Does it steal all ports once enabled?
it uses the port 80
Or does it just steal the port you enabled
443 for the HTTPS certificate
also fyi if you're using SSL, then make sure to firewall 443 too
same but for Full it requires SSL and most domains are defaulted to Full by cloudflare 
Would I e.g have to change my process with port 80 to smthn else?
also for whatever reason, Cloudflare gave me a Google trust certificate lol

But I don't 😈
very dangerous 
i love how SSL certs can be watched
HTTP is port 80, SSL is port 443
"hey bozo, your cert expired"
aka singapore2818 and 1334 was renewed today
hmmm
No, you change PORT on the config to your process's port
so close to 1337 
I'll just reach out if probs

tbh theres not much benefit for verified apart from the badge
why do these exist
voice and media servers 
ohhhh
I just have an SSL monitor
downtime monitor is good
checking for possible scam domains to get them Discord flagged before they can be spread
ye, just didn't know why discord used these domains
"hey bozo ur site is down"
ah
lol
hey in c++, how would i do this:
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
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
If the port (e.g 25565 minecraft) isn't in the list, would it work still?
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
ig forEach and add each of them to a json you can navigate thru
Is :PORT a filler? or is it a variable of nginx?
filler indeed
Oh I know nvm lol
Yeah don’t put 80 for the proxy pass port
req.headers.host, is just 127.0.0.1:81
referer
ah
nvm
req.headers.host = req.headers["x-forwarded-host"]; 
proxy_set_header X-Forwarded-Host $host;
ah yes, a wonderful loop
const rowget = async (button) => {
let row, btn
if (button < 20) { row = 3; btn = button-15 }
if (button < 15) { row = 2; btn = button-10 }
if (button < 10) { row = 1; btn = button-5 }
if (button < 5) { row = 0; btn = button }
const output = []
output[0] = btn
output[1] = row
return output
}```
Sigh, use math instead of ifs
i was trying with maths for 5 minutes and gave up lol
row = floor(button / maxColumns)
column = button % maxColumns
Next time try for 10 minutes
worthy to note, this is not guaranteed to exist, or be the true source hostname
I don't have redirects
not u

headers can be edited at will
blank page 
Do you hear me complain? 
well, just keep it in mind because your code might crash or be exploited, depending on how ur using it
what if someone tries to access it externally?
Access what?
your endpoint
How would they accomplish that lol
isn't it public?
your site calls your code right?
No
It's just a page
e.g portfolio
Well yes
It can't access any data
It's hard coded
url ... replies with ...
nvm then
:p
is there a discord interaction ratelimit?
What kind?
one guy spammed the interactions
then
the interaction failed
Are you talking user or server end?
user
Probably a fault on Discord's end
You'd get an error

that error alone doesn't make much sense
trying to read element 0 of an Array
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
Yeah properties are keys
array["length"] is valid and does exactly what you would expect it to
Tryin' to make a proxy
Don't you dare comment on how I'm making it 
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
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");
});
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"?
show the url ur trying
if (method !== "POST")…
Cannot GET /
Your code "works" fine for if you were to submit a GET request
ah true
to get or not to get, that is the question
is someone good with the terms safety, anonymity , privacy?
def not allowed
some of the status codes are whack
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
issue is that you're trying to access the endpoint on the browser
Oh, what should I change then?
Send us an image of how you're trying to access
Here's my server
Full screen browser screenshot
nothing, you don't need to access it yourself
A sec
...you're both missing the entire point
he's trying to access a POST endpoint using the browser
the error would be if it didn't error
Ah I see it now yeah lol
Oh wait this time when i did send test it shows this error on console and server
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
I couldn't log it now as I'm getting some error here
Unmute your exceptions


🔫


