cmd.client.id

Returns the bot's own user ID.

JavaScript
const { cmd } = require("syntx.js");

cmd.client.id(client);

Parameters

ParameterTypeRequiredDescription
clientERXClientYesThe syntx.js client instance.

Returns

string : The bot's user ID.

Example

JavaScript
client.ready(() => {
  const id = cmd.client.id(client);
  console.log(`Bot ID: ${id}`);
});

Warning

This function must be called after the bot has logged in. Calling it before the bot is ready (for example, at the top level before client.start()) will throw a SyntxError because client.bot.user is not yet available.