#development
1 messages · Page 2078 of 1
Which if your bot grows may lead to a semi noticeable change in ram due to all the strings you’re caching
These types of optimizations would barely be noticable when running them a few times, since you're running them all the time in a Discord bot, it will be noticable, especially under heavy load
As of right now you will notice no difference, but I’m sure you don’t want to continue writing it the same way and in the future have to rewrite all of it because you’re wasting performance
Regardless of them being noticable in your case or not, it's always better to optimize things
are all discord channel ids 18 characters long?
Think of your poor ram sticks seeing strings that should be bools
Unless it has a high risk of breaking something
They would cry
no
i see
Older ones are shorter
Discord IDs are snowflakes and keep growing infinitely, so it's better to not assume their maximum length
i see thank u
but you can predict when the next length change will happen
I believe there’s a utility class that has a helper function in djs that has a regex for checking if something is a snowflake
imagine assuming snowflake is fixed length
Something like SnowflakeUtils
(I think?)
When saving them to a database just choose big ints
If that’s what you wanna know regarding char length
yay internet back 
Soon no more new messages and channels
string with 25 max length give or take
bigints take less memory!
Why not choosing longtext instead

I mean you can go for saving anything as binary data
haha funny you assume that came from djs
Then unhex any shit in any query you send
0000001110110001111000011010010001010000000000100000000000000000 > 266241948824764416
SnowflakeUtils came from Sapphire
so does parseBoolean exist in JS or not?
why would u need it?
or is that a java only thing
if my math is correct
everything is a boolean in js already
Didn’t you say your bad at math
what's the best way of casting "true" into a bool?
yes
So wanna place some bets ?
eval("true")

