Entity Info
userName
$userName
Returns the global Discord username of the user who triggered the command.
Syntax
$userName
$userName
The $userName function returns the global Discord username of the user who triggered the command.
Syntax
$userName
Return Value
- Type: String
- The global Discord username (e.g., “JeanDupont”)
Behavior
$userNametakes no arguments.- Returns the global username (the one visible everywhere on Discord, without the discriminator).
- If the user has a nickname on the server,
$userNamestill returns their global username. Use$nicknamefor the server nickname, or$displayNamefor the display name (nickname if set, otherwise global username).
Examples
Welcome message
$title[Welcome $userName!]
$description[We are delighted to welcome you to the server 🎉]
$color[#57F287]
$sendMessage[]
Create a custom embed
$author[$userName;$userAvatar]
$title[User Profile]
$description[
**Name:** $userName
**ID:** $userID
**Tag:** $userTag
]
$color[#5865F2]
$sendMessage[]
Notes
- The username is set by the user and can be modified at any time.
- Maximum length: 32 characters.
- For reliable identification, use
$userIDrather than$userName. - Do not confuse with
$nickname(server-specific nickname) and$displayName(the best of both).