#development
1 messages · Page 50 of 1
no error
i am trying if the 247 is disabled
making the bot leave
and if it is enable
d
then it will be in the vc only
let me know if it works :)
it did
i tried like
if (player.twentyFourSeven)
when it didnt work
i went for it
but thx
indent fail
I'm doing something like paint on the web using canvas, but I don't know how to make an eraser
I can erase normally, but I need to keep the background fixed and have things added to it erased.
when i do eraser it erases everything along with the background
I can make a line with the same color as the background, but it would not be good as a picture can be added to the background.
As you can see in Attach-1, it deletes it together with the background (dark gray oval shape) and I don't want it. (The part that I have enclosed in a dark blue line is the image that appears when I delete it.)
I want it to be; just removing the white lines and not the background.
I thought about redrawing the background and putting it on the bottom layer after each eraser use, but that's a very bad idea. đ
put the background in another canvas under the main canvas
or just make the background in css
No matter what I do, it creates a new line for me. How can I make it disappear when I convert it to canvas?
the black part is the part I use eraser
i can make it equal to the background color but it will be distorted when a different image is put
globalCompositeOperation
destination-out
There are many ways to implement free drawing tools in Konva. I see two most common and simple ways: Konva-based vector graphics (simple) Manual drawing into 2d canvas (advanced) Free drawing with K
how did you make the gray background?
I can clip where the black lines overlap the white lines but that would be very inefficient
css
Before you said it, I made a box like on canvas and had the edges oval.
this is just the web part
I don't know how to delete the white lines (while sending discord)
in node-canvas
afaik destination-out should be working, i dont know why its painting black instead
try with clearRect to see if it still paints black
it output black on node-canvas because color code is set to rgba(0,0,0,1.0)
There is no problem in the website part of what I am doing, only the node-canvas shows the parts I deleted in black because it's color set to rgba(0,0,0,1.0)
so when black and white overlap, i have to crop
sorry for my bad english
so the problem is only in node, not in browser?
yes
then its possibly an issue with node-canvas
check if you're on latest version
try to make a very simple/minimal test case to confirm its a bug
How can I crop when black lines and white lines overlap in node-canvas?
node-canvas should work exactly the same as browser canvas
if something is different, then its a bug
and should be reported to the devs
so try making a very basic test to confirm
actually not so wrong
When I use an eraser on the web, it creates a line in the places I delete and deletes it that way.
I have to color this line too but when it comes to the node-canvas side, it makes a difference because it uses this color while drawing the line.
I hope I was able to explain
each line has points and color
this is the line color created when using the eraser
Can anyone help me with PRESENCE INTENT?
What about the presence intent do you need help with?
I applied two times but it declined
My bot one of main command needed it
If you got declined it probably means you do not need it. Why exactly do you think you need it?
Yeah
I do not think that is a reasonable use-case for Discord to give you access to the intent
What exactly was the decline reason though? It might've been something else than just the command use case
What did they tell you when they declined the request?
I'm pretty sure such a command does not go in valid use-cases, at least in the past - maybe got changed
They do not give access to the intent to let a bot show how many members are online, because of one command needing it
I kinda had a similar use case back then but got approved for it
Yep, the command is not a valid use-case
Yeah
Yeah I suppose that use case no longer meets the criteria, it used to
what i have to do is trim all the lines touching the line whose color is equal to rgba(0,0,0,1.0)
Can you suggest me more commands in use of PRESENCE INTENT
Any ideas on how I can do it?
I do not have such commands in mind
Imo, you shouldn't be making features to get intents.

You should get intents when you need them, not just to get them.
Anyone have ?
In the future many users won't invite bots with some intents.
For example, I won't invite bots with the message intent, unless it's absolutely needed for the feature I want.
By just adding features with the goal of getting intents you're limiting your user base.
I got message intent
Hmm
So yeah, your bot I wouldn't invite into a server I own.
đ„Čđ
Thanks for clarification and time...
Do we see which intent the bot has access to when inviting it? Or only after having it invited
Other than that

Only after iirc.
I dont know if that will change, but discord said it would over a year ago.

Well it's also very vague that
The bot I'm trying to invite has access to the message content intent
I don't see how it cannot read my messages
Yikes đ
Probably means it cannot read your (private) messages
You add it to a server, not to your DMs
Iâm aware yes but still
Specify that it means your private messages then
there are white lines behind the black lines i want to clip where the black lines and white lines overlap do you have any idea how i can do it?
Because it can read my messages (sent to the server the bot is being added to)
unfortunately i can't make it same as background color because background image may change
String e.g "5k" (number suffix, k = thousand) to a solved integer
.replace("k", "000")

I would probably do something like
Make a map of all the suffixes and their multipliers, i.e "k" => 1000
Advance one character in the string at a time until you encounter something that is not a number anymore
Parse the number from the start of the string to the character before the letter
"get" the multiplier from the map with the letter at the end of the string
Multiply the parsed number with the multiplier
This would also work, depending on what the test cases require, just remember to parse the number afterwards
Doesn't sound bad
I tried this and got an unexpected token error "<"