"true" == true
aboose js' weak comparison
😐
it's the best
Prove me wrong and I'll kiss your mom
The global Boolean constructor exists which can be called as a function, but you can also just use the logical NOT operator (!) twice
eval(client.token)?
ah wait, it doesn't work
not in this case
But that just considers the length of the string, not the content of it
that wont differentiate between "true" and "false" tho, since both return truthy values
ye just go with eval ig
Boolean(variable)? doesn't that just check if the given variable is a boolean? does it work like a convertion thingy as well?
u could use jsfuck logic to unwrap it, but it's gonna result in lengthy code
did you forget that people can set the value to whatever they want
id just do this ```js
if(str.toLowerCase() === "true") { return true } else { return false }
did you forget you shouldn't be the one doing this not them
how is that any better than my string comparinson?
I suppose ur trying to migrate ur database from string booleans to actual boolean right?
i mean for converting your strings into booleans
and then saving the booleans instead
yes
then "people" is only you
so in the future you just use booleans directly and not strings
Who tf saving booleans as strings in a database
My gosh save a number 1 or 0
my man doesn't trust himself to use eval
evalGang
Or… use bool
I don't lmfao would you
loop through all entries, change them to their actual bool values and then save
Ain’t a thing in sql
what
postgres: 
Shut up with your postgres

Yea because if I manage to leak my token in an eval command on my own accord then that’s my own damn fault
imagine leaking the token to yourself, you might invade your bot
My guy has internal demons telling him to leak his bot token or something
https://mariadb.com/kb/en/boolean/ ??????????
TINYINT(1)
fake I feel like you never read documentation
Yeah that’s what I said
people always bringing docs outt against you
dude u shouldn't be using eval in any sort of code in the first place
changed them from strings to bools
😉
for a one-time refactor? eval is fine
But not boolean as type
also I do use eval frequently in my bot, there are valid reasons
you do you I don't think I wanna risk having an eval in a place where people can mostly input their own stuff
I didn't say "open" eval tho
limit it to only you
eval is just a tool, a way to execute arbitrary code during runtime
what?? but the point of my bots setting system is that they can customize what the bot can and can't do
Using eval in this case is extremely dumb and risky
I mean, u definitely don't need to use eval for a simple setting toggle
He's migrating db
What's wrong with that
we're saying that it's fine for using eval if you do need to
tho I know better options
it's not a "forbidden" feature
I don't think this is what they're trying to point out, they mean the users can input anything which they might pass to eval just to check if it's a boolean
voltrex is right
exactly
if string === "true"
If they're just checking for the database values, they can indeed use eval to overwrite the values they need for the migration or whatever you want to call it, outside of it, just compare
bro I'm editing that right now stop being salty
😠
just do ```js
if (feature) {
send("Feature was disabled")
} else {
send("Feature was enabled")
}
feature = !feature
I'll just do something like this
const convertBoolean = function(_string) {
if (_string === "true") return true;
return false;
}
``` before you start saying anything after clearing my DB I'll put it in the command that changes settings, not in any event
I think that's fine. Definitely better than putting an eval there instead lol
It’s automatically false if it’s not a string being true?
That’s what you really want?
yes, that will make it if people put something like fuhh43t3t9th3h9h3th38 into my DB it's gonna be false
I said that they can put mostly anything there
Uncaught TypeError: Assignment to constant variable.
tf
But let's consider an edge case, what if the user wants to put the value true as a string instead of a boolean
cant u just _string.equalsIgnoreCase("true") then?
never heard of that function
what does it do?
For what sort of features or options people can set own values which being saved in your database?
Since you seem to allow them to put anything in there, and you also check for the boolean values directly by comparison, it becomes an edge case
idk if js has that, it's literally what it reads
To clarify that
it's an equal that ignores case
It's better to ask the user's consent each time
or else return _string === "true"
That's just <string>.toLowerCase() === ...
And the other operand being lowercase as well
ye, I though js being js had something like java's equalsIgnoreCase
gonna be clearing the entire DB, lets not bother changing individual things
my bot isn't really that big for people to care
(I hope)
the thing is```js
if (something) return true
return false
then what would you do?
just return something
You mind respond to that just for me to know?
The main thing you're doing wrong here is letting user input anything they want, you're supposed validate them in some ways
roles, channels, messages and settings
Pretty much depends on the feature
I haven't sorted it much yet that's why it looks kinda ugly
if "true" convert to true if "false" convert to false if anything else leave it as string
This is also where slash-commands can help a lot, since by type of the values, the server-side validation of Discord can help narrow things down to make it as efficient and easy to work with as possible, but I suppose you aren't using slash-commands for whatever reason
fair right?
string.toString()
So it can only sorta contain any user input for like a welcome message for example but anything else being enabled or not needs to validated in your code as Voltrex said, then inserted
that reminds me of reddit's isEven internal meme
just for debugging
just return string lol
that's why if it's not a true or false return
exactly
lmao
Yes for like anything else that allows random user inputs
fot the rest you do string.toString()
But the way you designed that is already weird tbh
you are the epitome of yandere dev
Gotta love how almost every problem ItsOkayBae encounters takes about an hour to resolve, literally almost every time
I know you for an hour and you already did
string === "true"
string.toString()
and refused to use eval()
I can I not harass you
now my thing doesn't regognize anything that used a bool input
because every time there are 20 people "helping"
:^)
Sounds like the daily discord.js support channels
susport

😦
Well at least kudos for you to come up with problems that hard to resolve, must've taken you a long time

ripperino
Oh lord, we'll be here helping them rewrite all their commands
pepsi
‘My bot ain’t working anymore. Why?’
Coca-cope and Pep-seethe
Soon chargin cash for support will save your monthly income
Tim finally can afford to buy some food

🤨
a lot of it will come from ItsOkay


