allowedMentions

const client = new Client({
intents:
[
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates
],
allowedMentions: {
parse:
[
"users",
"roles"
]
},
});
const client = new Client({
intents:
[
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates
],
allowedMentions: {
parse:
[
"users",
"roles"
]
},
});
I got this in my client options, but it doesn't it give notifications, neither is the message highlighted? What am I doing wrong?
31 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
ShompiFlen
ShompiFlen2y ago
I think that option name is a little counter intuitive, unless im also reading it wrong. But you shouldn't specify anything there if you want to ping / send notifications through mentions just remove the entire allowed mentions part and try again
Iced Queen
Iced QueenOP2y ago
Without the entire allowedMentions the message gets highlighted as if it did mention, but they don't get the ping icon. So I was told to use allowedMentions which just worsened it
ShompiFlen
ShompiFlen2y ago
You don't need to specify that, i dont do it and I can ping people just fine. How are you trying to mention them? in the message content? an embed? mentioning a role?
Iced Queen
Iced QueenOP2y ago
In the message content as a member
ShompiFlen
ShompiFlen2y ago
ASthink you tried mentioning more users? or yourself
Iced Queen
Iced QueenOP2y ago
Can't mention myself with my bot, but others says they don't get notifications when others mentions them
ShompiFlen
ShompiFlen2y ago
sounds more like a client issue / server configuration / notification configuration rather than a problem with your bot to be honest what if you mention them with your account do they get pinged?
Iced Queen
Iced QueenOP2y ago
Lemme find out I just tried mentioning someone asking them if it gave them a notification and it did, but it doesn't if it goes through the bot
ShompiFlen
ShompiFlen2y ago
<a:you_think_about_that:451355866529005570> ok so first just try removing the allowed mentions option from your client, then can you show me your code, how are you sending the message
Iced Queen
Iced QueenOP2y ago
target is interaction.options.getMember
interaction.editReply({ content: `${target}`, embeds: [embed] })
interaction.editReply({ content: `${target}`, embeds: [embed] })
ShompiFlen
ShompiFlen2y ago
Im just trying it like this and as you can see I get the ping notification even inside of a muted channel
ShompiFlen
ShompiFlen2y ago
Ohhhh I see you are editing the reply edits do not ping it has to be a fresh reply
Iced Queen
Iced QueenOP2y ago
Sadly I have to defer the reply though, otherwise it'll fail. What can I do to ping then?
ShompiFlen
ShompiFlen2y ago
I think you can send a followUp message or just send a new message directly to the channel
Iced Queen
Iced QueenOP2y ago
Nah none of those would work for this
ShompiFlen
ShompiFlen2y ago
are you defering the initial reply?
Iced Queen
Iced QueenOP2y ago
Wdym?
ShompiFlen
ShompiFlen2y ago
are you calling interaction.deferReply()
Iced Queen
Iced QueenOP2y ago
Yes
ShompiFlen
ShompiFlen2y ago
because what you could do instead is just interaction.reply(pingmemberhere) add like a "wait a bit" message to it, then edit the reply with the new content
Iced Queen
Iced QueenOP2y ago
Then running the rest of the code before editing the reply
ShompiFlen
ShompiFlen2y ago
so they get the mention but they also know they have to wait
Iced Queen
Iced QueenOP2y ago
The interaction would run out and I'd get the Unknown interaction error if I did that
ShompiFlen
ShompiFlen2y ago
Nope replying to the interaction is just like deferring it you can edit it later up until 15 minutes
Iced Queen
Iced QueenOP2y ago
Ohh I think I get what you mean now
ShompiFlen
ShompiFlen2y ago
you will lose the ability to have that "Bot is thinking..." message, but you will be able to ping people
Iced Queen
Iced QueenOP2y ago
Hmm, though that could be an approach I'm not sure I'm a fan of it tbh
ShompiFlen
ShompiFlen2y ago
well thats just how it is, you can't ping people if you mentioned them in an edit, so you have to find a workaround
Iced Queen
Iced QueenOP2y ago
Looks like it. Well thanks for the guidance at least
ShompiFlen
ShompiFlen2y ago
<a:neko_nod:819942443481825350>
Want results from more Discord servers?
Add your server