$noMentionMessage
The $noMentionMessage
function returns the content of the message sent by the command executor, but with all mentions removed. This is particularly useful for preventing your bot from accidentally pinging roles or users when echoing user input or using it in other command logic.
Usage:
$noMentionMessage
This function doesn't require any parameters. It simply returns the message content with mentions stripped out.
Example:
Let's say you want to echo the user's message in a custom command, but you don't want the bot to actually ping anyone they mentioned.
Here's how it would look in Discord:
In this example, even though the user mentioned "Server Moderator", the bot only mentions them once and then includes "testing" (the message with mentions removed). The original message including the mention is also included.