Strange role tagging @everyone

I keep getting this strange @@ only in my everyone tag, can someone help me?
No description
No description
25 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
king
kingOP3mo ago
└── [email protected] node: v20.12.2
d.js docs
d.js docs3mo ago
:property: (static) Formatters#roleMention @14.16.1 [DEPRECATED] Import this method directly from discord.js instead.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
oh i see
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
that means it only works for this guild?
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
roles: user_roles.map((role) => roleMention(role[1])).join(", "), still get the @@
king
kingOP3mo ago
No description
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
I'm saving the rawPosition to maintain the order like this [ [ 66, '1281414021022617713' ], [ 59, '900537322410487840' ], [ 50, '900538879747194901' ], [ 43, '900575020437356616' ], [ 42, '900538523663368233' ], [ 0, '898689266903834664' ] ]
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
TÆMBØ
TÆMBØ3mo ago
There is no way to remove the double @ from it. That's how Discord formats it due to the role's actual name. Most people just exclude it by doing <GuildMember>.roles.cache.filter(role => role.id !== <GuildMember>.guild.id)
king
kingOP3mo ago
ik ik but when the user doesn't have any roles the app get an error
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
i forgot to say but i was removing the everyone tag if the user gets more than one role I'll try to show
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
but it gets me this error CombinedPropertyError (1) Received one or more errors input[5] | CombinedPropertyError (1) | Received one or more errors | | input.value | | ExpectedConstraintError > s.string().lengthGreaterThanOrEqual() | | Invalid string length | | | | Expected: expected.length >= 1 | | | | Received: | | | ""
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
i tried to do roles: user_roles.map((role) => roleMention(role[1])).join(", ") ?? "No Roles", but even if the array is undef. the map function try to map and throw this error
TÆMBØ
TÆMBØ3mo ago
Use the logical OR operator instead || The nullish coalescing operator only checks for null/undefined, whereas the logical OR operator checks for anything falsy which includes strings that have a length of 0
king
kingOP3mo ago
huge thanks my bro it worked
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
king
kingOP3mo ago
oh i forgot it, thank u guys
Want results from more Discord servers?
Add your server