#development
1 messages · Page 16 of 1
no, seriously, it makes no sense but it does work talking to a rubber duck
i have a rubber duck
but it's there as what's left of a broken love
reminds me of my ex and how good she was
where's the await
it's an asynchronous opration
you didn't even await for it
there's nothing to do on promises
@elfin tulip
Still doesnt work 
still returning undefined?
ah didn't notice the ephemeral
What do I do? or its not possible?
change the true to false
I believe ephes have a hook for them
follow up reply right?
I need it
thought of that, but again i no longer remember discord.js api
the last version i remember was 12
12 was good
yes
And still better than 13
djs lost the focus after 12
now they're chasing (or trying) the perfect api structure instead of focusing on what's important
Djs removed the disable everyone feature and I had to PR it back in because nobody knows how to regex I guess
They just only had an option to remove all mentions
You can’t, the footer just supports plain text
Anyone have any DB suggestions that I use for a Discord bot?
I've tried MongoDB and am not a fan.. Same with MySQL (however if that is a good option I will pursue it more)
Postgres
Depends on your needs tbh and complexity
Yeah Postgres or MariaDB but definitely not MySQL
The SQL language is good, but some DBs are too slow. I think postgres manages itself good, but if you need a temporary cache, go with Redis. If you hate relational, then idk. Out of my scope
I don't need to have a relational database but I don't mind them at all
I'll take a look into Postgres
How large of a dataset are you working with
Not large at all
So what don't you like about the options you tried?
Well on a small scope you can also go with SQLite tbh
Don't like Mongo because of the fact I don't really like the "Document" style of storing data
And MySQL is chunky imo
The performance is absolutely okay and you won’t reach its limits probably
sqlite is file based and can be locked by a process so multi process/machine interaction is impractical
If that is even going to happen
would be the same if you used a json as a DB
Just with the exception you don’t ruin your entire DB when placing a , too much 
But yeah I know what you mean
Anyway if somebody don’t wanna setup an own database but still wanna use SQL I think SQLite on his mentioned scope is fine
I like any client update
Now the notification is misplaced
Not to mention the overlapping buttons in the mobile client I always see
👍
For discord
I really wonder how the mobile client is being built
with their ass
Nah I feel like those aren’t client updates ruining things but more like the mobile client somehow also just renders html, css they use in the browser but literally adjusted for mobile clients of course
they should literally just make the browser discord responsive and use it to compile to android/ios
goddamn, it's react native after all
While the app itself might be build on whatever language the OS supports, but the chat here itself just seems to download and render the code when starting the app
I noticed so many small adjustments over time like an embed padding that has changed or this one above going wrong
But there has been no client update been pushed to the App Store
So the entire chat at least must use a style it seems to download and render when starting the app
_chat is just an iframe _

I don't think u should list all channels
Ah wait
Just noticed the "and more"
But well, @everyone is technically a role too
you don't say
yeah but I filtered it by guild.id, this usually worked
you can filter the everyone role by comparing it to the guild ID
also.. hastebin is dead again 😭
Use hate
have I already mentioned how bad slash commands are at registering
starts bot
command gets registered
try using it
"failed"
exactly
especially when discord wants to force us on slash commands
we should have a proper was of developing with these, expecting multiple restarts of the application
and yet everyone wanted me to use slash commands
😭

and like
its not even my shitty code
its literally the command not registering, even when it is several times
Do you might overwrite existing commands? Like registering them on any startup even if they are already registered?
yes-ish, dunno how my library actually handles it
I may need a reload feature instead of stopping and starting the bot lmao
If so that will never stop to happen
fair fair
When registering something that is already registered it cause the commands to appear multiple times and you don’t know which one is the newest
Same command names but different application IDs shouldn’t be possible in theory but still happens quite a lot
If you really wanna push the commands on any startup then use the patch method
The recommended way should actually be to fetch the application commands on the startup, compare them to your locally loaded ones and either register, update or remove ‘em
Based on a simple comparison of the names, descriptions and command options
Once your bot is in a lot of guilds and you fuck up the app commands on any startup with this double registration issue people will most likely be annoyed quickly
I tried doing that, then ran into the age old “esm file cache sucks” problem
But like I said multiple times already, the API should really return an error when trying to register an app command with the same name a second time
Since registrations are an one-time processs
But yeah…
f"?
a
/home/runner/moonbotlist/node_modules/klasa/src/lib/extensions/KlasaUser.js:26
this.settings = this.client.gateways.users.get(this.id, true);
^
TypeError: Cannot read property 'users' of undefined
at new KlasaUser (/home/runner/moonbotlist/node_modules/klasa/src/lib/extensions/KlasaUser.js:26:41)
at new ClientUser (/home/runner/moonbotlist/node_modules/discord.js/src/structures/ClientUser.js:12:5)
at Object.module.exports [as READY] (/home/runner/moonbotlist/node_modules/discord.js/src/client/websocket/handlers/READY.js:10:24)
at WebSocketManager.handlePacket (/home/runner/moonbotlist/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/runner/moonbotlist/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/runner/moonbotlist/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/runner/moonbotlist/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (node:events:394:28)
at Receiver.receiverOnMessage (/home/runner/moonbotlist/node_modules/ws/lib/websocket.js:825:20)
at Receiver.emit (node:events:394:28)
at Receiver.dataMessage (/home/runner/moonbotlist/node_modules/ws/lib/receiver.js:437:14)
at Receiver.getData (/home/runner/moonbotlist/node_modules/ws/lib/receiver.js:367:17)
at Receiver.startLoop (/home/runner/moonbotlist/node_modules/ws/lib/receiver.js:143:22)
at Receiver._write (/home/runner/moonbotlist/node_modules/ws/lib/receiver.js:78:10)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
exit status 1
i’m getting the code
taking a dumb guess, gateway not gateways
nice bot list 
it’s mine and my friends
fairs
isnt klasa dead?
i thought it was ngl
Lol they deleted my post asking for feedback on the library i sent here too on DiscordVote, regarded it as advertisment
Literally a free open source project related to discord bots, i get nothing off of it and matches the theme of the server 💀
I mean, it technically is promoting/advertising
make an alt, post here with your alt asking your main for the link to your lib, main posts link, no longer advertisement because it was asked for
:^)
true
lol
time to join with WaffleAlt
totally not suspicious
"Does anyone here have a recursive descent parser written only for math expressions in rust? Asking for a friend"
Aha… that’s the reason of the continuous djs-light ads

