Question - Support of All Intents

So, if we don't like people using numbers for "all intents"...why does new Client support being passed a single number?
65 Replies
d.js docs
d.js docs2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
chewie 🌈
chewie 🌈2y ago
cuz its a bitfield, bitfields are numbers If you look at the enum of intents you see their respective bitfield value. djs just takes that, adds it together and then yeets it towards discord
Yinoguns
Yinoguns2y ago
Yea I get that, but why not enforce an Array? It'll cull the 99% of people who throw in a number, rather than doing anything next-step such as construction of the Intent object Like if they do new Intent(32767) then they've worked extra hard to the same stupid move
chewie 🌈
chewie 🌈2y ago
that wont stop them from passing all intents I use numbers as well, cuz I know what I'm doing KEKW
Yinoguns
Yinoguns2y ago
haha, fair enough. I guess it's too far gone to change it now 🤔 That's fair 👍 A phrase does come to mind:
"You cannot make an idiot-proof system, because nature will make a better idiot"
chewie 🌈
chewie 🌈2y ago
gonna make a reverse intent calculator so yall can see what intents they use via number pepeVR
조아오
조아오2y ago
This should be painted everywhere It's not a bad ideia ngl Really not a bad idea Cc: @souji Maybe cerb or djs docs? I think this would be better suitable to djs docs
Yinoguns
Yinoguns2y ago
Totally this. I did the same when I make cron stuff, Slash Command tells me next 10 for a cron
chewie 🌈
chewie 🌈2y ago
yeah
조아오
조아오2y ago
Yeah it's fairly easy
Yinoguns
Yinoguns2y ago
And this is why I always speak my mind, never know where a conversation might go 🙂
조아오
조아오2y ago
But it has djs installed bc of the Forum messages
chewie 🌈
chewie 🌈2y ago
imo if people want a calculator, I'm gonna give them a calculator, with a huge fat warning to not use all intents if they dont need them, and in addition a mode to get the intents from the number
조아오
조아오2y ago
Maybe it could output the bitfield code to replace the intents Makes sense, my bad Input: 12345 Output: DONT USE NUMBERS
[
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
]
[
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
]
Or maybe thats too much? Could get spammy
Yinoguns
Yinoguns2y ago
I would say just a list, because you shouldn't need to convert all intents to anything The purpose would be to see what intents the person has, through that number Not to let them continue to have all
조아오
조아오2y ago
True
chewie 🌈
chewie 🌈2y ago
[
"Guilds": 1,
"GuildMembers": 2,
"GuildMessages": 514,
"MessageContent": 32770
]
[
"Guilds": 1,
"GuildMembers": 2,
"GuildMessages": 514,
"MessageContent": 32770
]
조아오
조아오2y ago
Can be The problem is, generally those numbers are all intents So the list would be gigantic We have what, 23 intents?
chewie 🌈
chewie 🌈2y ago
if you want to see what intents that number relates to, you will have to live with that
조아오
조아오2y ago
True Could be smt like: Ephemeral: Detailed Public: Resumed Or have an option to display detailed
Yinoguns
Yinoguns2y ago
Just display it in a single value, and join with \n too
조아오
조아오2y ago
Couldn't be used in the support channel, idk
chewie 🌈
chewie 🌈2y ago
Yeah, that should be more of a personal command, so ephemeral.
조아오
조아오2y ago
Oh, that's big brain thinking
chewie 🌈
chewie 🌈2y ago
Or like other commands we have, with an optional option to show it, in case someone starts to argue
조아오
조아오2y ago
Then I think this would be the better way to show All of the cerb commands have a way to make the reply public, probably it would have it too
chewie 🌈
chewie 🌈2y ago
yeah, thats what I meant KEKW
조아오
조아오2y ago
I'm wierd, my bad 😅
chewie 🌈
chewie 🌈2y ago
@qjuh not gonna ask how you managed to fail /pet
조아오
조아오2y ago
Cerb doesn't like my company woah
yuzu
yuzu2y ago
Inspect: 12345 (11000000111001)
Inspect: 12345 (11000000111001)
✓ 1<<0  Guilds (1)
✖ 1<<1  GuildMembers (2)
✖ 1<<2  GuildBans (4)
✓ 1<<3  GuildEmojisAndStickers (8)
✓ 1<<4  GuildIntegrations (16)
✓ 1<<5  GuildWebhooks (32)
✖ 1<<6  GuildInvites (64)
✖ 1<<7  GuildVoiceStates (128)
✖ 1<<8  GuildPresences (256)
✖ 1<<9  GuildMessages (512)
✖ 1<<10 GuildMessageReactions (1024)
✖ 1<<11 GuildMessageTyping (2048)
✓ 1<<12 DirectMessages (4096)
✓ 1<<13 DirectMessageReactions (8192)
✖ 1<<14 DirectMessageTyping (16384)
✖ 1<<15 MessageContent (32768)
✖ 1<<16 GuildScheduledEvents (65536)
✓ 1<<0  Guilds (1)
✖ 1<<1  GuildMembers (2)
✖ 1<<2  GuildBans (4)
✓ 1<<3  GuildEmojisAndStickers (8)
✓ 1<<4  GuildIntegrations (16)
✓ 1<<5  GuildWebhooks (32)
✖ 1<<6  GuildInvites (64)
✖ 1<<7  GuildVoiceStates (128)
✖ 1<<8  GuildPresences (256)
✖ 1<<9  GuildMessages (512)
✖ 1<<10 GuildMessageReactions (1024)
✖ 1<<11 GuildMessageTyping (2048)
✓ 1<<12 DirectMessages (4096)
✓ 1<<13 DirectMessageReactions (8192)
✖ 1<<14 DirectMessageTyping (16384)
✖ 1<<15 MessageContent (32768)
✖ 1<<16 GuildScheduledEvents (65536)
chewie 🌈
chewie 🌈2y ago
Thank you my lovely bobolove
Yinoguns
Yinoguns2y ago
I thought it was gonna be Empheral? But it's sexy
chewie 🌈
chewie 🌈2y ago
It is It has an optional hide option which defaults to true
Yinoguns
Yinoguns2y ago
I see no +1
Yinoguns
Yinoguns2y ago
chewie 🌈
chewie 🌈2y ago
True Soujis command was with that option
souji
souji2y ago
bamboozled
souji
souji2y ago
if i'm REALLY bored i might even make it a context command
chewie 🌈
chewie 🌈2y ago
Do it If you do it ill buy you soju
Yinoguns
Yinoguns2y ago
Make it extract the content of the message, seek for numbers, and then use that 😮
chewie 🌈
chewie 🌈2y ago
Just looking for intents: number Wdym
Yinoguns
Yinoguns2y ago
do you have Guilds intent: 42
do you have Guilds intent: 42
That would also match TBH, it's a pipe dream, not worth the effort 😄 god damn it, I was basing on your example! 😄
souji
souji2y ago
just need a good enough regex
Yinoguns
Yinoguns2y ago
Famous last words, before decent into Madness
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
souji
souji2y ago
(now also available as context) bc why not
Yinoguns
Yinoguns2y ago
Madness
조아오
조아오2y ago
Souji is really into it
souji
souji2y ago
const res =
/intents:.*?(?<bits>\d{1,7})/gi.exec(args.message.content) ??
/intents\((?<bits>\d{1,7})\)/gi.exec(args.message.content) ??
/intents.*?(?<bits>\d{1,7})/gi.exec(args.message.content) ??
/(?:^|[\s`])(?<bits>\d{1,7}?)(?:$|[\s`])/gi.exec(args.message.content);
const res =
/intents:.*?(?<bits>\d{1,7})/gi.exec(args.message.content) ??
/intents\((?<bits>\d{1,7})\)/gi.exec(args.message.content) ??
/intents.*?(?<bits>\d{1,7})/gi.exec(args.message.content) ??
/(?:^|[\s`])(?<bits>\d{1,7}?)(?:$|[\s`])/gi.exec(args.message.content);
#goodenough
조아오
조아오2y ago
I only need 4096 intents with you
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
souji
souji2y ago
bobaCatSip i prefer boba, actually
chewie 🌈
chewie 🌈2y ago
firGun
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Yinoguns
Yinoguns2y ago
GG
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
chewie 🌈
chewie 🌈2y ago
or you dont be dumb and just use the intents you need
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
souji
souji2y ago
still no you still run into the same issues that is still not all intents
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
chewie 🌈
chewie 🌈2y ago
at least we would know what intents they are using then PepeStraightFace
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
조아오
조아오2y ago
This ⏫