If helping in #development was a job
Tim would be a billionaire
:[
@ancient nova would be broke
Or let the owners of the server pay you so the people asking for help don't have to
anyway I got it working I guess
Last members left in topgg would just be some anime nerds

what is the definition of a weeb
even tim is a weeb
*weebs
that would be cool but realistically they would just find someone else to do it for free lel
🤨
You
Wait until the premium features release!!
tim if you got paid 50 cents for every person you help but now you'd have millions
Only premium commands
not me >:[
And one not premium command telling you to buy premium
xD
are you talking about mee6 lol
dont even know any bots lol, just heard it's name quite some times
and no
that will be become the future of most of the bots
if this sort of feature will make it's way into discord
but since its about earning cash, it will most likely
nice
if I continue making bots when that happens I'll probably still make it entirely free
poor planning
that's what they all say
with optional donations kek
Don't rely on people to just donate
aye
Chances are if they don't have to no one will
or you will end up like tim
I mea that's what most indie game devs do

🤣
that's still just donations
most indie game devs don't make their games paid unless there's a big reason
yes but that is with the promise of returning the product
if someone went on kick starter and didn't do what they said
shit would happen
twitter would cancel them lol
there's probably legal consequences as well
yeah most likely
Unless there is a valid reason as to why they couldn't achieve it
they would still have to give mooney back
or people would be mad 🤷♂️
wick wilding
it quarantines anyone who gets a role with even the slightest hint of permission
makes sense
that role wick adds probably can only be removed by people with higher perms
at least that is the only reason i'd see it being a thing
it would prevent rouge staff from adding it to people
smart
but also kind of annoying
why is it null?
What did you change it to?
reset the nickname
I would recommend using displayName if it is still a thing
iirc it checks for a nickname first
then displays a username if there wasn't one
the syntax hightlight is freaking out
like I said
displayName
gotcha
i'd use display name for both btw
in case the user comes from their username to a nick
If you reset it of course it'd be null?
they already discovered that flaze
Why in the world do you pass arguments of your methods in new lines? then defining a var right behind it non using a new line?
smh
my gosh
no I'd assume discord.js would handle that as a wrapper and display their original nickname if it's reset
Just change it to [reset] or None
well the prop is called .nickname...
what?
or they could use displayName
If it's reset it's reset
That shows the username if they have no nick, that's inaccurate
it is just tracking what their name in the guild is
so if it's reset then the username shows up
if they have no nick it shows their username that's accurate, no?
But it's called nickname though
If they have no nickname then it should say so
Ykwim

That's ambiguous
ur ambiguous
😭
I don't log username changes as they're not related to the guild
I ony log nick changes
what is it?
classroom of alites
but username changes also happen in guilds?!
or whatever'
wot
oh... why did I step in
ofc they do
the main character gives me the vibes that he wants to kill himself 24/7
he never has his eyes open all the way
Maybe that's why I love it
damn
I could relate
flaze you ok?
/S
wanna talk?
🤨
tf you're talking about
No I'm fine lol
must be some weird anime stuff
Still no anilist account?
How
I've watched so many
I keep a gsheet of all I watch
gotta transfer to MAL one day but...too many for little motivation
MAL is there for a reason
@near stratus Привет.. \ Hello..
hello
I wanna make an invite logger, how exactly would that work?
fetch all inviites
save them
when someone join
fetch again
see who's value increased
keep doing it
for every guild
maybe something that just tells who invited instead of saving invites?
discord only provides guild info when someone joins
or just telling the user who joined from what invite?
nope
also which one is better?
is inviteCreate event not real then?
that's probably when someone creates an invite
not when someone joins with a invite
This event only triggers if the client has MANAGE_GUILD permissions for the guild, or MANAGE_CHANNELS permissions for the channel.
keep that in mind
Emitted when an invite is created.
onGuildMemberAdd is what you're looking for
I see so there isn't an event to get information about who used what invite?
not that I know
can you check which invite the user used?
told you
okay I know it provides guild info I already use that event but can you somehow get out which invite was used?
@ancient nova https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/coding-guides/tracking-used-invites.md
Neither this or that will show any informations about this
ty
once you get limited or miss an invite it may count the member to the wrong invite
so pretty useless package
cache all invites
user joins
fetch invites
check which one increased
check who created that invite
it's only option I can think
I don't actually want to count though, I just want to say which invite the person clicked to join the server
you can't do that without counting
You can't, once again
It's just discord being gay over everything
You can only try to see which invite increaes it's count then assuming the last joined member used this invite
I see, then I'd rather not make that
there's no sense to determine this information
it might be important to who created an invite and maybe how many members joinend using it
much more information isn't important
I'll wait til discord maybe gives us the endpoint to check which invite was used cause I know for a fact that they log that since it shows up in the guild settings
they only tell you the amount of members joined using that invite
that doesn't mean they log the member who used which invite to join
you'd be surprised with the amount of stuff you need to make yourself because discord doesn't provide required info
they just increase to number by one, once a member successfully joined
that becomes a problem with join rewards cuz you can join using as many invites you want and leave
join rewards
tf
there seems to be a weird idea for anything
´here get some virtual cookie emoji as reward´
smh
it also tells you who created the invite and the invite code which is exactly what I want
yes something the event also tells you
do you actually read your own messages before sending?
it also tells you who created the invite and the invite code which is exactly what I want
yeah the settings menu IN a guild not an event
the event tells you exactly who created it and gives you the code
tf you're arguing about
huh
that's inviteCreate event?
yes
it tells u exactly what invite was created
but u can't know when it's used unless u track it urself
why white mode
why this question
cause white mode bad
I'll call the event inviteUpdate, since I'll be tracking when the invite changes
hurts your eyes, can't use it when it's late at night and is generally bad
the best thing to have
aye
just to summarize this
1min of searching around in the docs, will prevent 1h of discussion in here
just to say
life is short, same the time you can
tf is the difference
there is select menu lesgo 
smh
you can do that with bots now?
No
bruh u got my hopes up for nothing
ye?
wot
thats a bot bro
u can do that
💀
it's an unannounced, still in testing feature
not more and less
copium
i am using v13
you pass a select menu component to your array of fields
.8.1
const announcementModal = new Modal()
.setCustomId('announcement-modal')
.setTitle("Make an Announcement")
.addComponents([
new MessageActionRow({
components: [
new MessageSelectMenu()
.setCustomId("annpouncement-channel")
.addOptions([
{
label: "Channel1",
value: "Channel1",
}
])
]
})

imagine using builders
worst thing to ever happen to mankind
can you do that without command builders as well?
interaction only like
this is my code rn
:c
{
title: "title woo bad",
custom_id: "custom_id_evil_evil",
components:
[
{
type: 1,
components:
[
{
type: 4,
style: 1,
custom_id: "field1",
label: "label aurel also bad",
placeholder: "enter something or die",
max_length: 69,
required: true
}
]
}
]
}
there you go a modal object as the api expects it
doesn't work on mobile
eh
that's even worse
like literally doesn't appear on mobile
nvm
anyone here good with cloudflare? im struggling with setting up page rules to redirect
not gonna do that
so if its required, it doesn't work
I'll maybe try doing that once it's no-longer-in-testing-and-is-fully-functional
but that's one of the only things I like about the interaction system ngl
soon 2032
💀
maybe 2033 if people going crazy in the winter again cause of some covid flue
so... expect 2042
well... you discovered now what people already been using for quite some time
reminds me of Kolumbus
never acc knew about this tho
so that's pretty freaking cool
i mean that button is quite useless but why not
you can just respond to a command interaction
yeah but it looks cooler this way soooo
I said it looks cooler like this rather than not having a modal
you can just respond to a command interaction
i mean that button is quite useless but why not
you answered
yeah but it looks cooler this way soooo
i said pressing an additional button is useless
just open to modal on the command interaction
aka when sending the command
oh that's what you meant
it doesn't really make a difference for me tbh
button can be when the channel is locked
when the file is not found
currently rewriting my image api, then this happened in dev
I'm buildig a roles system.
How should I structure the DB?
like that?:
roles -> roles with their e.g. perms etc. (e.g. -> | role_id | name | perms |)
member_roles -> for each member's role a record (e.g. -> | user_id | role |)
let's take Discord as an example. Roles like that
ok, but is it going to be applied where?
just as user management in the backend.
well, simply have each role have an ID and a permission level
yes and when a user gets a role (multiple possible) how do you track that? In the example above you create a record that the user got this role and has it now.
have a third table to store user id-role relation
you didn't mention what kind of database it is
Yeah creating relations between your tables makes sense then is literally the basement of any permission and group system
yes
the relation will be N <-> N between users and roles, so u need a third table
Now this can be expanded with groups, users_groups, groups_roles etc
ahh yes right! i then create a relation between them and if e.g. the role gets deleted the record where a user has this role also gets deleted.
To give you an idea
Correct
a simple foreign key with ON DELETE CASCADE will do
okay I understand. Thank you.
Just by joining other tables in your queries
Or this
yep I use Prisma and in the model you can define this pretty smooth
just make sure to put the cascade on the correct side
yes xD I will, ty
You can also add grant and negate values to your permissions defining which permission they can edit/delete for example
Like a multi layer permission system with grant and skip flags like TeamSpeak has
You can literally go crazy with that
indeed! nice
Maybe you shouldn’t leak your API token
xD
nah you saw the repo and could just go to the file
That's assuming it's even public
e!setup
imagine not using slash commands
Is a bitwise permission system enough scalable? Like if I would use int I would only be able to store 32 (or 31 I'm not sure) perms. Otherwise there's a bigint but that's only 64/63 too. 
well if you need more you could always use 2 numbers
if u need more than 32 permissions u can always escalate to the next higher size
2 numbers? like how dym?
2 32 bit integers
If you have to use multiple numbers you've already lost.
if bigint is not enough u can do as feud said, split the bitfield into 2 columns
still better than 64+ boolean fields
there's a datatype that allows more than 64 digits iirc
we were discussing that last month
(or couple months, idrc)
I'd rather a set of enum variants.
only numbers? It's mysql btw
ah nvm, it was regarding another thing
anyway, decimal allows more digits than bigint
at the cost of having no decimal places
or u can store in a varchar
that's an option but on every query I would fetch the int. (It's possible for sure but that wasn't my first option to take:))
u can always partition a varchar into parseable numbers
what?
"12345678901234567890"
split
["1234567890","1234567890"]
parse
[1234567890,1234567890]
ah yeah. ig I will use varchar. Probably most save on scale
lemme say tho, it is HARD to think of more than 64 different permissions
also true
xD
like, it starts to get too specific after a certain amount of perms
discord being discord can fit everything into a bigint
even Discord has only 37 perms ig xD
close, 40
really?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
actually, 41 cuz it counts from 0
ah well like that oh yeah xD
theres still plenty of room to store permission bitfields in js numbers without using bigint
for those who want to optimize storage
that'd be in db, not js specifically
Is it possible to separate a video with 2 audio tracks. In a video without sound and 2 separate audio tracks.
yes
anyone know how to use maps with markers with Vue
really struggling to get it working 
i'd separate prefix and welcome message
add the boolean checks to the right too
and ```diff
- antiFish
- antiPhish
what do u have against fish
I meant in javascript on the fly. (forgot to mention that)
just a name for the module 
this is the actually functional version
why? they're both strings so I thought I'd group them
they dont have much relation to each other besides that
but whatever you prefer, its not a big deal
I'm just confused about putting them into 2 separate fields, I don't really have a title idea
// CACHE_COUNT is the ammount of messages the user sent in a short timeframe
if (CACHE_COUNT >= 10) {
// Warn and mute the person for spamming after a warn.
} else if (CACHE_COUNT === 5) {
// Warn the person for spamming
}
``` is this going to work?
if it's 5 warn, and then once it reaches more than 10 keep muting
I couldn't think of a better way of doing it
lol how do I check if something is a mention without regex
cause I know you guys would kill me if I used regex for that
setEmbed.addField(
"Roles",
`modRole: ${roleRegex.test(serverSettings.modRole) ? serverSettings.modRole : `\`\`\`${serverSettings.modRole}\`\`\``}\nadminRole: ${roleRegex.test(serverSettings.adminRole) ? serverSettings.adminRole : `\`\`\`${serverSettings.adminRole}\`\`\``}\nmutedRole: ${roleRegex.test(serverSettings.mutedRole) ? serverSettings.mutedRole : `\`\`\`${serverSettings.mutedRole}\`\`\``}`
);
setEmbed.addField(
"Channels",
`modLogChannel: ${channelRegex.test(serverSettings.modLogChannel) ? serverSettings.modLogChannel : `\`\`\`${serverSettings.modLogChannel}\`\`\``}\nwelcomeChannel: ${channelRegex.test(serverSettings.welcomeChannel) ? serverSettings.welcomeChannel : `\`\`\`${serverSettings.welcomeChannel}\`\`\``}`
);
``` lmfao
I'm using it for individual strings
no, u are using for a single string
for individual things in that string I mean
exactly
but I'm going to revert it anyway I think it looked better without that
yeah yeah I know
know yet use \n with it 
I don't think that's a huge problem
what if you put welcome message at the end in a code block
for booleans u can use emoji form of \❌ and \✅
they look better than true or false
yeah, welcome message as a codeblock is a must
people love to set huge messages for it
you can even color it
you can probably find a lang that has highlightng for {{}}
Is it possible to separate a video buffer with 2 audio tracks. In a video without sound and 2 separate audio tracks in javascript and how?.
handlebars / hbs
its an html template engine, similar to ejs
look into ffmpeg
that's pretty cool not going to lie
thanks for telling me that
Or just use ANSI color codes to highlight them in any way
code blocks support ansi?
(Won't work for mobile users sadly, ANSI is only available on Discord desktop and web)
Yeah, it's been supported for about 2 months now
not working for me, im on web
any example?
problem, only core js and nothing else
good luck
@quartz kindle I have a cool idea I'll send the finished embed here in a second
I hope it looks as good as i imagine it in my head
ah i think i saw this and forgot
I mean
@quartz kindle
is that better or worse I can't really tell
was it better when everything was sorted by type or now that I sort everything by modules
since you already have "role", "welcomer", etc in the titles, you dont really need to repeat them
how would you structure the embed?
Roles
mod:
admin:
muted:
welcomer module
enabled:
channel:
message:
I have to
I'll show you why
one second
{
prefix: '-',
modLogChannel: '[#734161576717844602](/guild/264445053596991498/channel/734161576717844602/)',
modRole: 'Moderator',
adminRole: 'Administrator',
mutedRole: 'Muted',
welcomeChannel: 'welcome',
welcomeMessage: "Welcome {{user}} to {{guild}}. You're the {{memberJoinedCount}} user to join the server.",
welcomeEnabled: 'false',
allowNSFW: 'true',
antiFish: 'true',
antiSpam: 'false'
}
it goes like so: key, value
and it's case sensitive so I can't really do that
otherwise the user won't know how to change the key value
How about asking the user for the specific setting they want to look at?
Right now it just looks like a control panel display.
I'm not quite sure how to explain how it's done
since I'm not using slash commands ( and I don't plan to ) I can't really have it ask which specific settings the user want
cause I need the interaction system for that
You can't do <prefix>settings <module> and have it, say, display current configuration?
yeah if you want to edit a module you do
<prefix>settings edit <modulename> <newvalue>
and the modules are very case sensitive so one mistake and it won't get recognized, most I can do is compare it with lowercases so typing welcomemessage will work the same as typing welcomeMessage, but that's about all I can do to for now at least
what do you mean?
user has to type welcomeEnabled in order to change the welcomeEnabled value, how is that an issue?
yeah I can do that
as it is right now it won't work
it's because of how I made it save the variables to the enmap
imagine this being the enmap
{
prefix: '-',
modLogChannel: 'mod-log',
modRole: 'Moderator',
adminRole: 'Administrator',
mutedRole: 'Muted',
welcomeChannel: 'welcome',
welcomeMessage: "Welcome {{user}} to {{guild}}. You're the {{memberJoinedCount}} user to join the server.",
welcomeEnabled: 'false',
allowNSFW: 'false',
antiFish: 'false',
antiSpam: 'false'
}
now to comprae I usually do
enmapVariable["welcomeEnabled"] // will return it's value so false.
enmapVariable["welcomeenabled"] // will return undefiend since that value doesn't exist
do you see why it would be hard to make it not case sensitive?
save it lowercase
i would have to edit the entire DB again to do that
You can take the object, get it's entries, convert them to lowercase, and back to an object to make them case insensitive
[2;31m[1;31m[4;31m[0;31m[4;31m[1;31m[1;31mSwag.[0m[1;31m[0m[4;31m[0m[0;31m[0m[4;31m[0m[1;31m[0m[2;31m[0m
nice length
that sounds like a pain, but I get what you mean
let me quickly try writing this
I'm gonna wait until you come up with your abomination first before sending the simple solution
Lmao
come on voltrex I'm not that bad
hold on let me eval what I wrote rq to make sure it works
based voltrex
God help you the moment you have a key that isn't directly set by the user
It seems as though I’ve missed a good chunk of fun
const serverSettings = message.settings;
let serverSettingsLowerCase = [];
Object.entries(serverSettings).forEach(([key, value]) => {
serverSettingsLowerCase.push([key.toLowerCase(), value.toLowerCase()])
});
serverSettingsLowerCase;
something like this maybe? @earnest phoenix
The classic value.toLowerCase() for no apparent reason
read what we are talking about then you'll understand
we are trying to convert message.settings array contents to lowercase?
someone just sent an invite
yeah then voltrex suggested that we are to make all of the keys lowercase
I don’t see why the value needs to be lowercased unless that’s what you intended
and the snippet above is my take on that
^
unless u have a better way try
- The value does not need to be lower case (nor will it always be)
- You should consider using an object and setting the key, rather than using an array of arrays as keys.
I said only the keys need to be lowercase, not the values
yeah I just realized my mistake but it's a simple fix
let serverSettings = message.settings;
serverSettings = Object.fromEntries(Object.entries(serverSettings).map(([key, value]) => [key.toLowerCase(), value]));
serverSettings;
better?
Yes but also
[0;31mAurel[0m is a [4;33mgood[0m[1;35m catgirl
wot
discord accepts ansi escape codes?
nah, that's the power of using metric system
see, 31m, 0m, 33m
mobile being made redundant it's cring
discord is made with react, they could literally use the web version to compile for mobile
that if discord was responsive at all
:c
[41;37mRed! [42;37mGreen! [43;37mYellow! [44;37mBlue! [45;37mMagenta! [46;37mCyan! [47;30mWhite!
[40;31mRed [40;32mGreen [40;33mYellow [40;34mBlue [40;35mMagenta [40;36mCyan [40;37mWhite
[41;37m [42;37m [43;37m [44;37m [45;37m [46;37m [47;37m
[47;37m [46;37m [45;37m [44;37m [43;37m [42;37m [41;37m
niceeee
new markdowns ?
can you upload in a txt file
Oh nice, you didn't come up with an abomination and came up with my simple solution
this example
[41;37mRed! [42;37mGreen! [43;37mYellow! [44;37mBlue! [45;37mMagenta! [46;37mCyan! [47;30mWhite!
[40;31mRed [40;32mGreen [40;33mYellow [40;34mBlue [40;35mMagenta [40;36mCyan [40;37mWhite
[41;37m [42;37m [43;37m [44;37m [45;37m [46;37m [47;37m
[47;37m [46;37m [45;37m [44;37m [43;37m [42;37m [41;37m
just copy that

@ancient nova
if i paste it
[41;37mRed! [42;37mGreen! [43;37mYellow! [44;37mBlue! [45;37mMagenta! [46;37mCyan! [47;30mWhite!
[40;31mRed [40;32mGreen [40;33mYellow [40;34mBlue [40;35mMagenta [40;36mCyan [40;37mWhite
[41;37m [42;37m [43;37m [44;37m [45;37m [46;37m [47;37m
[47;37m [46;37m [45;37m [44;37m [43;37m [42;37m [41;37m
this happens
u have to use markdown
k
Codeblocks.
which one ?
there are some like ini?
[41;37mRed! [42;37mGreen! [43;37mYellow! [44;37mBlue! [45;37mMagenta! [46;37mCyan! [47;30mWhite!
[40;31mRed [40;32mGreen [40;33mYellow [40;34mBlue [40;35mMagenta [40;36mCyan [40;37mWhite
[41;37m [42;37m [43;37m [44;37m [45;37m [46;37m [47;37m
[47;37m [46;37m [45;37m [44;37m [43;37m [42;37m [41;37m```
LOL
ansi
[41;37mRed! [42;37mGreen! [43;37mYellow! [44;37mBlue! [45;37mMagenta! [46;37mCyan! [47;30mWhite!
[40;31mRed [40;32mGreen [40;33mYellow [40;34mBlue [40;35mMagenta [40;36mCyan [40;37mWhite
[41;37m [42;37m [43;37m [44;37m [45;37m [46;37m [47;37m
[47;37m [46;37m [45;37m [44;37m [43;37m [42;37m [41;37m
ahh
it works @earnest phoenix
wanna test it out?
instead of server settings I lowered the case of the default settings and compared those when checking key validity
works better
communication_disabled_until: Could not parse +125148-01-28T18:20:00.698Z. Should be ISO8601.``` ms package trippin?
Very colorful
Just write something exclusively for the PC version
There ain’t much people using smartphones

I can't read from mobile because think of something like 30 thousand units of money to buy a pc in turkey, they give 5k salary to the employee here.🥲🥲
The money is not enough when the food cost is the maintenance cost or something.
As sad as this there’s somebody you can blame for this
is there a way to get passed the channel.history limit? i said "none" but i feel like its...limited to x
assuming you're using dpy
theoretically, there's no limit
in practice the API request allows up to 100 messages maximum
but you can pass more than that to dpy because dpy automatically batches requests depending on the amount of messages you want to get
i.e. for 100 messages it'll send one request, for 130 two requests, for 200 two requests, for 230 three requests and so on
ah i see

me when ConsoleSetTextAttribute
I want to create tests with jest for my DB.
Now I don't want it to write actually to the database. I read something about creating a whole database and the whole stuff and after the test drop the db. Is that a good option?? (mariadb)
You need to return status 200 or it'll keep sending the same payload
Don't wanna be rude but that looks like Minecraft enchantment table language
What mod is that
😂 😂
i am getting a warning can anyone tell me whats it about?
(node:1948) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
yoo can anyone help, lets say 2 users did the command at once, first message wont get fully edited, any idea why?
Node 18 trying to add fetch api
Probably came from there
i see
wdym with "why"?
they seem to be wondering why the first message isn't ending up like that bottom one
cause 2 users ran the command at once
well, my guess is either a faulty logic or hitting edit ratelimit bucket
if it was ratelimit the first one would have been edited instead of second

but shows edited on both embed so prolly not ratelimit
not really
I imagine u do 3 edits on each message, one for each slot right?
then it'd happen like this:
A = first message
B = second message
A1
B1
A2
B2
---- ratelimit prevents A3
B3
for most libs, yes
they didn't specify what lib not showed any code, so this is just a blind guess
could also be some exception happening during prize calculation

https://youtube.com/shorts/V75vTNjaemY?feature=share
it can actually be read lol
inb4: it's only random gibberish in the enchant table
How to make discord log in authorities in website
oauth2
identify scope to be precise
How to Make Music on cogs with Discord Py Lavalink
Do you guys take notes of what u have to do or just rememeber everyshit
Like we doo on balkans
I just remember what I remember and forget what I forgot
did you say balkans? jebo ti pas mater u picku :)))))
da bog da ti djeca hodala unazad i igrala skolice u minskom polju
xd
lmfaoo
JOKE
notes (usually github issues)
slavic languages have such a rich vocabulary when it comes to swearing and i love it
SAME lol
Turkish also comes near that
React
app.js
https://www.toptal.com/developers/hastebin/zoxefonoci.js
index.js
https://www.toptal.com/developers/hastebin/anowebukif.js
I don't think there is something major wrong with the code but some other factor is preventing it from working. I just dont know whats going on and I desperately need help because i have not been able to make progress in hour(s). I am trying to use react router to make a better structure of code. Current behavior: doesn't render anything
solved it, never mind
how i can return if a user is a bot
if(user.bot) return
ha
beat me to it
and out of all the ways to answer it, we both went for the exact same one
no code blocks, no context
lmao
no brackets
no semis
I was too lazy for such an answer
Been racking my brain on regular expressions grammar for a while
if (!user.bot) return;
if i did this the bot dont send any message
if(user.bot) return
the bot sends message if the user is a bot or not a bot too
let user = interaction.guild.members.cache.get(args[0]);
I think he's trying to see if a fetched user is a bot
yes
It's probably crashing if I had to guess, since I don't think he's checking if the user is null or not
Do you have an error message of any sort?
no
Can you show more code than just one line
let user = interaction.guild.members.cache.get(args[0]);
let bot = new MessageEmbed()
.setColor('#2f3136')
.setDescription(`${False} Please provide a **bot** only, not a **real user**`)
if (!user.bot) return interaction.followUp({ embeds: [bot] });
is this good?
well guild.members.get will get you a Member object
Member doesnt have .bot
User does
Just to confirm
Discord.js v13
<guild>.me```
Discord.js v14
```js
<guild>.members.me```
is correct?
meanwhile jda: <guild>.getSelfMember()
idk why djs loves to add intermediary steps for everything
? it was always like that lol
guild.me has always been a nullable prop, only returning the bot member if it was cached
There's a GET endpoint for your user for a reason 
I don't really understand why djs is chasing the perfect API architecture
like these changes make the API feel cleaner but are they really necessary? idk

did not fix it
they get paid?
wtf
imagine getting paid for maintaining an API wrapper
Jda does, 1k bucks per month
uh ok
I need some help regarding the awaitMessages collector in djs
I literally have no idea how to cancel that nor avoid multiple of those awaitMessages stacking up
my goal is to have one awaitMessages running at a time
I tried the docs and stackoverflow but no results to my issue
I mean I would just use a ternary operator on the string rather than the object itself
Yes
thanks
good idea ty
np
whats the permissions required to timeout members/users? like which permission to check
Timeout Members
I guess discord calls it differently internally
so if i check for perms in djs i type MODERATE_MEMBERS or TIMEOUT_MEMBERS?
That is just what discord calls it in the app
No
Yes?
No
The docs specify the permission name as moderate members
Internally and externally are two different things fake
Internally it is MODERATE_MEMBERS externally it is viewed as Timeout Members
The display name doesn’t need to match the api value
Why are you bitching around then?
I already corrected my mistake and said on discord it has a different name