How can I route commands to every server? right now it only works in my "testing server".
and it doesnt work in the support server I added it to
how can I fix this?
You need to register them globally means without passing a guild ID as argument
so I can just remove that arg then!?
Not 100% about those rest methods but yeah that should be it
ok ty
The method might have a different name tho
As yours is called applicationGuildCommands(…)
Instead of importing the rest class and calling its modules you can also use the inbuilt methods of djs
client.application.commands.create(…) edit(…) delete(…)
To register em, update and delete commands
would I have to remake all cmnds with the djs way for this?
my handler is set up a bit diffrently
Not really as the property data actually is the command structure the API expects
You can log data to see the structure
You simple register them by putting all loaded commands into an array
As use the methods in mentioned above
So… wherever you load all your commands on a startup, push the module property data (which is your app command structure) to an array, then after all commands are loaded register it to the API
thanks so much
you helped me out a LOT
:) this seems to work fine
haha only if discord would provide proper audit log things haha right? Cant be discord
anyways, been breaking my brain for the past 2 hours, getting the user who deleted the message. If the message was deleted by the user itself, do nothing
I’m scared of cranelift though
I wanna finish my lang before the summer ends but I have a week left of summer
OK, i finished the bot - Determining your age and likely-hood you are real with 2 selfies and captcha on paper. to get you verified on nsfw servers that require people to see your IDs, my bot is automated and doesn't require a human. It's super cheap to have, too.
We chatted about this the other day - but now NO id is required to get your age. Thoughts?
I don’t know how people are going to feel about sending in real pictures of themselves on the internet to a bot they don’t necessarily know
I understand the purpose of your bot but from my perspective it just seems way too invasive
thousands of people upload their IDs in nsfw servers every hour lol
People post ID in servers?
sounds like identity theft waiting to happen
Or doxx
Tbh I wish to never get even close to handling personal documents, the laws are way too harsh about that
I never want to get into the business of verifying identity for nsfw/dating servers on discord in general
Sounds like a scandal waiting to happen for when a child manages to get on because your bot somehow lets them through
yo, is there some sort of way to prioritize on_message before commands on discordpy/pycord?
Currently what am trying to work on is having tags through the -tags prefix. Though said prefix also triggers the tags
figured doesnt work
Hey um im receiving the channelCreated event when a new channel is created but looks like the client isnt able to find it afterwards in the guild. @quartz kindle sorry for the ping.
Typically they blur everything but the DOB
And the pic on the license
Still risky though
How are you searching for it?
Also Tim is asleep I think so
client.context.guild.cache.get
yeah he'll see the ping when he wakes up hopefully haha
what lang/lib are you using?
discordjs
where is .context coming from huh
its the message object
What
im calling it context my bad
🤔
wait wait
Show more code than that cause I don't understand what you're trying to do here
message.guild.channels
context: BaseProps["context"],
id: string
) => {
const channel = context.guild?.channels.cache.get(id);
if (!channel) {
return context.guild?.channels.fetch(id);
}
return channel;
};```
context is the mssage object from the on "message" event
You're being redundant
both of these return 404 for an existing channel thats newly created
just tried both
to test
.fetch gets from cache first then if it can't find it will fetch the API and cache
ohw i see
So you are being redundant by checking cache and then fetching
That was just a tip
As for why it isn't being found are you sure the ID is correct?
Any errors?
nothing else just 404 lemme send the error
You're probably fetching the said channel from the wrong guild, I think it's a better idea to check that first
i checked the guild as well
the guild id is correct
name:'DiscordAPIError'
method:'get'
message:'Unknown Channel'
httpStatus:404
code:10003
path:'/channels/100461573143187460'
It's trying to fetch a channel but you are using a guild id no?
You just said you were using a guild id
no no
thats the channel id
i think incorrect id is being passed lemme do some more debugging and get back
gotcha, found the issue, its doing weird things cause of the bitint thing,
the id im getting is 1004615731431874600 but the actual id is 100461573143187460
idk probably something to do with js handling 18 digit stuff
But the ids returned are stringed bigints it shouldt have a problem no?
Strings don't have issues with length
What db/wrapper are you using?
They using djs
Dingus
yeah i might know what the problem is, im kinda sanitizing the args read for some reason i cant remember at the moment lol, im using bigint there. looks like thats messing things up
Idk if they are storing it or someone is supplying it through a command dingus
Just let it be tbh
If your convert it to a number it is going to try and correct itself
I don't remember what it's called but js can't handle large numbers
Am I wrong?
yeah js adds 00
you're right
js cant handle large numbers
gotta convert them to bitint
parse
I swear js can't handle large numbers they try and round it or whatever
js numbers are 64 bit floats
Okay well shut up Mr lang dev
discord snowflakes are usually bigints
ayy

no one:
js when it sees big numbers: 
weird
im not even converting it to number
its a plain string
okay nvm forget everything i said
the id is correctly being passed
JavaScript numbers are actually just 32-bit floating point numbers, not 64-bit; and that's where bigints come in which allow for any precision
As long as the machine has enough memory for it
I thought js handled everything as 64 bit :C
Or is that messy because of v8 object overhead and such
A little bit really, IIRC the numbers were held back from being converted to 64-bit floating point numbers because of not only heavy memory usage, but also some backwards compatibility shenanigans, I don't exactly remember what it was
wtf my lexer broke with 5 + 5
lmfao
I'm stupid 🤦♂️
forgot to emit null terminating byte
Well it ain't a marketable product, and the server is dead anyways, i could've sparked a conversation and they straight up deleted the message.
Lmao actually a good idea though it shouldn't be necessary. I sent it here and ended up chatting with a couple of fellas and it was very wholesome 👍
it's because I forgor to check if I was at the end already
Damn

a js number is double, or f64 in rust
so he's wrong, it's actually 64 bit floating numbers
Can't even write a language
Isn't it actually 2^53 for JS
discord snowflakes are 64 bit integers
Invalid, JavaScript normal numbers (not bigints) cannot exceed 32-bits precision, and they're only 32-bits in general, only bigints can go beyond that precision, not only that but the JavaScript API bindings provided for Rust using something like napi-rs actually provides them as f64 for bigint usage and conversion when needed
Don't pull out random things from napi-rs, it's not really as complaint as N-API C++ bindings which are native and recommended
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER But the max safe integer is 2^53 which is way beyond the max safe 32bit integer
I'm NOT talking about napi-rs
Look at the v8 documentation - it clearly says double
Double != 64-bits
you're both wrong
it feels old
it was indeed old
you haven't seen documentation for older C/C++ projects from the 90s
i mean it also feels like that but meh
There is a reason behind this actually, the JavaScript numbers are technically considered 32-bits, both internally and in the specification, but the value exceeds beyond the actual max value of 32-bits that it can ever represent is because JavaScript numbers are not integers, since they're double-precision floating-point numbers specified in IEEE 754, the largest integral number is chosen for this case specified in the ECMAScript specification
https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-number.max_safe_integer
then it must be double
I never said they weren't a double, they indeed are
so they're 64 bit floating point numbers

It does not count as a 64-bit floating-point number if the max value of the aforementioned numbers are far from reaching the actual max value of 64-bits
??? but their size are 64 bits
there's a reason why double is f64 in other languages
The maximum safe integer in JavaScript is 9,007,199,254,740,991, but the max value of 64-bits is 9,223,372,036,854,775,807, now think about that for a little bit
I'm NOT talking about 64-bit integers
It does not matter whether you're not talking about integers or floats, JavaScript numbers are NOT 64-bit floating-point numbers, even the 64-bit floating-point numbers' max value is way bigger than the ones on JavaScript
then how are they represented as double in v8
which is a 64-bit floating point number
the documentation in MDN clearly stated that they are double-precision floating point numbers - which is a trait of double
You're completely misunderstanding all of this, the ones shown in V8's documentation has nothing to do with the JavaScript side, these are just the types you have to use in the C++ side to work with V8's APIs, but the values you provide does not get piped to the JavaScript side, there are a shit ton of conversion that happens behind the scenes
And as such in this case, a double type in the C++ side passed to V8's API does not necessary make the numbers in the JavaScript side a double entirely, there are once again conversion you're not even aware of
then what about this?
and also this - which contradicts with your previous point
I don't think you get it, JavaScript numbers are partially a double, not entirely
What MDN is trying say is that they're a type of double, but partially; since only the largest integral number is used as the max value
But I understand your confusion, a lot of people get confused by this and there isn't an exact way to explain this
Are you even reading what I'm saying?
By my statement, THEY are a double, but PARTIALLY, not ENTIRELY
I do not know how to put it simpler than this
sorry @radiant kraken but voltrex is right
im also not getting what you said lol, js's numbers follow the exact same behavior as doubles in any other lang
Oh I meant like in the JavaScript numbers are limited in the JavaScript side when it comes to precision, for example the max value of the double is way bigger than the safe max integer/number in JavaScript
Wait oh I think I'm also misunderstanding this, the way they worded it was pretty confusing
there is a big difference between floating point and integer
53 bits is the maximum size of an integer that can fit inside a double
after that it loses precision
but floats are designed to work like that, with unexact precision
Yeah I know, I thought they were talking about something else
God all this got so confusing pretty quickly ngl
More confusing than when Bae asks for help
lmao
Ong
nah ive been wrong many times before and will be many times in the future
Working on dual support for slash commands and regular messages (Irrelevant)
Getting this error, I log the data (interaction.options.data) and it logs normally but the error still pops up
I think I know the issue
I don't have a check if the message comes from a bot (Relevant to the Irrelevant)
Okay boomer
Okay boomer
wth is a record? 
An object!!!
oh, it literally is just an object
I thought you were being sarcastic
no, I've never actually noticed records.
I'm sure I've interacted with them, just treating them like any other object
My code abuses Record<string, any> so much
Does someone know if you can access interaction.user.id before this? (discord.js v14)
You can't
thanks!
That's the option description?
I just wanted to know if I could translate that part, isnt possible then, right?
Translate, sure
On User Preference
Like supporting multiple languages?
yes
I'm not sure if it's supported in discord.js, but iirc interaction locales are released already
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Thanks, Ill look into it!
No problem
Looks like it isnt in discord.js yet, Best Option is to probably wait, Localization can always wait 😄

damn already
i remember discussing how content localisation to the end user isn't ever going to be possible like in 2018
i am proven wrong
Could always post the data yourself
And do lookups normally
Aka don’t use builders 
Just gotta account for the localized names in your handler
Does discord have an option to set the language of the discord server or is it based on user's preferable language
I haven't looked much into localization on discord
Hm is anyone having a problem with message collectors in the new discord.js release?
I've had a script that checked for certain messages in a text channel but now it's not working
It doesn't seem like the collector.on("collect") event is triggering
The "end" event seems to be working fine
I can't see anything about it in the documentation
So I'm confused
I will see next time I Update my discord.js version.
Check your filter function
I set it to just return true and it still didn't trigger the event
So I doubt it's anything with the filter
Okay I found the fix
Apparently when I was updating the code I forgot to include the "GuildMessages" intent
and that was the reason why it couldn't read them..
MessagesIntent Permission will not be so ubiquitous in the future.
let member1 = message.mentions.members.first()
let member2 = message.mentions.members.second()```look i might be the dumbest person around, but how would i get a second mention lol
wouldn't it just be message.mentions.members[1] or something?
that could possibly work as Collections are iterable, but if it doesn't you need to get the second key from the key array and pass that to Collection.get
i see, thanks papi
Could also do message.mentions.members.first(2)[1]
Get the first two and pick the 2nd one
afaik it should be .first(2).last()
actually collections now implement .at()
so you can just do .at(1) to get the second item
hmm maybe they changed it at some point to return arrays, but i remember it used to return a collection
havent used collections in ages either
what's yall opinion on this:
the urban dictionary commands should only be executed in a NSFW channel
I'd argue it depends on you—whether or not you accept "better safe than sorry" or "most definitions are fine" as an answer.
I personally like urban dictionary commands to be available outside NSFW channels for the latter reason, along with the service not being explicit in general.
It seems like they've been purging a lot of explicit definitions as well.
although I liked some of the old ones
yeah, though discord forced me to enable them in NSFW channels only even though I've explained that I had a feature that the admins had to explicidly toggle the command before use
do you think they misunderstood and it would be safe for me to remove that?
Discord typically rejects toggles provided by the bot as an answer.
For example, I wanted an /anime command I was developing in DMs to have a toggle for unfiltering NSFW entries but that was discouraged since DMs aren't technically NSFW channels.
So you're better off not using the toggle as a form of consent.
like the toggle works that the command won't be executed unless nsfw is enabled on the server - and I told Discord that by NSFW I only mean profanity and suggestive themes, not anything actually nsfw
so I mean should I keep the nsfw channel check or remove it?
Probably keep it.
I see
If discord staff told you to lock it to nsfw you should
yeah I didn't actually plan to remove it. Was just curious about what yall think
It feels weird, but maybe discord is being more strict about it.
they are. I remember having a urban command back in ~2020 as well and they didn't care much
btw does this look ok or should I try formatting it differently?
2 years have passed, much has changed
u could use emojis for true/false
agreed. I was able to get 2 of the main privilidged intents quite easily and fairly tbh
you think that would look better?
hmm I don't think that would look as good
do you guys think having a switch case is better rather than multiple else if statements?
Generally yes, but if it's just a few comparisons, it gets optimized to be the same as the switch statement, so not much difference if you don't have a lot of comparisons
wait @earnest phoenix I do agree with you but
YOU CAN'T have variables in a switch statement? why is this the first time I've ever heard of this?
You can have variables in switch statements, but in the case blocks, not outside of them
yeah the variable in is a case block
Can you show more of the code?
perhaps I structured it wrong? I've got no idea
Does ESLint still complain about it?
yeah
Then that's because your case block does not have a scope ({}) wrapping it, which causes the variables to extend beyond that case block
what do you mean? Do switch statements in JS need that?
switch (action.toLowerCase()) {
case "edit": {
// CODE
}
}
``` like this, really?
first time I've ever heard of something like this lol
It's not needed, but it's recommended when declaring variables, so they don't conflict with the variables on other case blocks
I'll keep that in mind, never actually heard of this before
can you put anything after the break; statement?
I was hoping I can use it like a return; statement
For example
switch (foo) {
case bar:
const baz = 1;
case biz:
const baz = 5; // SyntaxError: Identifier 'foo' has already been declared
}
This is where not using scopes in case blocks can be problematic
I see that kinda makes sense
u can use {} anywhere u want if u must create a new scope
The break keyword in switch statements exits the said switch statement completely, but I don't know why you would want to have anything after it
{
let abc = 1
}
{
let abc = "abc" // doesn't care about the former declaration
}
useful if u couple with labels
scope: {
let abc = 1
if (abc < 2) break scope;
// other code, wont run
}
I was hopign it would act like a sort of confirmation like return does
how do I get defaults in JS again?
like if you have a switch statement and none of the options were the one you predefined I want to have a default option
case default: {}
gives an error
I am
It just needs to be default: ... without the case
oh I see
hey @lyric mountain i was wondering, how do you go about caching the "books" on your pagination project? do you use (e.g) guava for caching or you do some shenanigans to make the book persist over reboots?
sorry for the ping, i'm making some changes to my project and i'm always sure i'm missing some important thing.
book?
like, I use a copy of the collection of Page (or InteractPage for buttons) passed to the function
so as soon as the pagination ends it becomes available for GC
wondering how to attempt doing a command cooldown?
yeah, using "book" for lack of a better word
with book i mean the messages that have pages and such
so as soon as the bot restarts you can't pick from the list or go through the pages right?
self-expiring collection
yep, if it's necessary the user can recreate the action on startup
although I might do something regarding that later on by serializing event metadata into the custom id
the major issue is that my lib isn't just for pagination, but for categorization and buttonization
(and lazy pagination)
id of the buttons, you mean?
yep
cause those are restricted to 100 chars each
there is nothing on it on google. Could you give a code example?
afaik
1000
lemme check
well it's a race then though i'm pretty sure it's 100
yeah i thought of that and discord.js said 100 chars
I could use an sqlite file, but idk if it's any worth
but could've been outdated
I will tho add some handling for lost events so people don't get "Unknown interaction" error
yeah i fire an event if the book cannot be found, though i do "workaround" the issue by making the library's firsthand purpose to create static precreated books with IDs
if buttons had 1000 char limit on ids though
i guess a link that takes you to a json file with the info to display would also work, add that to the ID and query every page
then hosting that locally and such, hm
don't think it's viable
i mean you'd still need to purge the cache so yeah
you could use an sqlite database as a cache layer
since your case is purely text stuff
// Lets write some code for our cooldowns.
// I know some people gonna hate me for that, but as the code is going to be quite short,
// let's not put it in the functions module.
if (cmd && container.cooldownCache.has(message.author.id)) {
return message.reply({
content: `${message.member} you're still on cooldown from the previous command!\nYou still have ${timeAgo(container.cooldownCache.get(message.author.id) - Date.now())} left.`
});
} else {
container.cooldownCache.set(message.author.id, Date.now() + 3000);
setTimeout(() => container.cooldownCache.delete(message.author.id), 3000);
}
``` my first attempt at a cooldown? I mean it appears to work?
serialize the entire thing and compress the bytes before storing in a blob column
i'm already caching on a guava Cache for the unreleased version which i think is enough for most cases but
it's never quite perfect isn't it
guys?
npm -> expiring-map
yeah, emphasis on "unreleased", i'm still not sure.
maybe it's better to just leave caching to the user
setTimeout is a pretty bad option
considering your cache would have thousands of concurrent entries
I'd go for an optimized lib instead
can you give me a good library for it then? googling expiring-map npm gave me 100 different results
grab the one with most downloads
this one seems good https://github.com/isaacs/node-lru-cache
which one do you use?
I use java my boy
actively maintained too
there's also redis, but idk if it wouldn't be too overkill for that
anyone know this next.js error?
next build
> Build error occurred
Error: spawn ENOMEM
error no memory
usually cpanels and webhosts give you like 100mb of ram lol
because they expect you to run php most of the time
nah it shows i’m using 179 mb out of 2
i have ran it up to 1.5 gb before so ik there’s for sure ram
there’s just some issue with it
do you have any way of monitoring it live? like second-by-second changes
179mb out of 2mb? 👀

keep getting this error
You're not catching an http request that throws when it gets a non-successful status code
oh
403 means missing permissions btw
ok
So either you haven't set something up correctly (the more likely option), or the package is broken
I don't know what that is
if you believe it's the hosting provider's fault, contact them
and THAT package specifically
had many issues with sedmelluq's, dropped the music thing entirely
it's just not worth doing music at all nowadays
is there a way to get a list of servers my bot is in using py?
weren't u using java?
it’s another bot
but oh well, just get the size of guilds collection
My friend needs help
TokenError
at Strategy.OAuth2Strategy.parseErrorResponse (/home/runner/moonbotlist/node_modules/passport-oauth2/lib/strategy.js:373:12)
at Strategy.OAuth2Strategy._createOAuthError (/home/runner/moonbotlist/node_modules/passport-oauth2/lib/strategy.js:420:16)
at /home/runner/moonbotlist/node_modules/passport-oauth2/lib/strategy.js:177:45
at /home/runner/moonbotlist/node_modules/oauth/lib/oauth2.js:191:18
at passBackControl (/home/runner/moonbotlist/node_modules/oauth/lib/oauth2.js:132:9)
at IncomingMessage.<anonymous> (/home/runner/moonbotlist/node_modules/oauth/lib/oauth2.js:157:7)
at IncomingMessage.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
// Login endpoint.
app.get("/login", (req, res, next) => {
// We determine the returning url.
if (req.session.backURL) {
req.session.backURL = req.session.backURL; // eslint-disable-line no-self-assign
} else if (req.headers.referer) {
const parsed = url.parse(req.headers.referer);
if (parsed.hostname === app.locals.domain) {
req.session.backURL = parsed.path;
}
} else {
req.session.backURL = "/";
}
// Forward the request to the passport middleware.
next();
},
passport.authenticate("discord"));
// Callback endpoint.
app.get("/callback", passport.authenticate("discord", { failureRedirect: "/" }), /* We authenticate the user, if user canceled we redirect him to index. */ (req, res) => {
// If user had set a returning url, we redirect him there, otherwise we redirect him to index.
if (req.session.backURL) {
const url = req.session.backURL;
req.session.backURL = null;
res.redirect(url);
} else {
res.redirect("/");
}
});```
how can I get users discord badges?
what library are you using?
passport-discord I assume, not just passport
yeah but i would have to reload the page
lol my ban comamnd is going to be 250+ lines long after the rewrite 🤣
👀 how?
I'm kinda adding everything I've recently added together into that one command. Meaning it checks for every permission, level and roles
then DMs the person
Logs the details
and sends the confirmation
the logic is about 150 lines long 🤣
and the embeds are the rest so 100~
🤔 most of that could all be done in a single handler once then reused between commands as much as you want
I can send you the code in DMs once I finish so you can see for yourself if you want
eh
I dont think permission checks(even if it includes levels and roles) need to be unique for the ban command.
I'm putting a couple of variables that my bot creates by itself that's why it rather had to be unique
had to be unique to the ban command?
or unique to the bot
I guess my point is it would have taken you pretty much the same amount of time to write it in a way all your commands could use it if you felt it was needed.
that way if you ever want to use it for any other command it would be easily added to that command in a couple minutes.
Well the optimal OOP solution is a class related to your application to define functions like this you’re going to use in your entire project
(over and over again)
People still do permission checks in the command itself?
some do
I bet its pretty common to tbh.
That's just dumb ngl
Just define the permission it requires in the command and check it in your handler
I dont think the djs guide covers it 
That simple
Not really, you don’t need to throw an error if just one permission is missing
No cause they value being inefficient asf
Wait what?
You don't alert users when they/the bot is missing permissions?
For example my config command covers several options to adjust the bot for example just listening to specific roles, channels etc.
And it comes with the possibility to change its nickname which does require the ChangeNickname permission
Of course I only check for the permission when running the command
Why would I throw an error for the entire config command where only the nickname adjustment (sub command) requires a permission
While the command handler itself of course checks for user permissions when executing a command
But app permissions itself are still check whenever you execute stuff to ensure to have a proper error which permission might be missing
Instead of. hey, I need administrator permission please

