Skip to main content

Get User Info

Retrieves detailed information about a Discord user.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - The Discord bot client identifier from the Connect node (optional if Bot Token provided).
  • User Id - The ID of the Discord user to retrieve information about.

Options

  • Bot Token - Discord bot token credential (optional if using Client ID from Connect node).

Output

  • User - A user information object containing all user details and metadata.

How It Works

The Get User Info node retrieves complete information about a specific Discord user. When executed, the node:

  1. Authenticates using either Client ID or direct bot token
  2. Validates the user ID
  3. Requests user information from Discord API
  4. Returns the complete user object with all details

Requirements

  • Active Discord bot session (Client ID) or bot token credentials
  • Valid user ID
  • The bot and user should share at least one mutual server (for complete info)

Error Handling

The node will return specific errors in the following cases:

  • ErrInvalidArg - Client ID or bot token missing/invalid
  • ErrInvalidArg - User ID is empty
  • Discord API errors (user not found, API issues, etc.)

User Information Object

The result object contains:

{
"ID": "123456789012345678",
"Username": "JohnDoe",
"Discriminator": "1234",
"Avatar": "abc123def456",
"Bot": false,
"System": false,
"MFAEnabled": false,
"Locale": "en-US",
"Verified": true,
"Email": null,
"Flags": 0,
"PremiumType": 0,
"PublicFlags": 0
}

Key properties:

  • ID - Unique user identifier
  • Username - User's display name
  • Discriminator - 4-digit discriminator (legacy, being phased out)
  • Avatar - Avatar hash (can construct avatar URL)
  • Bot - Whether the user is a bot
  • System - Whether it's a system user
  • Verified - Email verification status
  • PremiumType - Nitro subscription level (0=none, 1=Nitro Classic, 2=Nitro)
  • PublicFlags - User badges (staff, partner, verified bot, etc.)

Example: Get User Details

Inputs:

  • User Id: "123456789012345678"

Flow:

1. Get User Info → user
2. Log: "Username: {{user.Username}}"
3. Log: "Is Bot: {{user.Bot}}"

Result: Retrieves and displays user information.

Example: Verify User Type

Flow:

1. Receive Message → message
2. Get User Info
- User Id: {{message.Author.ID}}
3. Condition: user.Bot == true
4. If True:
- Log: "Message from bot, ignoring"
- Stop
5. If False:
- Process user message

Result: Filter out bot messages.

Example: User Avatar URL

Flow:

1. Get User Info → user
2. Construct avatar URL:
- https://cdn.discordapp.com/avatars/{{user.ID}}/{{user.Avatar}}.png
3. Send message with avatar embed

Use Cases

  • User verification - Check if user is a bot or real user
  • Profile display - Show user information in responses
  • Avatar retrieval - Get user avatar for embeds
  • User validation - Verify user exists before operations
  • Premium detection - Check if user has Nitro
  • Badge checking - Verify user badges/flags
  • Analytics - Collect user demographics

Accessing User Data

Use mustache syntax to access user properties:

  • {{user.Username}} - User's name
  • {{user.ID}} - User ID
  • {{user.Bot}} - Boolean, is user a bot
  • {{user.Avatar}} - Avatar hash
  • {{user.Discriminator}} - User discriminator

Avatar URLs

Construct avatar URLs:

https://cdn.discordapp.com/avatars/{user_id}/{avatar_hash}.png

Options:

  • Add ?size=256 for specific size (16, 32, 64, 128, 256, 512, 1024, 2048)
  • Use .gif extension for animated avatars
  • Default avatar if hash is null: https://cdn.discordapp.com/embed/avatars/{discriminator % 5}.png

User Flags

Public flags indicate badges:

  • 1 - Discord Employee
  • 2 - Partnered Server Owner
  • 4 - HypeSquad Events
  • 8 - Bug Hunter Level 1
  • 64 - House Bravery
  • 128 - House Brilliance
  • 256 - House Balance
  • 512 - Early Supporter
  • 16384 - Bug Hunter Level 2
  • 131072 - Verified Bot Developer

Tips and Best Practices

  • Cache user data - Store frequently accessed user info
  • Avatar handling - Handle null avatars (use default)
  • Bot detection - Always check if user is a bot when necessary
  • Privacy - Only request user info when needed
  • Error handling - Handle cases where user doesn't exist
  • Rate limiting - Cache results to avoid repeated API calls