please don't take that seriously
the haha funny was the kekws are formatted like <:name:id>
aahhhh đđ
any ideas on how i can do it
what are rss.xml
DiscordAPIError[10062]: Unknown interaction
at SequentialHandler.runRequest (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:293:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:99:14)
at async REST.request (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\REST.cjs:52:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\rudei\Assia\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:68:5)
at async Object.run (C:\Users\rudei\Assia\src\slashCommands\Music\play.js:24:5)
at async Object.run (C:\Users\rudei\Assia\src\events\Client\interactionCreate.js:88:17) {
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1023653625580503140/aW50ZXJhY3Rpb246MTAyMzY1MzYyNTU4MDUwMzE0MDpmakhJTHFkb1FRbkdKdDVWN2lLU0R6Q2VsZzNPSGhKVGF0dVluMGZTbHFYRnBBcXpHdUF3c3NleHNjTW1UaVpCZUhGZDhCSzRHYXd0RFB3ZXdZdk1lbzZ0VHpqczFjbDlpcnMyTGRZRmlNTXFKejRzODZqV0Y1NFp4d1ZVQjQ2Sw/callback',
requestBody: { files: undefined, json: { type: 5, data: [Object] } }
}
``` Don't really know whats causing the error.
nothing wrong with the code.
Unknown interaction
You are probably deleting the interaction when the command is executed
To use:
commandsToArray(client.commands)
// Ouput
[
{ name: '/slashcommand', description: 'This is a slash command' },
{ name: '/slash command', description: 'This is a sub slash command' },
{ name: '/slash group command', description: 'This is a sub command group slash command' }
]
here u guys go
if you want
converts all your commands to that output
@lyric mountain i figured it out :D
ah, cool
You never replied in the first place
Ah wait seems like djs doesnât require you to do .reply if you already deferred
so
I think it'll even error due to double-ack
await interaction.deferReply({
First off, delete the extra comma after interaction
Second, send line 88 of interactionCreate.js
player.play();
return await interaction.editReply({ embeds: [searchresult] });
Line 88, 89.
Of interactionCreate.js, not play.js
await command.run(client, interaction, prefix);
} catch (error) {
if (interaction.replied) {
await interaction.editReply({
content: `An unexcepted error occured.`
}).catch(() => { });
} else {
await interaction.reply({
ephemeral: true,
content: `An unexcepted error occured.`
}).catch(() => { });
}
console.error(error);
};
and what comma do you want me to delete?
The one after interaction in the run function
Or, put an underscore after it, either one works
I would prefer an underscore personally since it would match the amount of function arguments youâre passing it, but I donât know if js fucks up with that or not
run: async (client, interaction_) => {
Then try running it, you might get the same error but generally speaking javascript gets kinda weird when you donât pass the right amount of arguments to a function
DiscordAPIError[40060]: Interaction has already been acknowledged.
at SequentialHandler.runRequest (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:293:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:99:14)
at async REST.request (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\REST.cjs:52:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\rudei\Assia\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:68:5)
at async Object.run (C:\Users\rudei\Assia\src\slashCommands\Music\play.js:24:5)
at async Object.run (C:\Users\rudei\Assia\src\events\Client\interactionCreate.js:88:17) {
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1023662634026942494/aW50ZXJhY3Rpb246MTAyMzY2MjYzNDAyNjk0MjQ5NDpTeFFFMFAzUUY5ejdJT1RhS2x2UTJlRWhWc1JxQ0ZKcXlVZXRHUEdUbVAycEtKeDI4eVJVb1FSV1BabWRURFlGa0FUS2FlWVVrbFlJWDNiaXNkWDl2S1JEZThLOEVWTUdVTTIyaHU2NFVBdVJkQ0xEOFBPdlBCcGdkR2dMRkZRZQ/callback',
requestBody: { files: undefined, json: { type: 5, data: [Object] } }
}
Youâve already replied to an interaction and youâre trying to reply to it again
Iâm assuming youâve done something in your interaction handler that responds to it already and youâre trying to respond again
DiscordAPIError[10062]: Unknown interaction
at SequentialHandler.runRequest (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:293:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:99:14)
at async REST.request (C:\Users\rudei\Assia\node_modules\@discordjs\rest\dist\lib\REST.cjs:52:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\rudei\Assia\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:68:5)
at async Object.run (C:\Users\rudei\Assia\src\slashCommands\Music\play.js:24:5)
at async Object.run (C:\Users\rudei\Assia\src\events\Client\interactionCreate.js:88:17) {
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1023663273402441759/aW50ZXJhY3Rpb246MTAyMzY2MzI3MzQwMjQ0MTc1OTo3YVJBOE1mcVh3SW05RGFwWmFoOTNQU3JSdk5rVGNmalpmUHRIQ1NzMHVJcnVqTVdIT1R3YzJieHFQNjVibmZHMGpBNUZLd3JUOG9SYlV0QzVKdmlQYVhPb0pHNDlVT0MwR0c1cWJ0WnpjMlFyR1hqd3dBWGZpeEwxQTUza01BMQ/callback',
requestBody: { files: undefined, json: { type: 5, data: [Object] } }
}
I donât know what to tell you, I canât help you without more code from your interaction handler
Itâs odd that youâre getting a 404 here so Iâm assuming something is severely wrong
this isn't enough, you don't only need to check if an interaction is replied, you have to check if it's deferred, too
deferring itself isn't a reply
can someone tell me if i can get in trouble for this?
will JS ever have opportunistic in-place mutation optimization or tail call optimization?
Tail call optimization is a pretty basic optimization for an engine like V8
I would assume it already has it
Voltrex said it was too tricky awhile back
i think it requires removing a lot of current language features
there's a new programming language being built called rok that has some of those features
yk that'll reach the character limit pretty quickly right?
yeah i forgot py in activity.name
i think the auto mod stuff that discord does auto blocks messages with more than 6 mentions in some cases
If youâre making a system like that I would put like @SoAndSo and 500 others got 50 points for having âcertain wordsâ in their status!
It says what they had in their status
Itâs just an example
This seems fantastically redundant
?
Youâre checking the same conditions twice
I donât think thatâs relevant to what I was saying
ye, the if before reaching the if chain does the check already
i tbh donât know how it works so yeah
Also my god I hate python with all their native functions đ
isinstance(thing, Type)
wait until u discover they dont have switch
What an awful syntax
we kinda modified parts of it so it can interact with our panel
it uses pterodactyl api
Man python is so ugly you cannot change my mind
it's a turing-complete yaml
it really is
I understand the appeal to a syntax like that but at the same time itâs done so horrifically
elif :O
Hopefully @scenic kelp can design a pythonic language that doesnât suck
(And also isnât slow đ„ș)
i seriously need to pay attention more
Wdym
i have the worst attention span so i really need to pay attention more
Take medicine for it if itâs diagnosable/diagnosed
I do đ
Although Iâve heard bad things about ADHD medicine and how it just turns you into a zombie
it does
Most of it is adderall so I can see why
i have it and it is a lot different for me but itâs also harder with my tourettes so yeah
issue with adhd is mostly from adrenaline that has nowhere to go
so u cant focus on anything for too long
nope
adderall is an amphetamine
I donât have adhd thankfully, that would be a pain in the ass combined with all my other conditions lmao
and thatâs why i always have my iPad with me
No itâs an amphetamine
btw TW, yall use what ide (or editor)
we use our own hosting
it's the stuff they gave german soldiers during ww2
editor, not host
idk then
iirc jetbrains ides would've told u pretty quickly that the if clause is redundant
we use what came with pterodactyl
oh integrated editor then
yeah
Ouch
I'd suggest making a repo and doing changes locally
it's not only safer but also more reliable
i canât really make site changes or anything i only have access to the admin/developer panel
mongodb is kind of slowing down my nextjs app
u don't code?
would self hosted mongodb make things better
i do i handle mobile app development
but this is what i have access to
mongodb is an expensive database, but easy to use. might want to migrate to a different database to save moeny
I'm quite confused on your team structure, but ok
or buy expensive hosting for mongodb
would self hosting it make it expensive?
yeah i am to actually
and would postgress be a good option
Postgres is an excellent choice for self hosting
yeah, that'll be cheaper
Super fast and lightweight
i've used mongodb like the entire time
i always wanted to try postgress but i never did
đ
this took forever @lyric mountain
aws will give you free DynamoDB tables if you want a hosted db
this is what i lead in development
Mongo has a much lighter learning curve but itâs worth it to learn postgres
i would go for galaxy gate
i have a filter on bc i have an eye issue
eitherway it's good to keep it on
itâs just an issue with my eyes they are sensitive
me too, but shouldn't it be red?
like, warm colors
Warm is usually yellowish orange
important is that it gets rid of blue lights
I never understood the blue light thing
basically our eye is very sensitive to blue lights
the opposite actually
Is that scientifically proven or is that just some sketchy internet research
eye has very little photoreceptors for color blue
no
yes, the eye has little sensitivity to color blue, that's why it's bad to have blue lights on screen
ima update the status code quickly
because your eye doesn't feel how much light it's actually receiving
so it strains the entire organ
but that filter is kinda weird since the yellow is way too bright, adding more light to the screen
there we go updated the code
how no? the fact the text has bloom shows that
unless the screen brightness is set to maximum
filters should subtract, not add
this is how i set my screen
then it's indeed weird
it helps a lot with my headaches
yeah, it's better than pure white
is that for a single server or many?
single
then it's fine
ok it just uses the api to check if the servers are online
the issue with periodic actions is mostly quantity, instead of frequency
as long as it's only for a single server, you'll be fine
i can tell it delays by 4-5 seconds
Tbh I wouldnât be editing the message every 60 seconds unless there is a change in the status of the servers
that too
Just check the status every 60 seconds and only edit it if it changes from what it was 60 seconds ago
it checks the nodes to see if they are online and then sends back its status to the embed with the information for it
My point still stands
check if the current embed is exactly the same as the to-be-sent embed
yeah i canât argue with that @wheat mesa
if it is, don't continue
Since youâre displaying RAM on there for some reason, itâll probably update every 60 seconds anyways since I doubt that the ram usage isnât gonna change each minute
I don't think that's readable
i am using opensearch/elasticsearch for my bot. it's used when people host a game lobby and other people search for the lobby. i'm trying to think of the cheapest way to replicate this functionality without using opensearch which is costing me $50 a month for the cheapest instance type. My idea is to create a DynamoDB table and store info about the hosted games in there sorted by timestamp. Then when someone searches for a game lobby I'd pull 1MB or less of the latest records from the DynamoDB table into memory and then use something like fusejs.io to fuzzy search that data for a lobby that matches. Then i'd show the 1st page of search results and an option to paginate the search through the next 1MB of records
yeah itâs not
it just uses application/json and gets the info
can't u use postgres and its built-in fuzzy?
I had a feeling the code was gonna be questionable but this is just⊠interesting
perhaps, i've never played with it
lol
i will check it out
just a weird system
basically map no?
return nodes = d
it's inside a forEach, so it'll just ignore the next line
wont quit the loop at all
Ik, but itâs very questionable as to what it actually does by glancing at it
Since nodes = d is a statement and not an expression that evaluates to anything
it'll return the value of nodes post-assignment
Something like nodes = d; return; would be less ambiguous
Itâs js
i do both
Also you could just avoid that if statement altogether by doing let nodes = list[0] assuming list always has a value
sometimes I do things like that to bypass stupid flutter design choices
child: aVariable = Container(...)
Iâm also like 88% sure that list isnât declared anywhere in that code
Itâs probably cut off though
hello

what the hell why is it under maintenance
I haven't been here ever since my HDD failed đ€
but
I am proud to say
my new PC is coming this week
i just noticed i spelt maintenance wrong
the hdd didn't fail, it was plain murder
đ
hoping to resume work on the game soon too
no, sorry
I feel that, thought I could spend some time testing a new graphics card at weekend but turns out, amazon sent the wrong cable
oof thank god you didn't fry your gc
using wrong cables can suck sometimes
heard a guy fried his motherboard by using a prewired cable with his power supply
8 pin connector won't fit into a 12 pin slot
thought it would apply to your gc as well
well that's different
heard of this guy that fried his HDD by fucking around with regedit to play GTA 5 on his unsupported hardware, funniest shit Iâve ever seen
those cards are fucking huge
you know that wasn't the actual reason đ€
god thanks i decided to buy a big tower many years ago
oof that reminded me
there are white lines behind the black lines i want to clip where the black lines and white lines overlap do you have any idea how i can do it?
I bought the PC with a large glass panel case
I got sum stick on rgb lights to make it look cool
"overlap"?
u mean where they encounter eachother?
rgb nonsense... meh
if so, you'll need to do some pixel-level processing
I mean it may not make it run better but you gotta agree RGB does look cool
thing is under my desk in a corner but still any fucking components must have rgbs today
smh
and edge detection
also have to replace the stock fans with some rgb ones đ
Look at that beast
đđł
yeah, replace fans with silent fans not rgb bullshit
true
how about silent rgb fans
đ
for a split second I thought it was an old diskette rack
that tiny amount of light won't release enough heat to matter
lmao
even bigger than a diskette rack
:P
"Did you not know that RGB = more FPS? You pleb!"
true
đ
This is going to be a very odd question but: Should I teach my gf javascript because I think it would help her understand mathematical functions better
Absolutely
yes
no
teach her LaTeX if u want to grasp math
I think functions from programming languages are very very very helpful with illustrating how actual math functions work
plus u can joke that ur gf uses latex
it helped me understand < > +
if she doesn't know how to do that
then yes
yes
I think people get confused with function syntax like f(x) = x^2
They donât realize that f(x) is actually taking x as an argument
edge detection it is then
Just see it as y = x^2
y ^= 2
đ€š
oh yeah custom emojis work
duck operator is always right
The cat operator
message from 3 days ago
"cat operator" must be a new thing
And also giraffe operator
it updates the message from the one it posted once it canât edit it anymore it makes a new message
bulking sucks đ
I have to
just to get back to the topic, why did you order a new pc instead of replacing your hdd?
you're not skinny, you're material design
I was once required to drink multiple protein shakes a day due to being underweight
Granted that stems from other medical problems in the first place
I wanted a new one anyway so that gave me excuse to get a new PC
my i3 was killing the whole setup
Meanwhile me with an Intel Pentium
lol
I take so many supplements now
I cannot gain mass, it's a mystery why because I eat a lot
still better than my first amd triple core man
i mean it's great i can't Gain mass
I canât gain weight and itâs bad
creatine, BAAs and BCAAs, whey protein, weight gainers, instant EAAs
rn I eat 3,200 calories daily
HOLY
I mean, I like being slim but...my minimum mass threshold could be like 20% higher
mass-development
mini [you know the rest]
fitness wut? aren't u all just fat 50yo men sitting in a dark room?
Nah FakE that's just you

who said i was in a dark room
Although you got a special thing, you drive 24/7
not yet
oh yeah we need to be sane
đ
I used to think mph was meters per hour

lmaođ©
Meph
meth per hour?
^^
m/ps
meth per second đ¶
Cocainer
meth is what u need to survive rough days in here
Heisenberg must be living in your area then
actually live not far away of a border to a different country which is known to produce and sell that shit here anywhere
mexico?
lol
brasil?
nono, brasil is cocaine
oh yea
The people here look like theyâre named Heisenburger bro
then what is italy?
italy? mafia
turkey?
Nein
panzerfaust
germany đ
Heisenburrito
yikes
ja ja ja
nein nein
ja ja ja
ha ha ha
What if we kissed in the Breaking Burrito van? đ„¶
you got it
o em gee đłđłđ±
perfect date đłâș
So true đ€
Oh shit, not the FBI at my door /s
dark mode with hints of vanilla
One message removed from a suspended account.
yeah ugly as fuck for real
Apparently it's either for accessibility of some kind or for the customizable profiles for them to "stand out"
probably because there're role names that extend one or multiple lines
One message removed from a suspended account.
selfbot detected
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
if your design:
- looks like shit
- feels like shit
- stinks like shit
that's not your design, that's discord
Jokingly because you sent the same thing twice I suppose
let's try if shes a bot
One message removed from a suspended account.
One message removed from a suspended account.
quotes don't seem to trigger it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
flying 
I thought I could do it with the canvas clip() method
because this is canvas
things aren't THAT easy
clip only cuts the canvas in the shape u defined
u still need a shape
always knew 1 = 2
0.999... = 1
tf is that quality
One message removed from a suspended account.
One message removed from a suspended account.
iâm trying to make it redirect to the page but it wonât work
One message removed from a suspended account.
just do location.href
remove the window.
I fixed it
đ
i forgot to add it to the config
well yeah this took forever again
so many buttons
@oak cliff Sorry For Ping Please Help Me đ
I need help
đ„č
I somehow managed to post my bot's stats to all bot listing sites and a special stat service first try just by reading cursed docs and shitty implementation code
I've been kinda lacking for almost a year when it comes to providing sites with accurate stats, but it's been a lot of work to significantly reduce memory usage from 200-600+MB avg to 120MB avg
You can kinda see my bot's growth here:
https://amanda.moe/to/stats
key highlights are obvious from when I used discord.js to when I modded discord.js to a raw api + slash commands rewrite.
Nothing too popular, but decent for a no named music bot I guess.
Need some help on this, my bot was rejected because it triggers the "no manage_role permission" condition even after the permission was granted. I check through the coding flow and am very sure the workflow is fine and it was a legit trigger. Im confused on why will it still trigger when the bot is already granted permission. The workflow from what i understand from our man Dominik is like this:
- /new, trigger condition (expected because bot does not have manage role permission)
- reviewer granted bot permission
- /new, trigger condition (unexpected)
- Luca Bot notify "role created by bot" and then "role assigned to bot) after /new from 3.
My workflow has an attempt to create a role first before checking for the "manage_role permission granted". From Luca Bot's response, it seems like my bot does have the permission and can successfully create a role, but for some reason, it still triggers the "no permission granted". Im using 'discord-bitfield-calculator' to get the string array of permissions granted. The condition to trigger the "no permission" is this: (!myPerms.includes('MANAGE_ROLES'))
is there any possibility that for some reason, the permissions granted was not registered b4 the interaction? Like granting a permission to a bot, but it takes a minute or two b4 the permission is registered into the bot officially? I can't seem to replicate the problem locally. Appreciate any inputs, mayb i missed out something?
const member = client.users.cache.get(config.members.owner)
if (member) {
await member.send(`${client.user.tag} Logged in!!`).catch(err => console.log(err))
}
This returning member as underfined
No thatâs not possible
Just show your code
I wanna see what myPerms is
Also which library are you using and which version of it?
Both users and members arenât guaranteed to be cached at any time.
Fetch the user instead of getting it from the cache.
Also your var names are kinda inaccurate
Why do you call the var member?
It would make sense to call it user
is that safari?
That's Google Chrome
weird then
googol crom
tf ... since when does apple has such a fucking ugly ui (as well as the browser)
java dingus
Sorry late reply. Here's the codes leading up to the error. Im using discordjs 13.8.1
"KND Captains" is formed somewhere during "get guild data" which is before "get player data" where the Manage_Roles is checked for
is that notepad++ lmao
what is bitfieldcalculator? is it a third party lib?
djs has its own bitfield calculators but they have a different name
do you know the name of the library? or wats the function to call?
v13 or v14?
https://discordjs.guide/popular-topics/permissions.html#terminology
i tried this before, the version doesnt seems to exist, no idea why. v13
they are returned directly by the permissionsIn function:
interaction.guild.me.permissionsIn(interaction.channel).has("VIEW_CHANNEL")
you dont need to convert them any further
I see. But still doesnt explain why it doesnt work during review? With my current method, it works when i try it on multiple servers
First of all, you misunderstand interactions at all
The bot does not require any permissions at all to respond to interactions
As long as you respond correctly
The bot may respond back in a few messages though, not just one reply
That's not a problem, you can send as many follow up - messages as you want to
alright, but to manage roles?
This however requires permissions of your app as it's not an interaction response
interactions.options.getUser(...) does not need to be in a try/catch clause
If the option is required it's guaranteed to return an user, if not your var mentionUser[...] will be null/undefined
Oh I see, you handle multiple commands in that event
Still doesn't change the fact try/catch is not needed
optional chaining is the way to go here
let mentionUserName = interaction.options.getUser(...)?.username;
In your command which manages the roles make sure to add the required permission check
As Tim mentioned above
if(!interaction.guild.me.permissionsIn(interaction.channel).has("MANAGE_ROLES")) return interaction.reply({ content: "Missing permission: MANAGE_ROLES" });
As example
This "stops" your code at this point and responds (correctly) to the interaction
I see. somewhere inside guild.Set() I have an action that will create a role in the server. From what the reviewer sent back to me, it seems like the permission was given and the action was succesful. What i dont understand is if there is already permission to manage roles, why would the checking returns a "stop"? It works fine all the while during testing
or is discord-bitfield-calculator just not compatible in some servers? Doubt thats the case?
I dunno about that calculator but it's absolutelly not needed to use it in any way
djs provides methods to deal with bitfields
such as search permissions by their name (flag) in a given one
as well as adding/removing (calculating) a bitfield
It could be possible your calculator is broken/outdated/unmaintained etc.
I seee, i guess thats most likely the case. ok imma try using the suggested method. Optional chaining too, i had never heard of that. Still new into nodejs haha! Thanks for the advices! @boreal iron @quartz kindle
well... just ask in here if you're stuck on something or need some tips
will do thanks!
đ will need to look into that one day
whats the best way to check if a number is a multiple of 10 in js?
number % 10 === 0
where do we report bugs related to the site?
thanks
lmao just as I joked abt "who tf would use VS for TS" someone appear using VS for JS
ok, ive been trying to get a solution but cant, so I want to generate a random number, put the old value of it on a different url /number_last and the new one on /number, it should update every full minute. Currently im using a Linux Crontab and just read the file in nodejs, how can I do it completely in node?
show what u have currently
a crontab that moves the old file to a file with the ending _old, echos the random number in the new file and an express app that reads it
it does indeed work but not when I expand my express app on multiple servers, cuz the random numbers need to be the same everywhere somehow
I can use mongodb if that helps the case
all prngs can have a seed supplied
simply use the same seed for all servers
but I don't exactly understand what ur trying to achieve
I dont know how to explain it really,
is it for some sort of backup?
no, for a stock system in a bot
...why are you using files?
and currently it just gets the stock prices from my express app
because im using a linux native crontab
the express app uses the files, the bot uses the express app
and yes, I dont really want to use files but dont know how to do it better
ok but WHAT is inside those file?
just the value of the number
and why aren't u using the database for that?
a central api works too, simply have all bot instances call it
I dunno but I dont understand the logic behind what Id need to do for it to only update every minute, not when the command is executed
cron exists as database plugins and language libraries too
đ§ đ§
I guess I can make a small service that just writes the numbers to the db and just get it from the bot through the db then, right?
yes
nice, btw is 1ms good for the db ping for a bot?
it just means it's a local database
are all your servers from the same provider?
yes
then yes, they're all local
I just wanna make sure cuz the last time I used an external db (from free tier mongo though, not selfhosted), half my db queries werent going through
any database that's not local will inherently have a latency
usually around 10ms or so
local ones are better likely
you can have a backup one just incase
that is external, but if you're frequently fetching and storing, get a local one
in cases where u need to use an external db cache becomes a must
exactly
I'd highly recommend against mongo for a centralized external database tho, the payload is quite big compared to regular sql ones
so it adds on response times
bot -> local database -> external database for failsafe
the hardest part is making sure local <-> external are synchronized
id rather be able to understand my mongo code than copy sql code and dont know how to edit it, I wouldnt think its that much of a difference anyway, like from 0.05ms to 0.03ms
push onto the external one every x hours or days
sql is surprisingly easy despite what people think
like any other code, people manage to make gross code sometimes which give a bad reputation to it
and yes, it makes that difference, especially once you reach high transaction amount/s
yeah, I can really find a nodejs tutorial to get me into it though
the main advantage of sql is that its its own language
so if you learn sql, you automatically know how to use every single database that uses sql, in every single programming language ever
resized how?
like the container is decreasing size
they look the same to me
its probably the flexbox auto-resizing them
is that page live?
or is it localhost?
localhost
so same size for all vehicle container?
change this to a static size
still the same..
parse the mentions in the message, if none, check if theres a snowflake present, use that
if there is a mention in it, use that
and if neither apply, fail
regex
or try parsing it
with the same thing u use to make one
yes, try parsing it or use regex
all uuid libs work in both directions
doesn't matter
uuid is universal
Universally Unique IDentifier
all uuid libs will work for any uuid regardless of where it came from
the same for uuid regexes
count the amount of characters, put - in-between
...look, did u search for libs to begin with?
then ur forced to use regex
but you wont be able to know if it is a valid uuid, only if it looks like an uuid
libs have functions to validate it right away, and cmon, it'll be just a couple KBs
there's no reason not to use a lib, especially for such a heavily standardized identifier
If you donât know how to do something and you want someone to give the code to you, literally just use a library for it
Otherwise youâre reinventing the wheel and having room for error
https://en.wikipedia.org/wiki/Universally_unique_identifier#Format here it is if u want to tackle the "challenge" yourself (no shame in not attempting to tho)
uuid
hi can any change my name to juba please
I am setting this to any but anyone knows what is the exact type that I should use for row?
Whatâs the exact issue
Though I can say donât load components like that
Youâre essentially making a 2D array
Or doing undefined
What's the better way honestly, since I am checking if row exists or not
Well idk if discord even accepts undefined as a value which likely it wonât
discord.js filters out undefined properties so that won't even be sent to the API
^
Yea
You could just do row normally
If itâs empty itâll be undefined anyway
Which djs seems to accept anyway
Actually itâs been converted to json and undefined doesnât exist as value iirc
Not much of djs benefit
It's not converted to JSON, discord.js validates values and filters out undefined properties
Hmm, I thought components accept array though
It's REST implementation handles it like that
It won't accept an array that contain undefined value. Either you supply an array or you declare undefined so that it won't be send to discord
My gosh⊠still djs
Wait Iâm fucking dumb itâs not making a 2D array itâs making an action row
lol
I just want to know the return value I should use here. Just for type checking measure
Itâs an array of your action rows holding the component objects
You could declare the type as ActionRowBuilder | undefined
Normal js sucks
Ts is the only way Iâd ever use js
That is what I would have done
Except when component doesn't really want to consider [actionrowbuilder] as legitmate entry
Iâd help further but I got work
Lol it's alright
noob
Shut up boomer
Close enough

lmao
U can't have : undefined
You could check if row exists and add the component field
Replace that with : []
You can, the declared type has | undefined at the end
Could you show us what's the return type of that function you're in?
From what I understood from that error
You mean row or you mean component?
If it is component then
I'm talking about the return type of the function you're currently writing that code in
You're returning an object to the function you're in, so what did you declare the return type as?
Hmm that should just work then, I wonder if it's just not accepting the builder or something
Yeah, it is not accepting the builder as a type for some reason
Basically ActionRowBuilder<AnyComponentBuilder>[] is not assignable to either of those declared at component
I think you're supposed to call it's toJSON() method
Had to do this instead
At that point you could also just do
let row: ReplyMessageOptions['components'];
That work?
Doing that will give the type of the components property to the row variable
Yeah, although what does the underlined error say?
Well it's supposed to be an array 
But you're assigning an object to it instead
Same either way
I don't think grouping the Object in an array works either. Just tried, the complier scream a new error
Well in this case you could unbox the inner type instead of getting it inside an array, for example:
type Unbox<T> =
T extends Array<infer U>
? U
: T;
let row: Unbox<ReplyMessageOptions['components']>;
The error you just witnessed occurs because of the components type being an array instead of providing it's inner type, this can help you get the inner type by unboxing it
I will try it later then, thanks
any budget discord bot hosting?
OVH provides some $2 USD/m VMs, but they're pretty bad at a single V Core and 2GB of ram.
You'd be better off hosting your bot at YMH (your mom's house)
Jk about the VMs being bad. They're what you pay for and they offer some form of DDoS protection
for not so heavy usage and ok with lots of 429s and downtime, Replit is free. Premium (same price as heroku) is significantly more stable. But might as well just Heroku lol
How Replit and Heroku containerize their VMs are garbage and are prone to noisy neighbors. You'd be better off renting an actual VPS you have "full control" over
Im using @discordjs/builders library to make embeds. Is it the way to go? Or is there some functions in djs? (following djs v13 documentation for some reason alws give me error)
You can use the raw api structure
all of the djs deps are just dependency tree bloat
Then there is discord.js v14, bundling the builders as well, my God
makes no sense
they split it to simplify the library and reduce size and then re-include it
quite possibly the hugest brain moves I've seen from oss maintainers
So many back and forth stuff with discord.js
Is there any way for me to disable all of the button/selectMenu once the bot is on restart?
You'd have to store channel IDs and message IDs somewhere and on startup, loop through all of them and PATCH the message
alternatively, ignore the buttons
If the worry is a bad ux, Discord's interactions systems in general are bad ux
All of my message components are unique and are on a callback basis rather than having a generic listener. I can ignore the buttons because if the buttons don't exist in memory, then nothing to handle the interaction
and Bot Developers wonder why they would need to buy a server with 4096 gigabytes of RAM just to host a discord bot
Discord.js v15 probably also gonna bundle the Node.js runtime itself since people hosting their bots on Repl.it use an outdated version of Node.js

no C++ = unsafe and UB đ€ź
heroku isn't really meant to be used for bots or any long-lived applications
this is part of why they removed the free plan
i wish replit did the same
discord bot uptimes drop to 0% 
replit kinda jumped on the boat glitch refused to accept, but idk how long they'll be able to withstand it
good marketing move nonetheless
wdym
glitch refused to be used to host bots, meanwhile replit made tutorials specifically how to be used for bots
so a huge part of glitch userbase gone to replit
oof
imagine the amount of noisy neighbors in replit by now
your bot would die after you closed the replit tab

replit users spamming kill 1 and restarting by now
not only that, it's mostly for on-demand services like apis
and it excels at that
APIs can still be abused by ddosing/spamming
even then it's really slow
Error 429 means Too Many Requests, you're spamming the website with requests @leaden ibex
Respect the rate limits of the website
Why i am getting this
/home/runner/Pro-Music/node_modules/miniget/dist/index.js:199
let err = new Miniget.MinigetError(`Status code: ${res.statusCode}`, res.statusCode);
^
MinigetError [PlayError]: https://www.youtube.com/watch?v=cZSrWoBMSrg
Status code: 429
at ClientRequest.<anonymous> (/home/runner/Pro-Music/node_modules/miniget/dist/index.js:199:31)
at Object.onceWrapper (node:events:642:26)
at ClientRequest.emit (node:events:527:28)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:631:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
at TLSSocket.socketOnData (node:_http_client:494:22)
at TLSSocket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10) {
statusCode: 429
}
Read above??
429 is a ratelimit
^
How can i fix it
The bot in 35+ Server
@earnest phoenix
There is no workaround other than respecting the rate limits
I Applied in Top.gg So dont Review My Bot for now please
If you add a bot note sating that your bot is offline until a specific date we will take note
Otherwise it will get reviewed like every like other bot
Simply add a reviewer note to your bot page saying that
ok
Distube API is Breaking my Bot
Distube Package bot making too Easy
just so you know when it inevitably happens, having a music bot that plays audio from youtube (and spotify) will require multiple IPs (for rotation) and constant code maintenance (so you're forced to use a regularly maintained lib)
that aside from the base server requirements to maintain a considerably "usable" bot (high bandwidth, very low latency, high memory, etc)
58% cpu with only 38 servers?
You mean like making different partitions on the USB drive bootable?
Hey, can someone explain me what shards doing?
having tea
what?
oh ty was looking for something
Ahh You Can By
Making ISO
Even in India Computer Have 6 OS in Bootable USB
shards are a way to split gateway burden
ye
what?
Ye Bro
like, instead of having a single connection tanking 100% of the requests, you get 2 connections tanking 50/50
So i need to run for example two bot instances and then shards are working?
chunks
no, that'll just make the bot answer twice
oh okay
but if you're asking then you probably don't need to shard yet
since most discord wrappers have auto-shard turned on by default
So Shards affect the internet connection the most?
Ohh okay
internet stopped being a bottleneck way back in 2008 or so
Yeah i know hah
I saw article where someone's recommending adding shards to bot at 2600 servers
yes but you can let the lib handle by itself until you reach high shard count and need to buy another server
LMAO
I never thought the day of reckoning would come
Okay, thanks â€ïž
I have to learn regex for my CS class in Java now đ
oh you'll be fine, it ain't much harder than doing it in js
I hate regex though
In any language
I had no idea that this course was going to include regex
But I guess itâs a valuable skill to have
it is indeed, and not really hard once u understand how it works
TIL groovy has sql-like querying for collections
ayo, IJ also has support for webhooks and graphql now
Bro i Forked my code and Boom! Its Work
forked someone's code, and yes, while it works for now you'll soon find out that you cannot maintain the code (aka solve bugs and implement new features)
plus, did you check what license the original code had?
Alright one comp sci lesson later and regex is really easy
I still donât like how bad the syntax looks though
exactly!
regex can produce some monstrosities, but it all makes sense as you write it
Good idea at its core, but seems like something without a whole ton of thought at the beginning that kinda just has features thrown on top of it
Not really. The syntax seems pretty "consistent" in the sense that there are non capturing groups and things like negative and positive lookahead which are groups, but non-capturing
Really I think the only down side of regular expressions are how expensive they are to compile and use, but I guess that's a fundamental flaw of string matching in general if you were to write your own recursive function
that's why you need to cache frequently used regexes
all regexes really
And avoiding use of functions which accept strings as search strings like .includes or startsWith
idk 100% about startsWith or endsWith since those can be simple loops, but includes def has to compile a regex from a string
I believe those two simply compare the characters (like, raw chars)
instead of using regex
tf waffle on 640x480, too?
funny enough, html can indeed be parsed by regex
he comes
zalgo

web scraping be whack