Entity Info
botName
$botName
The $botName function returns the username of the bot as known to the command context.
Syntax
$botName
Parameters
None (passing one is an error).
Return value
- Type: String
- The username of the bot (e.g.,
MySuperBot), read from the context variablebot.username(filled from the bot account known to the gateway cache), otherwisebot.name. - If neither is available, the text
Bot.
Behavior
- Returns the username of the bot, not the server display name (nickname).
- No request is made to Discord by the function itself.
Examples
Welcome message
$title[👋 Welcome to $serverName!]
$description[
I am **$botName**, your assistant.
Type `!help` to see my commands.
]
$thumbnail[$userAvatar[$botID]]
$color[#5865F2]
About page
$title[🤖 About $botName]
$addField[Name;$botName;yes]
$addField[ID;$botID;yes]
$addField[Owner;<@$botOwnerID>;yes]
$addField[Commands;$commandsCount;yes]
$addField[Node;$botNode;yes]
$thumbnail[$userAvatar[$botID]]
$color[#57F287]
Introduction
$sendMessage[Hello! I am $botName, a versatile bot created with BDFD. 💪]
Notes
$botNameis read-only. ($changeUsername[]does not rename the bot: it changes the server nickname of a user.)- To get the ID of the bot, use
$botID. - For the avatar, use
$userAvatar[$botID].
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.