#development
1 messages Ā· Page 2053 of 1
are you using djs v13?
BLURPLE is not a valid button style
yes
see voltrex's answer
i saw it
new MessageButton()
.setCustomId('1')
.setLabel('š')
.setStyle('PRIMARY '),
new MessageButton()
.setCustomId('2')
.setLabel('š')
.setStyle('PRIMARY '),
new MessageButton()
.setCustomId('3')
.setLabel('āļø')
.setStyle('PRIMARY'),
new MessageButton()
.setLabel('Invite me !')
.setStyle('URL')
.setURL("https://dsc.gg/zylem")
this ?
.setStyle('PRIMARY')
PRIMARY is for the blurple coloring, which I suppose is what you're looking for so yes
last one will fail
For links, it's LINK not URL
You can see them here
https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
Integrate your service with Discord ā whether it's a bot or a game or whatever your wildest imagination can come up with.
IT'S 3 HOURS OF PROGRAMMING
I don't think that's where the error occurs, what's the permissions variable's value?
what is guild.permissions?
returns the bitfield
The Permissions constructor only accepts bigints now, not numbers
BigInt(guild.permissions)
bitfield should never be viewed in base 10, it only makes thing harder to understand
thats what Discord returned
yes, because integers are always base 10
Gonna store guilds in a database and insert ID into db when it joins and remove when it leaves etc
so people can't ratelimit the bot
you need to convert it to base 2 if u want to view what's toggle on/off
Working with large numbers is problematic with regular 32-bit numbers in JavaScript, as bitfields can be a pretty large precision number, so bigints are preferred
except that they waste a lot more memory
and are slow af
i even made a lib to avoid using bigints lol
Especially with bitwise operations and exponentiations
did u also make a lib to cure cancer?
not yet
damn
bigint bitwise is literally 50x slower than regular numbers
Time to write a lib to turn Tim into a catgirl
bigint is to numbers what HDD is to SSD
meow
it's big, like, real big, but slow
iirc biginteger doesn't even have a limit, depends on how much ram u have
anyone know the url for the fallback Discord avatar?
/ the default one
its like 1.png
there's a handful of them, and they depend on the tag of the user
remember when people were hating on the new discord logo?
pepperige farm remembers
It was a good change for users on mobile
1-6 i think
https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints
^ if you want the image to be the correct color depending on the user
** In the case of the Default User Avatar endpoint, the value for user_discriminator in the path should be the user's discriminator modulo 5āTest#1337 would be 1337 % 5, which evaluates to 2.
oh btw
for av.dbl.tf, i recommend adding a random string on the end to clear cache
my fix was using the timestamp thing as a query so cache was cleared
yeah, I can put the timestamp
yeah
I just was mostly worried about destroying the api with requests, getting over 1.5k a day now.
Turns out most people disable the user icon anyway though.
it caches internally
with userids
stores the buffer in cache (terrible solution I know but it works) for 15 mins
why not cache at the webserver level and ignore query params.
i only suggested query params because Discord cache
probably can be a bit more efficient that way.
so I used prisma on v2...
that was a mistake
lol
I've spent whole days on single errors that have no solution(talked to a contributor).
i've seen lots of issues with prisma as well
I'm too far in now to back out though.
Ive made workarounds but they are so ugly. It hurts because I've done such an amazing job imo everywhere else.
A
If you playing donāt texts him
nice scam bro
nice scam
Itās not I am tell you
if its not then why dont you dm him and make the 3k yourself
Check and mate
@thin oracle no ads
but its not ads woo, its legit 3k monies!!
free shekels
source: trust me bro
Can I use FontAwesome's free plan for my software which maybe gets commercially used or something?? I don't find something clear I just find the Pro Version license
Go to google and download the pro plan from torrent
Nobody gives a fuck about it as nobody has a way to check if youāre licensed or not
hm well I found something more safe I guess
Im using it for ages now on every project and site no matter itās private or business site
for private stuff I instantly take FontAwesome no question but for professional stuff I'm more into checking all the stuff about license and copyright etc.
But itās up to you of course
Yea
Check what it allows and yeah
Yeah like I said the pro files donāt come with a license file or anything you could check if your site has a license or not
Also you can bind the license to natural person not a domain which makes it also impossible for somebody else to check if your license is valid
If you get closer into their tos they also donāt sell a license but more like a subscription to use their pro icons
Which is less "violentlyā if you decide to grant somebody else access to your downloaded icons
But like I said itās up to you
how should i implement encryption in traffic between my database and the client (pure tcp btw)
im thinking just using asymmetric encryption
like each side generates a public and private key and they both exchange the public keys and encrypt the payloads with it
you cant use tls/openssl?
cant lie i have no idea how any of them work underneath
but doing it from scratch sounds more interesting anyways
should i just generate one public key and use it across all clients or create a unique public key for all clients
(ones faster than the other i'll let you guess which one)
encryption will only be used if the client requests to use it, or unless the server makes it mandatory
the handshake is not encrypted so its an easy way to exchange keys
Hi.
If I'm making a virtual host on ubuntu with apache and my server is running on flask, what should the DocumentRoot be?
like templates folder?
ah wait, it should be the root folder, like, where ur site starts no?
Now i get why they're making it more enum based for v14
The doc root of your virtual host is the root path of your project
This path should contain the directory index, for example the index.(html/php/js)
The paths are always absolute paths, keep that in mind
how do I replace the token out of the eval command?
I tried everything
client.token by itself seems to work nicely, but doing message.channel.send(client.token); somehow doesn't š
Pro tip: donāt make your eval command public!
You will not be able to secure it easily
Just make it dev-only
Unless you really know what youāre doing
yeah I'm not that stupid lol
reason I didn't even make it available for me is because I really don't trust myself
that's why I'm asking if anyone knows how to do it properly
just use string replace
message.channel.send(evaled.replace(client.token, "bot token"))
it doesn't work
yeah I tried that
any many other variations
.replaceAll
it works if I just eval client.token by itself but if I try doing it using <channel>.send it shows
tried this as well
you cant
then just don't send your token
evaling gives you full execution rights, its impossible to protect against every possible attack vector
plus there's a feature to regen it
what is it?
in the dev portal
You can regenerate your token in the dev portal
^
yeah that's rather obvious
but if I'm not available and somehow someone grabs the token I'd rather not take chances
best you can do is using the string replace method for finding tokens in the evaled string, and also use stirng replace to remove any occurence of .token for example, but its impossible to protect against every possible way to get the token
Eval commands are inherently dangerous, there is nothing you can do to stop them from being used maliciously
how come is it not possible to just prevent the token string appearing anywhere?
for example you could still do client["token"] or even client[["t","o","k","e","n"].join("")]
Because you can instruct the client to perform an action
you can make the eval responses in DMs instead of public
eval just runs your code
what if I remove client.token endpoint from the discord.js lib?
because when you do eval message.channel.send(client.token) the token is not appearing anywhere
you are executing another command inside a command
Thatās going to break djs lol
nah it won't
the first command cannot see the token string inside the second command
I edited discord.js package a lot
that's just a term I use to refer to it
client.token is not a getter-only property?
so it's used even after startup
how?
every time you fetch something for example
Rest
well that's a problem
^
Thatās probably your best option if you donāt trust yourself
you'd think discord.js caches the token after initialization instead of fetching it everytime
Granted you would still be able to instruct the bot to send the message
yes, it's cached in client.token
is it possible to send an ephemeral message that isn't a response to an interaction?
could it not be cached in some other variable that you can't access then
not afaik
evaled = evalec.replaceAll(client.token, "[REDACTED]");
dang nab it
the discord.js codebase is very complex and class-based
you cannot fetch the token anyways, the token endpoint is a regen-only and a user-only endpoint, the vulnerability is in the environment where the token string is used
The only bots that have public eval commands that would be immune to some sort of malicious behavior is those that either use a sandboxed environment to run code (still kinda dangerous) or use an API of some sort
^ any way to make that safe proof for only <channel>.send?
make it send in DMs
can you break a VPS?
why would you want to do message.channel.send every time you eval something
I'm not quite sure but as long as it's not emulated it should be safe
client.redacted = "[REDACTED]"
evaled.replaceAll("client.token", "client.redacted")
replacing won't work, i can insert random characters in-between every character in the string which nullifies the replace
There is an infinite amount of ways to get your token from an eval command, either accept it and move on, go through a complex process to run it, or donāt have an eval command
I don't, my point is doing message.channel.send(cllient.token); ignores the replace
is that really gonna work?
the problem is why would you want to send your token to the public
it will work only for that exact case you mentioned
Thereās still ways to get it
oh and you need to add it before the eval too
If youāre really going to leak your token like that then youāve probably already leaked your token a thousand other ways
Just use it in a private server or in DMs
tio.run is a good way to troll non-authorized people running eval commands
that's alright I use the clean method before running the code
Ofc especially since 99% of the customers have literally no network knowledge including how to secure their servers and configure their apps/services/firewalls.
This is probably what most people use for public eval commands
i use the root user in my vps, hack me
imo the absolutely safe way to run evals is to containerize it in another process, you effectively remove all djs methods though so you'd have to implement some sort of an interpreter and hand pick which methods to parse and call in your main process
Like what MODiX uses for the C# server, and what Geordi uses for C++
sounds like a lot of work tho
yup
it is
Challenge time
(I donāt know what they use but itās likely similar)
as you may have noticed already, you're trying to do something that literally nobody does, so give up lol
if (message.author.id !== process.env.OWNER) return;
Thereās a reason eval commands are meant to be restricted to only trusted people
š
I know I know
Because youāre running unknown 3rd party code on your machine
No risk no fun gentlemen
I doubt anyone would be evil enough to brick a VPS
Just to say
log4j would like to hire you
lol
the moral compass is off the charts on the internet
especially on platforms like discord
No such thing as morals on discord lmao
speaking of running 3rd party code, my api parses user input into a linux grep command, will this be enough to sanitize it?
query.replace(/[&`\\"|*~<>^()[\]{}$\n\r]/g, "")
me when client["nekot".split("").reverse().join("")]
yes
yes
yea
also, array.push()*n + array.reverse() is faster than array.unshift()*n
yes
yes, as long as they're in under 10 guilds
š
Without a closer look, this looks more like rocket science than regex 
can someone explain how does bot creating a guild even work?
It creates a guild.
would it be the owner?
Yes
so many questions
Under 10 guilds itās allowed
can you transfer the owner to a user after creation?
Thereās a reason itās not allowed above that though lol
that can be super super super abused
// query = user input via POST request
Q = query.replace(/[&`\\"|*~<>^()[\]{}$\n\r]/g, "");
spawn("/bin/sh", ["-c", `LC_ALL=C grep -F "${Q}" file.txt`])
Not really
wdym you can log into someone's account and then create like 50 guilds then transfer ownership to the logged person
You cannot do that
Tim, please ⦠Iām driving and I donāt wanna hit a tree when looking at it
it sounds like you can from what you're telling me
.>
any exploit you can think of has measures to prevent said exploits
^
otherwise we wouldn't be talking about this
Discord has had an API for a long time, youāre not the first one to think of these things, they have measures to prevent abuse of their api
that doesn't make it any different from just creating the guilds yourself as a user though lol
that's good, at least I won't have to worry about that
if you're at the guild limit as a user, transferring the ownership to you will fail
a person I know got a virus on their discord once
Thatās not a virus, Iāve seen that bug before
the application kept changing colors from white mode to black mode
Oh you mean not from discord but got into discord
Itās been used to crate guilds using a template then transfer the ownership to an actual user
I was thinking of the emoji that triggers windows defender
I think they downloaded a cracked version of discord and that started happening
ik that one
And creating a guild isnāt dangerous
cracked 
Cracked version of a free service moment
š what
cracked nitro perhaps?
BetterDiscord is like the only thing I would trust
still against TOS
Since itās open source and widely used
Iām aware, they donāt ban BD users unless they have malicious plugins or do something harmful though
staff don't care if you have a modded client unless you use it to abuse the api or bother people, confirmed many times in dapi
Most people just use it for custom themes
can they notice if you're using BD?
I wasn't aware of that
Yes
It's very obvious
how do they do it?
From the screenshots
Lol
well that's not what I meant...
quietly by checking file sizes/checksums and api behaviour
Or like me in the browser client to highlight or hide specific areas or assets
every single api request in the client is logged
can they detect if you messed with the html of the web client?
/api/science moment
I used BD at one point because I wanted a nicer theme, then it just became more of a hassle and I didnāt care about the theme anymore
that would be an overkill tho
thanks to that discord has an automatic system to prevent dm bots
Why?
just by checking the behavior of your api calls
I think you have a misunderstanding of how HTML is served to a client
That would just be a client side modification, but messing with the HTML would not be able to change the behavior of the client itself
I know html is client side but it still I'm sure there's ways
and the fact that discord is barely made in html š„² most of the DOM in discord is virtual
is changing the HTML only against TOS?
no
It kept downloading shit for updates and I got tired of it
Oh oh oh!! That reminds me of the dude who tried to hide JS code which gets delivered to the client

oh god i remember that
that's great, I could make the script into an extension
LMAO
they were absolutely mental
Yeah but still funny somehow
At least a bit
If he 100% refuses to accept the reality
Thereās probably already theming extensions out there anyways. Plus, youād be forced to use the shitty web client if you wanted the theme
by the way is it possible to bulkDelete a messages from certain users?
yes, by filtering out the messages in your code
The bulkDelete endpoint takes an array of message IDs, filter out the messages by user
the bulk deletion endpoint doesn't care about anything but the ids of the messages you want to delete
await message.channel.bulkDelete(...).filter(...)
``` ?
What
would something like this work?
why can't people think in a logical flow š
Canāt just randomly throw a .filter on something and expect it to work lol
Welcome to #development
yeah
Because youāre either able to understand a logical flow or not, not really something you can learn or schools would/can teach you
this channel suffers from so many people trying to be developers when it isn't meant for them, talking generally here, didn't mean to target anyone
I think thereās a certain level of intuition that goes along with it. Logical thinking can certainly be learned but it helps a lot to just have a logically oriented mind
all of the above problems are more likely caused by not knowing enough how the language works
I know some people that will panic on tests because they look at a question and have no idea what to do, but when I help them later and break it down into parts they find that they can do it really easily
Only up to a certain point, I would agree but thatās nothing you can really train conditionally people would understand
Dogs do, people not
I have one idea of how I could do that but I'm not sure if it's the best
its not exactly a lack of logical thinking if you dont know what is a promise, what is an array, and what is what in a given piece of code
Sometimes it helps to think like youāre writing pseudo code too lol
its just lack of knowledge
Also true
i remember learning JavaScript just for making discord bots, worst decision in my life
Missing the fundamental knowledge is a pain to do something
I could check the 2nd argument for mention then do the purge command with it and if there was not a mention I could bulkDelete insstead
My first ever programming project was a bot in djs
it feels so hard to understand the language in a very complex environment
skill issue
If you check my message history and go back to my oldest messages, I was a complete js clown
I was the average #development asker

not really a skill issue since i have the skill now 
:^)
is that good enough? :]
this!! used to have a gut deep hate for pseudo because i was forced to write it in school when i already had what i need to write in a language inside of my head, but taking a general problem and solving it in pseudo makes it readable for so many more people
i basically also learned js from making a bot
i had a bit of previous experience, but it was very limited and mostly browser js
My only previous experience was a summer school thing I did when I was 9 lmao
My first time programming was from some random youtube recommendation in late 2019
Remembered a whopping nothing (probably because it wasnāt very in depth at all)
I started programming in like September or August of 2020 I believe
started out with minecraft plugins and then developed deep hate for java gang
i associate java with my childhood trauma
:^)
java is okay, it just needs to be more optimized
I did get into it too after moving the php bot to js but years of experience with an actual Programm language helped a lot
far from okay
i never tried java, but i always hated it because of the annoying jdk shit that i had to keep installing every time a new update was out because banking plugins required it (and minecraft)
can anyone give me a link to the messages.fetch function documentation?
I can't find it
the desing extremely messy and there's tons of patterns that the language can't seem to decide which one to make a standard, i.e. the stream api
I'm not sure how to format that
design*
do I just put fetch({author: id})?
no
or is it more complicated?
Ok I just confirmed my first ever real programming project was a discord bot on august 25th 2020
fetch messages -> filter by user ID -> get message IDs by corresponding user ID -> bulk delete
(Also make sure that youāre filtering out any messages greater than 14 days old)
gta samp Control Panel like idk 16y ago

Or more probably
Oh and pawno of course
I believe bulkDelete will not work (?) if you try to delete any message more than 14d old
same here lol, i made a simple calc app to familiarize myself with c# then started actually dedicating time to a discord bot back in 2017, first project that lasted for more than a month
let messagesToDlete = await message.channel.messages.fetch({limit: messagesToDelete, });
messagesToDlete = messagesToDlete.filter(message => message.author.id === mentionedUser.user.id);
``` alright so I got something like this
now do I loop through them or what?
my first ever real programming project is a discord.js v11 bot in march 2020, it was hosted on my PC because idk what hosting providers were
yikes
Same
I faked my parents sign under the contract to the rent servers back in time when I was 14
lmao
keep in mind that the result will not be the same number as the number of messages you want to delete
And of course it's multipurpose 
huh?
then what is limit for?
from what I read it does exactly what you say it doesn't
i used to selfhost on a notebook that was meant for office work. let me tell you, wifi and an old laptop processor sure make a great team for extremely fast response times!
you fetch 50 messages (limit 50), then you filter by user id
oh
if in those 50 messages, only 10 were from that user, thats the number of deleted messages
that does make sense
Ages ago when WiFi means you had to be in the same room as your router
If it would actually have WiFi
back in 2010 i downloaded visual basic and said "im gonna try to program something"
spent a couple hours on it, didnt understand shit, uninstalled
i remember when wifi was on the rise, the pop out antennas š
@quartz kindle ```js
const messagesToDlete = await message.channel.messages.fetch({limit: 100});
const filteredMessages = messagesToDlete.filter(msg => msg.author.id === mentionedUser.user.id);
for (i = 0; i > filteredMessages; i++) {
if (i >= messagesToDelete) break;
filteredMessages[i].delete();
}
will this do the trick?
that will hit the api rate limits
Thatās the average process nowadays when seeing a game I could be interested in, trying it, playing it a few hours, getting bored and uninstall
:c
that's where bulkDelete comes in
oh yeah, wait till you get to VBA
me when someone forgets the initialization keyword of the variable in the for loop
If I ever have the time to play of course
how do I use bulkDelete with an array?
map the message IDs and call the bulkDelete func
bulkDelete(array of message ids)
or array of messages works too
so basically you dont even need to remap
bulkDelete(filteredMessages)
oh right i forgot we're working with a wrapper here
if (mentionedUser !== undefined) {
const messagesToDlete = await message.channel.messages.fetch({limit: 100});
const filteredMessages = messagesToDlete.filter(msg => msg.author.id === mentionedUser.user.id).map(msg => msg);
await message.channel.bulkDelete(filteredMessages + 1).then(messages => {
message.channel.send(`Successfully purged ${messages.size - 1} out of ${messagesToDelete} messages from the chat.`);
});
} else {
await message.channel.bulkDelete(messagesToDelete + 1).then(messages => {
message.channel.send(`Successfully purged ${messages.size - 1} out of ${messagesToDelete} messages from the chat.`);
});
}
so
does that work?
whoops
My gosh I remember the times when you couldnāt just ask how to do things
When there was a forum people needed days to reply if were lucky
A time you had to test and try things an entire day to get it working or give up
why + 1
bruh
ĀÆ_(ć)_/ĀÆ
yeah I noticed
Also you canāt fetch more than 100 messages at a time, right?
that's why I limited it to 100
Oh just saw that
doesn't djs batch requests if the argument is higher than 100 regardless?
bad lib
i miss dpy
didnt danny come back?
if (mentionedUser !== undefined) {
const messagesToDlete = await message.channel.messages.fetch({limit: 100});
const filteredMessages = messagesToDlete.filter((msg, index) => msg.author.id === mentionedUser.user.id && index >= messagesToDelete).map(msg => msg);
await message.channel.bulkDelete(filteredMessages).then(messages => {
message.channel.send(`Successfully purged ${messages.size} out of ${messagesToDelete} messages from the chat.`);
});
} else {
await message.channel.bulkDelete(messagesToDelete + 1).then(messages => {
message.channel.send(`Successfully purged ${messages.size - 1} out of ${messagesToDelete} messages from the chat.`);
});
}
``` forgot to limit
is index a thing in the filter func?
Until that pleb throws it away the next time lmao
wat
Probably got harassed too much for leaving 
bruh 
After running so much peopleās work
um guys
So many people still use v12 because āv13 is too much workā to update to
I don't think
that worked
Successfully purged 42 out of 3 messages from Anonymous Hater#2437.
Yeah auto correct, thanks for nothing!
Lol
*So many people still use v12 because they can't upgrade to Node.js v16
you know the host 
Devs are lazy, itās their job
š can I get help or not
Automate the tasks that weāre too lazy to do by hand
"i watched a youtube tutorial and i have no idea how my programming environment works" trope
Please use async await instead of .then
I'm using .then to get the message size
You donāt need to do that
Use async await
Itās the same thing but a lot easier to read
also, look at the variables you're using in the string very carefully
^
which string?
Thatās the price if people can share any sort of content to the world no matter how outdated or stupid it is
no messagesToDelete is a number
I just noticed I named two variables the same thing
Oh nevermind you just have bad naming 
And if people grow up using that trash instead of learning things how you would expect it
const messagesToDeleteFiltered = await message.channel.messages.fetch({limit: 100});
const filteredMessages = messagesToDeleteFiltered
.filter((msg, index) => msg.author.id === mentionedUser.user.id && index <= messagesToDelete)
// We are mapping to make the message IDs readable to the bulkDelete() func.
.map(msg => msg);
await message.channel.bulkDelete(filteredMessages).then(messages => {
message.channel.send(`Successfully purged ${messages.size} out of ${messagesToDelete} messages from ${mentionedUser.user.username}.`);
});
``` I know 
is that better readable
I moved the index to the map func cause I know map has the index property
will that fix it?
.map(msg => msg)
mapping to make it readable for the bulkDelete like yall said tho š
You donāt need to map
so you told me lies
const a = a 
Filter already returns an array
Thatās why youāre able to chain them like that
yeah but index doesn't work in filter
Not sure what else it would even be able to return
so how do I check for the amount of messages to be deleted
Huh?
.filter((msg, index) => msg.author.id === mentionedUser.user.id && index <= messagesToDelete)
``` notice what I'm even tring to do
index <= messagesToDelete
Why do you even need that
to delete only the messages that I want to delete
you're thinking way too much into it
I put -clear 3 I want to delete 3 messages not 1000
You donāt need that
Why not just fetch however many messages the user specifies
because it's gonna fetch messages from other users too
yeah then I want to filter them to only be the ones of my user
Then filter it after you fetch
waffle was right about writing pseudo, you should first outline your problem and solution by writing pseudo then actually translating it into code... you're getting confused because you keep getting lost in your thought process, writing it down will help
You donāt need the index if you only filter however many messages your user tells it to fetch
And if itās over 100, then just fetch 100
^
Think about your problem instead of piling more code on to a solution that is already going the wrong direction
Just take a second and think about what you need to do
const messagesToDeleteFiltered = await message.channel.messages.fetch({limit: 100});
const filteredMessages = messagesToDeleteFiltered
.filter((msg, index) => msg.author.id === mentionedUser.user.id && index <= messagesToDelete)
``` trying to fetch 100 messages, filtering those messages by user ID and filtering the ones that aren't in the range
what's wrong with that?
And write it down in a comment if it helps you
it won't cause I still don't know why that doesn't work
If you necessarily need to limit the filtered result then slice the array by the user input
const filteredMessages = messagesToDeleteFiltered
.filter(msg => msg.author.id === mentionedUser.user.id)
.slice(0, messagesToDelete);
better?
your naming is so confusing š
Idk about the order fetch returns
oh my god
So read the docs or test it out
why not name fetched messages just messages and the ones you filter out filteredMessages, your variables don't have to be verbose, that's what comments are for
Your user has given the number to delete, let's call it ARGS
Your user has given the Member object to delete from, let's call it MEMBER
In order, you need to:
fetchedMessages = Fetch 100 messages
filtered = Filter those messages to include only those of MEMBER.id
bulkDelete filtered.slice(0, ARGS - 1)
Send a message like "You have deleted `filtered.size` messages from `MEMBER.username`"
try {
if (mentionedUser !== undefined) {
const messagesToDeleteFiltered = await message.channel.messages.fetch({limit: 100});
const filteredMessages = messagesToDeleteFiltered
.filter(msg => msg.author.id === mentionedUser.user.id)
.slice(0, messagesToDelete);
await message.channel.bulkDelete(filteredMessages).then(messages => {
message.channel.send(`Successfully purged ${messages.size} out of ${messagesToDelete} messages from ${mentionedUser.user.username}.`);
});
} else {
await message.channel.bulkDelete(messagesToDelete + 1).then(messages => {
message.channel.send(`Successfully purged ${messages.size - 1} out of ${messagesToDelete} messages from the chat.`);
});
}
} catch {
return message.channel.send(`Couldn't purge because the messages are more than 14 days old.`);
}
here is the entire thing
Here's a quick outline of your problem
wait till we get to the 14 day problem
I got that covered by the try catch
Don't worry about the 14 day quite yet, that's easy to filter out after you get the other part working
..or that won't help?
that's like putting a band aid on a deep wound
You can either try catch and let the entire bulkDelete fail, or you can filter them out beforehand and just delete those under 14 days old
The second approach is more intuitive for your user
How do I get first result
[0][0]?
it's a 2d array, ^
do you know why this won't work how I want it to
cause it will fetch the amount of messages
so it will fetch 3 messages
2 of those aren't send my me
and if I remove the 3 messages
delete what you wrote and start fresh, now following what waffle wrote
You know that's a fair point I didn't think of
I was thinking about something else
well then what else could I do?
I'm still not sure how to filter out a specific amount of messages from an array tho
There
I updated it
I'll resend it so you don't have to scroll up
Your user has given the number to delete, let's call it ARGS
Your user has given the Member object to delete from, let's call it MEMBER
In order, you need to:
fetchedMessages = Fetch 100 messages
filtered = Filter those messages to include only those of MEMBER.id
bulkDelete filtered.slice(0, ARGS - 1)
Send a message like "You have deleted `Math.min(filtered.size, ARGS)` messages from `MEMBER.username`"
(Does slice throw if the second value is too high? Not sure, if it does, just use Math.min)
Ok no it doesn't throw, that should be fine
const messagesToDeleteFiltered = await message.channel.messages.fetch({limit: 100});
let filteredMessages = messagesToDeleteFiltered
.filter(msg => msg.author.id === mentionedUser.user.id)
filteredMessages = JSON.Stringify(filteredMessages).slice(0, messagesToDelete);
const resultMessage = await message.channel.bulkDelete(filteredMessages).then(messages => {
return message.channel.send(`Successfully purged ${resultMessage.size} out of ${messagesToDelete} messages from ${mentionedUser.user.username}.`);
``` <--- this is what I wrote before reading your message
What on earth is that JSON.Stringify doing there
I'm not sure what I was thinking
Read my message and write it from that pseudo
okay give me a sec
if (mentionedUser !== undefined) {
const messagesToDeleteFiltered = await message.channel.messages.fetch({limit: 100});
let filteredMessages = messagesToDeleteFiltered
.filter(msg => msg.author.id === mentionedUser.user.id)
const resultMessage = await message.channel.bulkDelete(filteredMessages.slice(0, messagesToDelete - 1)).then(messages => {
return message.channel.send(`Successfully purged ${Math.min(resultMessage.size, messagesToDelete)} out of ${messagesToDelete} messages from ${mentionedUser.user.username}.`);
}
there
And does that work?
let me test
(Not counting the 14 day issue yet)
Use a beta bot
nah my reload command couldn't cache the command cause it got an error so to cache it again I have to restart
Still don't understand what that has to do with testing on production though
cause I don't have a beta bot
Make one, it's easy
Back to no risk no fun
lol
} else {
^
SyntaxError: missing ) after argument list
nvm
lmao
const resultMessage = await message.channel.bulkDelete(filteredMessages.slice(0, messagesToDelete - 1)).then(messages => {
I forgot to remove the .then part
update: doesn't work
What doesn't work about it
alr
Makes sense, how else would you keep the keys and values of the filtered collection
You'll need to do give it the array of messages
Canāt you just use the collection keys which should be the message IDs?
if (mentionedUser !== undefined) {
const messagesToDeleteFiltered = await message.channel.messages.fetch({limit: 100});
const filteredMessages = messagesToDeleteFiltered
.filter(msg => msg.author.id === mentionedUser.user.id)
.map(msg => msg)
.slice(0, messagesToDelete + 1);
const resultMessage = await message.channel.bulkDelete(filteredMessages);
return message.channel.send(`Successfully purged ${resultMessage.size - 1} out of ${messagesToDelete} messages from ${mentionedUser.user.username}.`);
} else {
const resultMessage = await message.channel.bulkDelete(messagesToDelete + 1);
return message.channel.send(`Successfully purged ${resultMessage.size - 1} out of ${messagesToDelete} messages from the chat.`);
}
``` this fixed it
Or that yeah
it works now
Map the keys or is there even a collection method to return the keys in an array
Maybe
Yeah that looks fine
how about that 14 days error issue?
That's the limit
yeah you guys said a catch statement wasn't enough
Filter the messages, if any are older than Date.now() - 14 days then don't include them
I know how to do it but it would require me to also alter the below bulkDeleting with I'm honestly too lazy to do
a try catch it is
Ah yes, spend more than an hour on one problem and still refuse to do it the right way because too lazy 
you're wasting a request
This is so discord dev moment
i.e. you're intentionally putting yourself in a situation where you can get rate limited
I can get rate limited by doing a try catch?
no
I am limiting the messages by 100 anyway?
think outside of the box
it's the fact that you can prevent the request failure in the first place if it's trying to delete messages that are older than 14 days
if you send a bulk deletion request with a message id older than 14 days the whole request will fail
ratelimiting is when you send too much requests to the discord API
ergo you wasted an api request and contributed to the rate limit
alright I get your point
now
My implementation of a clean command in detritus (without the user part) was as follows: ```ts
async run(payload: Command.Context, args: CommandArgs): Promise<any> {
if (args.messagesToDelete) {
let messagesToDelete = args.messagesToDelete + 1;
const messages = await payload.rest.fetchMessages(payload.channelId, { limit: messagesToDelete });
const messageArray: Array<string> = [];
for (let [k, v] of messages) {
if (Date.now() - v.createdAtUnix < 14 * 24 * 60 * 60 * 1e3) {
messageArray.push(v.id);
}
}
if (messageArray.length > 1) {
await payload.channel?.bulkDelete(messageArray);
} else {
const embed = createUserEmbed(payload.user);
embed.setColor(Colors.DEFAULT);
embed.setDescription('I cannot delete messages greater than 14 days old.');
return editOrReply(payload, { embed });
}
}
}
detritus 
Granted I wrote this a while back, so it's probably not my best work
I'm not quite sure how to actually check for the time?
.filter(msg => msg.author.id === mentionedUser.user.id && message.createdTimestamp - Date.now() >= )
how do I actually check if it's longer than 14 days?
Date.now() returns the Unix timestamp in seconds iirc
can I steal that?
I mean I posted it, probably not the best way to do it, but go ahead and convert it if you want
I could conert it pretty sure
the code gets even more complicated when you get to batching the bulk requests if you want to delete more than 100 messages in one go 
I'm definitely not going to do that
bulkDeleting more than 100 messages is getting to sketchy ratelimit territory
lots of things to worry about when batching requests like that
Why would you want to delete that many messages anyway
spam bots etc.
lol I just noticed
Ban exists
true
ban purges all messages up to a specified time
Still
.filter(msg => msg.author.id === mentionedUser.user.id && Date.now() - msg.createdAtUnix < 14 * 24 * 60 * 60 * 1e3))
``` what does `createdAtUnix` even do?
0-7d iirc
I never heard of it?
gets the message's created timestamp in unix form
Less painful than bulk-deleting
it's not djs
popular mod bots have the feature regardless but have hardcoded limit, i.e. 500 or so
so will createdTimestamp work as a replacement?
detroit us
detritus has .createdAt and .createdAtUnix, I don't remember the difference
I just know that createdAtUnix works for me
.createdAt probably returns some object/wrapper
probably the same as .createdAt and .createdTimestamp in djs
yeah
have you tried .createdTimestamp
you missed the take
wdym?
now you missed the joke

haha im so funny /s
im gonna make an account on oracle and slap it with a minecraft server
lowkey wanna do that too
I already have an oracle account
every VPS bans hosting minecraft servers
I wonder why
I'm just too lazy to log back into it and do linux server shit for 5 hours
Fuck it, I'm gonna go buy some ice cream at the store, brb
buy me some too 
I have an important question
is TS better than JS, if you think so, why?
for me it's the fact that you can catch type errors at compile time instead of struggling to debug it during runtime
main reason why i fell in love with it
early ecma features & proposals are a bonus
that sounds kinda cool
should I give it a try?
I always thought it was just a copy other than slightly different syntax
I can never live without static typing after using a lot of statically typed languages
I feel like once youāre experienced enough even on large scale projects thatās not an issue anymore
Even when working with 3rd party services/libs, once you know how to sanitize all results accordingly that sort of errors shouldnāt be an issue anymore
^
no matter what you do, you will always end up debugging by console.logging in the end 
Mostly yeah and modern editors aim to help people a lot to debug issues
Excl people who arenāt willing to switch to one and still use npp

vsc actually does have a js type checker, which basically does the same as typescript, but uses jsdoc instead, so its fully compatible with regular js
its disabled by default
and that's me
i've been using notepad++ for over 3 years
Me too and Iām still worried about switching
I need to enable that then...
Or just use ts
i just dont like the compilation part of ts, i like my code running as i write it, not compiled to got knows what
People complain so much about the default behavior that adjusting the app until I like is a long process Iāve got no time for
And you know, once youāre old and tired you donāt wanna change the running system or learn new tricks

i am old and tired, i dont want to change my bot to slash commands
@_@
I prefer ts, it catches a lot of bugs that are just waiting to happen. Not to mention, you'll have a much better understanding of how types in other languages work
It's also really really nice for things like react where you can make types for functional components really easily
At this point i'd rather make my own code editor
Alr have a good one, just have 4h left until a 1000km trip for an useless meeting
š¤¦āāļø
rip
Yeah fuck natural resources
Thanks for submitting one 
My next rust project is implementing jlox
But that's a job for 1 week in the future me to figure out
Also I've been really enjoying looking at the compiled (unoptimized) code for basic c++ programs, really fun to look at the assembly
poggers
hey i was asking about the pokemeow bot and it not having permission that i had given to it and got sent here. is confused.
You're going to want to look at their discord support, this is a channel for making bots
see that's kinda what i figured. but the response i got referenced me to here
hit me with the #development and that was it XD
I am using discord-player package
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2022-06-13T21:38:47.375648+00:00 app[Worker.1]: },
2022-06-13T21:38:47.375648+00:00 app[Worker.1]: playbackDuration: 939040,
2022-06-13T21:38:47.375648+00:00 app[Worker.1]: started: true,
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: silencePaddingFrames: 5,
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: silenceRemaining: -1
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: }
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: }
2022-06-13T21:38:47.382557+00:00 app[Worker.1]: (node:4) Warning: [DiscordPlayerWarning] Unhandled "connectionError" event! Events "error", "connectionError" must have event listeners!
why?
it logs
[Wolves] Error emitted from the queue: aborted
[Wolves] Error emitted from the connection: aborted
Add an error listener and try to reproduce it
All that error is saying is that you're not properly treating your errors
Nvm .split exists
The last logged error in the block is from the error event
How to add it?
How to make a no-prefix command which works without a prefix.
<@&817055174613794826>
The support team is for questions related to Top.gg, not development
Ah okay
how do 2 different websites on the same IP?
I've been searching but haven't found anything about it
they just have to be on different ports
use NGINX
just don't check for any prefix
I want it to be for some specific users
then add a condition to check for those specific IDs

you can have up to 65k+ sites on a single ip
ok
Haii, alright, so I'm trying to understanding a bit of a complex topic that I need opinions on before I can start my course: 
- We have NGINX and we have APACHE, what's significantly better? I mean, based on what I've seen by most YouTubers (especially developers), I've heard that NGINX, overall, is a better web server which could also be used as a reverse proxy.
- How does the process work, like do you also need to use a Virtual Private Server in order to fully install NGINX using CLI?
- What's the relation between NGINX and CloudFlare, as I've heard that though using cloudflare makes NGINX have no real advantage unlike APACHE since Cloudflare could already do load balance (which I'm not entirely sure what it is) and proxy for you.
TopGGAPIError: 401 Unauthorized (You need a token for this endpoint)
at Api._request (C:\Users\wpuser18\Desktop\UrakoBeta\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Api.postStats (C:\Users\wpuser18\Desktop\UrakoBeta\node_modules\@top-gg\sdk\dist\structs\Api.js:99:9) {
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/stats',
status: 401,
statusText: 'Unauthorized',
headers: [Headers],
counter: 0
}
}
}
how to fix ?
We have NGINX and we have APACHE, what's significantly better?
neither, both have their pros and cons, I personally prefer nginx because it's simpler to deal with and I hate xml
How does the process work, like do you also need to use a Virtual Private Server in order to fully install NGINX using CLI?
nginx/apache are just normal programs that you leave running indefinitely, anywhere you can install programs AND handle ports can have either installed
What's the relation between NGINX and CloudFlare
none
I believe the last, how does it know I own the domain?
you're not supplying the token
it doesn't
How do you connect your domain, then?
all nginx/apache does is redirecting incoming requests to the proper files
ohh thank
it's the other way around, the domain connects to your ip
when you buy a domain you get to choose where it'll point to
the only thing you do regarding your domain on serverside is setting up the ssl
Fair enough, however, I have a domain registered with namecheap, so would it work even though I have a VPS somewhere else?
domain doesn't care where you point it to
I'm willing to follow a course (or let's say a documentation) but I'm hoping not to get lost.
Wait, so it just leads you to the IP? And not act as the website domain for the website?
ye
domain is just a name, nothing else
it cant host anything
that's why you usually use cloudflare, to mask your server's real ip
Oh, so even though I enter wergnhp0.com, I'll go to wergnhp0.com and not the IP of the server.
Well, I need to figure out doing that.
you'll go to wherever you set it to point to
Fair enough.
Any course you recommend based on your personal experience? (A website or so).
not really, just a bunch of scattered google searches
Alright, many thanks on this. š
do you know what dns is?
Yes, I do.
I'll be managing that through CloudFlare, correct?
no
Or from NameCheap? (the place I'll buy the domain from)
DNS means Domain Name System, its what controls where domains go everywhere in the world
there are thousands of DNS servers out there
Indeed.
when you buy a domain, you can do two things: configure its DNS server and configure its IP address
the domain IP address, is used to know which server that domain should go to, for example your VPS's IP address
Fair enough, self-explanatory.
the DNS server is used to know which server the domain should use as its "authority", meaning where this domain name is "based at" if that makes sense, which for example, cloudflare asks you to change you domain to their DNS servers in order to give them the authority over your domain, prove that you own it, and make all connections go through it
so when a person types "yourdomain.com" on the address bar, the browser first searches for the DNS server that "owns" the domain, then the DNS server will tell the browser which IP it should go to
Ohh, yup, I remember taking about that. I believe it what asks the "authority" on what to do next like the example above.
Alright, particularly, which IP it should go it, yes.
afterwards the browser attempts to connect to the final IP address, and thats where your webserver receives the request, but your webserver can still see what domain is being requested
so you can run multiple websites on the same server
Ohh, alright, alright. I get it, so I believe my prerequisites, at my particular case, to host just a simple static website via NGINX, is: 1. An Ubuntu (or any distribution) VPS. 2. Cloudflare. 3. A Domain?
Do I need anything other than that?
Fair enough.
Quick question, does each domain have an IP or a domain is just a domain.
each domain has an ip, unless that domain is inactive
subdomains also have their own ips
Indeed, however, we're inputting the ip of the domain when going to the website, however, when do we use the IP of the VPS, itself?
there are many types of DNS Records that you can create and configure
for example A record is for an ipv4, AAAA record is for an ipv6
a domain can have both
and they can both be different servers
Yup, however, when does the VPS IP come in handy.
a CNAME record is a domain alias to another domain
MX records are for emails
etc
the domain has to point to your vps ip to be able to communicate with it
the ip of the VPS is the ip that you put in the A record of the domain
However, do you think I should manage so from NameCheap or do I just convert everything to be CloudFlare used.
In addition, to be using CloudFlare as my DNS, let's say "authority", I should rewrite each DNS Configured on my default DNS Manager and write them again on the CloudFlare one, correct?
not really a coding question, but does installing windows 11 remove all your apps, games etc again lmao?
not if you update/upgrade
only if you format and install from scratch
it has to be if you want to use cloudflare
doesnt really matter, you can keep it in namecheap, configure dns to cloudflare and configure an A record to your vps
Yup, that is understandable, but when it comes, generally, using CloudFlare as your DNS, you have to rewrite all the records to your CloudFlare, right?
cloudflare also works as a domain registrar these days
really?
so you could also completely transfer your domain to cloudflare and remove it from namecheap
but that requires renewing the domain
How about this case? (generally, speaking)
no, you just need to write the "name servers"
you dont need to write A records to cloudflare
when you go to the domain options in namecheap there should be two different things: "name server" and "dns settings"
name server is where you add cloudflare
dns settings is where you add your vps
Let's talk about Plesk, as an example, where would it be?
https://cdn.hamoodihajjiri.com/mPlECbX4JK
I mean, DNS Settings is all I see.
did you buy namecheap hosting?
No, I'm just using Plesk as an example to understand what you mean by "name servers".
go to dns settings
Done, then?
I see a list of records, 29 in total, for my particular attitudebot.com domain.
A list of records, yes.
what about the dashboard? is there a "nameservers" option in the dashboard?
this is what i get from google images
Oh, I found it.
Alright, so a couple of questions I need to clear off my head, if I want to use CloudFlare as my DNS "authority", I have to just change the name servers, and what else, go to the A Records of who (NameCheap or CloudFlare) to add the VPS. Also, why are we not recreating all of the records in the NameCheap at the CloudFlare?
A records on namecheap
you dont need to create DNS records on cloudflare because the DNS records will use the name servers to propagate
DNS propagation is the process of sending the new DNS records to all DNS servers in the world
every time you change your DNS records, the update will be slowly propagated to the world, which is why it may take some time for your ip addresses to update
So what's the advantage of CloudFlare if I'm managing my records through NameCheap and not CloudFlare?
cloudflare is not a record manager, cloudflare does a lot of other shit like ddos protection, security, caching, etc
Oh, so if you would want to use CloudFlare, it's never a record manager?
it can be one, but its not required
Fair enough.
I'll let you know how it goes in like a few hours. š (as I'll be starting later)
this is how the cloudflare page looks like (or it looked like, idk with their new UI)
so you can also manage it from cloudflare
but it doesnt really matter, both cloudflare and namecheap's dns records will always be copies of each other
Lastly, I heard using CloudFlare will disallow you being able to use sub-domains.
So how does that work?
never heard of that
Wait, so CloudFlare uses the DNS records of NameCheap, correct, since I'm using their nameservers?
the dns records belong to the domain itself, it doesnt matter if its on cloudflare or namecheap
the domain registrar will always have access to them
and you can give access to another system by using their nameservers
very different now
i mean the layout and design mostly
they finally gave up on using top navigator
yup
about time
what is this error?
happens when someone adds my bot to their server
my whole bot crashes
show code
and as the error says at <something>.cache something is undefined
the thing is, the error is coming from the discord.js package itself
not from my code
can you show some more of your error?
like the full error
also are you using djs12 or 13 ?
if your djs is not 13.8 then you need to update to 13.8
yeah someone in the d.js server just said that
guess without evaling, will this be true or false?
!!null===null==false;
true
correct
why tho?
I'm just bored
unbore
making up weird js snippets
impossible
how about this 
(true??null===null==false)?true===true:false;
no evaling
i thought windows had a terrible c api
but after i saw openssl
was this shit even written by a human
im trying to generate an rsa public and private key pair but idk how š
i feel your pain 
i did something idk wtf this is
i dont do cryptography
i just want to convert it into a string š
so i can send it to a node server
ok guess this one
(false??null===null==false)?true===true:[undefined]==0??Number()?parseInt(null,24)===23?+false?true:false:true:true;
I don't even know what I did here
I am using discord-player package to play songs in discord by my bot.
If the music duration was to long(like 15mins or more) after this time the bots stops the music and logs this error
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2022-06-13T21:38:47.375648+00:00 app[Worker.1]: },
2022-06-13T21:38:47.375648+00:00 app[Worker.1]: playbackDuration: 939040,
2022-06-13T21:38:47.375648+00:00 app[Worker.1]: started: true,
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: silencePaddingFrames: 5,
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: silenceRemaining: -1
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: }
2022-06-13T21:38:47.375649+00:00 app[Worker.1]: }
2022-06-13T21:38:47.382557+00:00 app[Worker.1]: (node:4) Warning: [DiscordPlayerWarning] Unhandled "connectionError" event! Events "error", "connectionError" must have event listeners!
this is the code from the index.js
const Discord = require('discord.js')
const { Client, Intents, Collection } = require('discord.js')
const client = new Client({
partials: ['MESSAGE', 'CHANNEL', 'REACTION'],
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_PRESENCES, Intents.FLAGS.GUILD_BANS, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_BANS],
allowedMentions: { parse: ['users', 'roles'], repliedUser: true }
});
const { Player } = require("discord-player")
const { registerPlayerEvents } = require('./MusicEvents');
client.player = new Player(client, {
ytdlOptions: {
quality: "highestaudio",
highWaterMark: 1 << 25,
dlChunkSize: 0
}
});
This is the MusicEvents.js folder:
module.exports.registerPlayerEvents = (player) => {
player.on("error", (queue, error) => {
console.log(`[${queue.guild.name}] Error emitted from the queue: ${error.message}`);
queue.metadata.channel.send(`[${queue.guild.name}] Error emitted from the queue: ${error.message}`);
});
player.on("connectionError", (queue, error) => {
console.log(`[${queue.guild.name}] Error emitted from the connection: ${error.message}`);
queue.metadata.channel.send(`[${queue.guild.name}] Error emitted from the connection: ${error.message}`);
});
player.on("trackStart", (queue, track) => {
queue.metadata.channel.send(`š¶ | Started playing: **${track.title}** in **${queue.connection.channel.name}**!`);
});
player.on("trackAdd", (queue, track) => {
queue.metadata.channel.send(`š¶ | Track **${track.title}** queued!`);
});
player.on("botDisconnect", (queue) => {
queue.metadata.channel.send("\\ā **clearing queue,** I was manually disconnected from the voice channel!");
});
player.on("channelEmpty", (queue) => {
queue.metadata.channel.send("\\ā **leaving,** Nobody is in the voice channel!");
});
player.on("queueEnd", (queue) => {
queue.metadata.channel.send(" Queue finished!");
});
};
And this is the play code
const { SlashCommandBuilder } = require('@discordjs/builders');
const discord = require('discord.js');
const { MessageActionRow, MessageButton, MessageEmbed } = require('discord.js');
const { QueryType } = require("discord-player")
const playdl = require("play-dl");
const guild = client.guilds.cache.get(interaction.guild.id);
const channel = guild.channels.cache.get(interaction.channel.id);
const queue = await client.player.createQueue(interaction.guild, {
metadata: {
channel: channel
},
})
try {
if (!queue.connection) await queue.connect(interaction.member.voice.channel);
} catch {
queue.destroy();
return await interaction.reply({ content: " Could not join your voice channel!", ephemeral: true });
}
if (interaction.options.getSubcommand() === "search") {
let url = interaction.options.getString("name")
const result = await client.player.search(url, {
requestedBy: interaction.user,
searchEngine: QueryType.AUTO
})
if (result.tracks.length === 0)
return interaction.editReply(" No results found for this song name!")
const song = result.tracks[0]
await queue.addTrack(song)
embed
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) })
.setDescription(`**[${song.title}](${song.url})** has been added to the Queue`)
.setThumbnail(song.thumbnail)
.setFooter({ text: `Duration: ${song.duration}`, iconURL: client.user.displayAvatarURL({ dynamic: true })})
}
if (!queue.playing) await queue.play()
await interaction.editReply({
embeds: [embed]
})
It logs this in the console
[Wolves] Error emitted from the queue: aborted
[Wolves] Error emitted from the connection: aborted
Does anyone have an idea how to solve this?
delete that buddy
but well, to convert it to string use base64
idk what i even did tbh and that only prints to stdout it doesnt load it to a buffer or a string of any kind
random key doesnt matter
the key is just a sequence of bytes, u can encode it in base64 (or any other format) and decode at the other end
yeah but i have no idea how to do that
crypto++ looks more sane but i really dont want additional dependencies
js?

