Skip to content
Entity Info memberExists

$memberExists

$memberExists tells whether a user is a member of a server. Unlike $findUser, it never falls back to the command author, and unlike $userExists it checks membership of the server, not the existence of the account.

Syntax

$memberExists[User ID;(Guild ID)]

Parameters

Parameter Description
User ID Required. The ID of the user (positive integer, otherwise the error “Invalid user ID.” is raised).
Guild ID Optional. The server to check. If omitted or empty, the current server is used. An invalid ID raises “Invalid guild ID.”.

Return value

  • true if the user is a member of the server, false otherwise.

Examples

Check a given ID

$if[$memberExists[$message[1]]==true]
  <@$message[1]> is in this server.
$else
  This user is not a member of the server.
$endif

Check another server

$memberExists[$authorID;123456789012345678]

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.