Get Channel Info
Retrieves detailed information about a Discord channel.
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).
- Channel Id - The ID of the Discord channel to retrieve information about.
Options
- Bot Token - Discord bot token credential (optional if using Client ID from Connect node).
Output
- Result - A channel information object containing all channel details and metadata.
How It Works
The Get Channel Info node retrieves complete information about a specific Discord channel. When executed, the node:
- Authenticates using either Client ID or direct bot token
- Validates the channel ID
- Requests channel information from Discord API
- Returns the complete channel object with all details
Requirements
- Active Discord bot session (Client ID) or bot token credentials
- Valid channel ID
- View Channel permission
- The bot must be a member of the server (for server channels)
Error Handling
The node will return specific errors in the following cases:
- ErrInvalidArg - Client ID or bot token missing/invalid
- ErrInvalidArg - Channel ID is empty
- Discord API errors (channel not found, missing permissions, etc.)
Channel Information Object
The result object contains:
{
"ID": "123456789012345678",
"GuildID": "987654321098765432",
"Name": "general",
"Type": 0,
"Position": 1,
"Topic": "General discussion channel",
"NSFW": false,
"LastMessageID": "111111111111111111",
"Bitrate": 64000,
"UserLimit": 0,
"ParentID": "222222222222222222",
"PermissionOverwrites": []
}
Key properties:
- ID - Unique channel identifier
- GuildID - Server ID (null for DM channels)
- Name - Channel name
- Type - Channel type (0=text, 2=voice, 4=category, 5=announcement, 15=forum, etc.)
- Position - Channel position in the list
- Topic - Channel topic/description
- NSFW - Whether channel is marked as NSFW
- LastMessageID - ID of the most recent message
- Bitrate - Audio bitrate (voice channels only)
- UserLimit - Max users (voice channels only)
- ParentID - Category ID if channel is in a category
Example: Check Channel Type
Inputs:
- Channel Id: "123456789012345678"
Flow:
1. Get Channel Info → result
2. Condition: result.Type == 0
3. If True: "This is a text channel"
If False: "This is not a text channel"
Example: Get Channel Name
Inputs:
- Channel Id: "123456789012345678"
Flow:
1. Get Channel Info → result
2. Log: "Channel name is {{result.Name}}"
Example: Validate Channel Before Use
Flow:
1. Get Channel Info → result
2. Condition: result.NSFW == false
3. If True:
- Send Channel Message to result.ID
4. If False:
- Log: "Skipping NSFW channel"
Use Cases
- Channel validation - Verify channel exists before operations
- Dynamic routing - Route messages based on channel type
- Metadata extraction - Get channel names and topics programmatically
- Channel monitoring - Track channel configuration changes
- Conditional logic - Make decisions based on channel properties
- Audit logging - Record channel details for compliance
Accessing Channel Data
Use mustache syntax to access channel properties:
{{result.Name}}- Channel name{{result.Topic}}- Channel topic{{result.Type}}- Channel type number{{result.GuildID}}- Server ID{{result.Position}}- Channel position
Channel Types
Discord channel types:
- 0 - Text channel
- 2 - Voice channel
- 4 - Category
- 5 - Announcement channel
- 10 - Announcement thread
- 11 - Public thread
- 12 - Private thread
- 13 - Stage voice channel
- 15 - Forum channel
Bot Permissions Required
- View Channel - To retrieve channel information
Tips and Best Practices
- Cache channel info - Store frequently accessed channel data
- Validation - Verify channel type before type-specific operations
- Error handling - Handle cases where channel doesn't exist
- Monitoring - Regularly check channel configurations
- Documentation - Use channel topics for documentation