Yes I do that’s what we were talking about or not?!
We were talking about handling permissions
People do it in the commands when they could just do it in a handler so they don't repeat code
I wasn't part of the conversation at that point and didn't notice

I always join conversations midway through
Not only in the handler but also inside a command it’s sometimes required to check permissions for parts
Why would you need to ever check permissions in the command itself?
Your handler could easily do that for you
You can have your handler manage both

That's what I did
When I made my own framework
That wouldn’t make sense in my specific example I mentioned
It's always confusing talking to you
I'm not
You think that's an insult?
Why would I wanna be lumped with a bunch of bot devs
You guys are nerds

Sounds like green names doing bot development exclusively 24/7
I remember you had a green name in the past, too makes you one of us, one of us, ONE OF US
i’m one of you guys
member.bannable doesn't work on people that aren't in the server?
how do then bots ban people that aren't in the server?
what???
how do you do that?
😭😭😭😭😭
thanks
true, real devs make wordpress sites.
TRUE!
I only did that for the bot dev vc channel
The bot I submitted I sent 2-3h max and never touched it again
Question do you just ignore the documentation existing or?
how would i make a slash command that is inaccessible to all users but me?
i have a few administrative bot commands that i want to convert to slash commands, but i dont want regular users to be able to use them or even see them in the list of possible suggestions
anyone know alot about next.js? i get this error running next dev (only on my cpanel not locally):
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using experimental wasm build of next-swc
warn - Attempted to load @next/swc-linux-x64-gnu, but an error occurred: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/<redacted>/nodevenv/<redacted>/14/lib/node_modules/next/node_modules/@next/swc-linux-x64-gnu/next-swc.linux-x64-gnu.node)
warn - Attempted to load @next/swc-linux-x64-gnux32, but it was not installed
warn - Attempted to load @next/swc-linux-x64-musl, but an error occurred: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory
event - compiled client and server successfully in 25.8s (601 modules)
Your machine has an older version of GLIBC instead of the required version which is 2.14
https://superuser.com/questions/537683/how-to-fix-lib-x86-64-linux-gnu-libc-so-6-version-glibc-2-14-not-found
how would one install this on a cpanel based hosting
The cpanel should allow you to install anything you want, so just install it? Or does it not allow you to install anything?
id have to do it with ssh but im not sure where i would install it in the project directory? or
GLIBC is a global library you have to install, not in the project directory, just follow the installation instructions, you can look them up with the specified version
alright do u think i should just use these steps:
sudo apt-get update -y
sudo apt-get install -y libc6
Before that, try running this and see what it says
$ sudo apt-get update > /dev/null && apt-cache show libc6 | grep Version
alright hold up give me a minute
@earnest phoenix namecheap support is a joke man, i dont have root access so they have to fix my issues and she said "Regretfully, it is not possible at this moment, but we will upgrade it in the near future."
i pulled out the "ive been with u guys for 3 years and ive never seen such horrible support" and now she is trying to resolve it
LOL

