Strange role tagging @everyone
I keep getting this strange @@ only in my everyone tag, can someone help me?
25 Replies
- 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└── [email protected]
node: v20.12.2
:property: (static) Formatters#roleMention
@14.16.1
[DEPRECATED] Import this method directly from discord.js instead.Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
oh i see
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
that means it only works for this guild?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
roles: user_roles.map((role) => roleMention(role[1])).join(", "),
still get the @@Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
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•3mo ago
Message Not Public
Sign In & Join Server To View
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)
ik ik but when the user doesn't have any roles the app get an error
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
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•3mo ago
Message Not Public
Sign In & Join Server To View
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•3mo ago
Message Not Public
Sign In & Join Server To View
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 errorUse 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 0huge thanks my bro it worked
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
oh i forgot it, thank u guys