Entity Info
isAdmin
$isAdmin
Returns "true" if the user has the Administrator permission on the server, and "false" otherwise.
Syntax
$isAdmin
$isAdmin
The function $isAdmin returns "true" if the user has the Administrator permission on the Discord server.
Syntax
$isAdmin
Return Value
- Type: String
"true"or"false" "true": The user has theAdministratorpermission."false": The user does not have this permission.
Behavior
$isAdmintakes no arguments.- The
Administratorpermission grants all permissions on the server. - The server owner is implicitly an administrator (returns
"true").
Examples
Restricting a command
$if[$isAdmin==true]
$ban[$mentioned]
$sendMessage[<@$mentioned> was banned.]
$else
$sendMessage[Only administrators can use this command.]
$endif
Displaying an admin menu
$if[$isAdmin==true]
$title[Administration Panel]
$description[
**Available commands:**
`/ban`, `/kick`, `/mute`, `/config`
]
$color[#ED4245]
$sendMessage[]
$endif
Logging admin actions
$if[$isAdmin==true]
$log[Admin action performed by $userName (ID: $userID)]
$endif
Notes
$isAdminonly checks for theAdministratorpermission, not other individual permissions.- To check for a specific permission (e.g.,
BanMembers,ManageMessages), use$checkContains[$userPerms;PermissionName]. - Equivalent to
$checkContains[$userPerms;Administrator]==true.