current ver is 2.12 btw
Hey guys, how do i migrate my slash command to an app cmd?
as in moving the logic out of a discord bot?
it was apparently called a context menu
is it not possible to add an option to a context menu? Just like a slash command
ah right, question was a bit vague
Not sure, I think the context menu just shows your app - not explicit options
The latest stable version is 2.35, so that's probably why; you gotta update it
yep and namecheap is being stupid saying they can’t update it
and that i’d have to upgrade my plan again even tho i did that yesterday just to try to solve this as well
shared hosting is pretty trash, cPanel more-so
is it server-side rendered next.js? or static
considered something like Vercel?
just get a full vps and make your own webserver
VPS is overkill for a single website IMO, it just becomes another thing to maintain and security can be easily neglected
then you have to live with those limitations
Shared hosting, or VPS? 😂 come on now, there's so many practical options these days
even Github pages is pretty good free static site hosting
- Cloudflare workers (free tier) for any server-side logic
😂 I went VPS and then back to running containers
VPS is just simple though, in a good way
I like the pain of doing things with complexity
(I used to work for a domains & web hosting company, can't stand cPanel at all now)
#logs "safe-bot" it's even scared
:D this is only meme please don't kill me
does anyone have a clue on how Dyno has the same command with a prefix and as a slash command?
theres 3 websites running on the cpanel currently
along side with a couple sub domains running node.js applications
wym?
you can do /serverinfo as well as ?serverinfo
yeah slash commands arent enforced yet
end of this month is when u HAVE to use slash commands
yeah, but thats not what im asking though, i'm curious how nooblance made it so he can run the same command with and without the prefix
he could have 2 seperate folders
idk that makes sense to me
one with slash and one with prefix
or his interaction handler can just transform into the handler we are all used to like converting options to args and just using it that way
who knows but it doesnt really matter anymore
less than 30 days until we all have to use sash commands
thats what i thought haha, and i'm trying it out but it keeps interacting with my slash command even though im written the handler in a way which it shouldn't
probably, sometimes talking it out with someone helps. coming back to bot dev after like 2 years
and also im really disliking discord.js since the v12 update, eris seems to be a much better option
yeah discord.js really fucked up from v12 to v13 tbh
so many changes
im not even don with my rewrite yet
and v14 dropped
lol
yeah, i had completely stopped developing my bot around the time discord.js v12 dropped and i came back to it after a few months just to maintain the code and realized so many things had to be written
and since then ive just been on and off with the bot dev
yep it sucks
its horrible
idk why discord.js insists on making it so hard for everyone
yes, could you tell me more about this? i completely forgot that this was gonna happen haha
its so bloated as well man 🤮
well message content is an intent now and even if u have access to it its not made for commands so you need to convert to slash commands by the end of the month and if your bot has some soort of feature that uses messages then you need to apply for the intent
is there an FAQ link for this?
that is crazy to me man
yep
As the popularity and number of Discord bots grow, it's important to keep our users and developers safe and healthy. This means from time to time, like any maturing platform, we need to update our ...
thank you
i kinda like slash commands tho i just wish i didnt have to rewrite my whole entire bot for it but it is what it is
I wonder what the big bot devs are thinking about this
I think they gave like 2 years time to transition to this if im not wrong right?
I've been using discord for so long and I really dislike slash commands because I'm so used to just doing a command with a prefix, I get that they "make" things seem clearer and easier to understand but yeah i'll just have to get used to it
Nah you don't need to if you have the intent
yeah ive been using discord since 2016 so i agree
same 
gotta be cap cuz thats the whole point of slash commands
2015 here :prayge:
Well...
Technically, we can’t stop you. This being said, we hope that you’ll come around on slash commands, they’re the bees knees.
It should be noted that if we suspect you of implementing a featu...
i forgot i dont have nitro anymore 
It's good to support both though, or try supporting only slash commands and make your users switch
oh wow
yeah im gonna support both then
thats great
how do you guys go about logging errors for ur bot? Do you just have file that you write to during each error?
use winston or create ur own logger 
i use sentry
alpha, I've never heard of either. Time for some research ty
Hehe, like everyone else
actually i use print()
console.log(err)
client.executeWebhook(blah, blah, blah blah)
I use a combination of console.log and logflare
is eval still dangerous if I only allow numbers and operators?
for example, remember jsfuck exists
doesnt that require [ ] and!
would anyone be up for stress testing my bot? I have a couple errors that I wanna fix but not sure where exactly they come from
my guess would most likely be permissions
when you no debug
Well when awaiting your promises and have some sort of error handling where’s the issue to debug things?
Might also be a good idea to log your errors to an error log file
Instead of seeing them fly-by in your console
yeah I am doing that
the console just doesn't go far enough back
I can see max 2 errors out of 100
blame pterodactyl
use a logger or webhook for errors if your console doesn’t go back far enough for some reason
If you’re using pm2, you can type pm2 logs —lines 100 or something along those lines to view your logs for a specific amount of lines
I could just DM the error to myself ig
I'd still prefer if someone could stress test
just so I know everything works correctly

it was mostly because for some reason guilds were adding my bot with literally no permissions
not even to embed or attach images permission
hence the errors and not even a single command could be executed
I meant the way "nature finds a way" when dealing with js
people can do weird stuff with barely any operators
JS park
lmao
JuraSsic Park
anyone know CSS?
was trying to decrease the size of my image but it was blocked by a flex div above it
anyone know how to center this as well?
nvm found a way
With css there’s always a million solutions to a problem tbh
Which is part of the reason why I hate it because I don’t know which one is the “proper” way to do it
if there is a solution can you tell me how to pad the text away from the image 😭
<img height="35" width="30" src="https://cdn.discordapp.com/attachments/700590466277572698/1005157792128192582/svgviewer-png-output.png">
Add To Discord
the button broke after I did that
<a href="https://discord.com/oauth2/authorize?client_id=973306610501947423&permissions=1530354068598&scope=bot">
<button class="add_to_discord" style="margin-inline-end:28px">
<img height="35" width="30" style="margin-top: 5px;" src="https://cdn.discordapp.com/attachments/700590466277572698/1005157792128192582/svgviewer-png-output.png">
<a style="padding-left: 10px;">Add To Discord</a>
</button>
</a>
``` only the image seems clickable now
button inside a doesnt work
you can remove the button element and use css to make a look like a button
or you can use a button element with an onclick function
can I do that with html only?
it worked for me until I added the second a element
it still works but its not officially supported, so it has bugs like those
I see
no
I was hoping you could show me how the website looks on mobile
haven't actually tested yet
You can view sites as they look on mobile from your browser
are mobiles even real
f12 click the button that looks like a phone, its in the same spot on most browsers iirc
no they are a punishment for sinners
pure hearted people dont know what mobiles are, they are not real for them
😭
can you guys rate 🤣
http://butler.only-fans.club/
A fast, refined, and cleanly written all multi-purpose discord bot.
looks good
hey i cant figure out how to do something like this for my bot's readme
-128/10 not secure
inline pictures, set width and height
[<img src="https://github.com/laralove143/timezoner/raw/main/add_to_server_badge.png" width="113"/>][bot_invite] [<img src="https://github.com/laralove143/timezoner/raw/main/join_support_server_badge.png" width="146"/>][server_invite]```
how to inline
i dont get what you mean by inline
these two are inline
a b
these two are not inline
a
b
I don't have cloudflare yet
thanks
looks alright otherwise assuming the site is still not finished on contents
oh they are in line for me
its just discord wrapping
I'm planning to add a dashboard on some docs for all of the features and commands
tfw different markdown interpreters
maybe add some animations as well
if i make not even a space they appear on different lines but now stuck together
separate them
dashboard.bot.tld
docs.bot.tld
Ads ban ban ban
why not just make a separate page?
url.com/dasbhoard?
they are separated web applications
why must you log in on an introduction page
💀
doesn't make sense to me
I have a weird scenario.
I'm using CF, Nginx, & next.js
When visiting the home page using the domain I get a 204, if I add a query string I get a 200 with a full response.
If I load a page other than the home page I get a 200.
If I load a page which returns a 200 the home page will also then return 200.
ie
example.com/ returns 204
example.com/?t=t returns 200
example.com/faq returns 200
IP:port/ returns 200
loading example.com/faq then clicking on a button that sends me to example.com/ will return a 200
Any ideas?
even of where to start to debug this issue.
I disabled the nginx default site and visited via the ip
IP:port/ returns 200
Wall of text time ^_^
me when idk network protocols
nah didn't mean that
I'll make a couple different pages
a separate /login page that will then forward u to the /dashboard page
bot.com/docs is a bit weird tbh
I need a better domain tho definitely 😭
because again there will be sub paths after the stuffs
I want to have something like butler.com but it costs 15k
people care about how a domain url looks?
just do butler.bot
how much does it cost?
I'm also a student
gimme gimme rn

but 
i'll make it bigger at least
omg the hitbox is the whole line
what interpreter yall using
lemme see ur website 0_0
💀
they give free domains?
got a .tech
:[ idk even know how to set up cloudflare if I'm honest 😭
always either used a non secure connection or a premade provider
its topgg
let me see
genshin website tbh
when ur phone can handle the game genshin at ultra but not the genshin website
my bio
view in desktop mode btw
nah
my site ain't some static video playback
genshin website has minimal animations tbh
just stopped to think sayu, did u add bg music to the site?
this is the only way the gap looks acceptable
i remember sharing the progress here
what
must've missed that
mmm
background music
i don't know if i should
to add to ambience
to add to the topic, it's mostly done in vectors
aka svgs
why won't my iframe work?
https://top.gg/bot/973306610501947423 it's literally empty
the animation was pure math
I can see that
god damn
that's so well made




