hexabot-channel-discord
v2.0.3
Published
Discord Channel Extension for Hexabot Chatbot Builder
Downloads
124
Readme
Hexabot Discord Channel Extension
Welcome to the Hexabot Discord Channel Extension! This extension enables seamless integration of your Hexabot chatbot with Discord, allowing you to engage with your audience on this popular communication platform.
Not yet familiar with Hexabot? It's an open-source chatbot / agent solution that allows users to create and manage AI-powered, multi-channel, and multilingual chatbots with ease. If you would like to learn more, please visit the official GitHub repo.
Features
- Dual Interaction Channels:
- Direct Messages: Personal 1-on-1 bot conversations
- Server Interactions: Interactions begin with a mention to the bot, ensuring context-aware communication.
- User Data Retrieval: Fetch essential user information such as username, avatar, roles, and server-specific details.
- Flexible Communication:
- Private Conversations: Seamless direct messaging
- Server Chat: Mention-based interactions
- Rich Messaging Features:
- Buttons: Add interactive elements to guide user actions
- Embeds: Create visually appealing message presentations
- Context Management: Intelligent response handling in different communication contexts
💡 Note: Before users can interact with the bot via direct messages, it must be added to a server. Direct messaging is only possible after the bot is part of at least one Discord server.
Prerequisites
Before you begin, ensure you have:
- A Discord account
- Basic knowledge of APIs and web development (optional but recommended)
- A server to host your chatbot
- HTTPS enabled on your server
- Cloned Hexabot locally (refer to https://github.com/hexastack/hexabot)
Installation
Navigate to your Hexabot project directory and install the extension:
cd ~/projects/my-chatbot/
npm install --save hexabot-channel-discord
hexabot dev
Step 1: Create a Discord Developer Application
Access Discord Developer Portal:
- Navigate to Discord Developer Portal
- Click "New Application"
Configure Application:
- Name your application
- Accept Developer Terms of Service
Create Bot:
- Go to "Bot" section
- Click "Add Bot"
- Customize bot settings within General Information
Step 2: Generate Bot Token
- In the "Bot" section, find "Token"
- Click "Copy" to retrieve your bot token
- IMPORTANT: Keep this token secret
Step 3: Intents Configuration
- Description: Configure which Discord events your bot can access
- Recommended Intents:
- Server Members
- Message Content
- Guild Messages
- Access Bot Section
- In Discord Developer Portal, navigate to "Bot"
- Select the bot Intents
- Under Privileged Gateway Intents, select the desired intents
Step 4: Configure OAuth2 for Server Invitation
Access OAuth2 Section:
- In Discord Developer Portal, navigate to "OAuth2"
- Click on "URL Generator"
Select Scopes:
- Check "bot"
Select Bot Permissions:
- Choose appropriate permissions based on bot functionality:
- Send Messages
- Manage Messages
- Embed Links
- Attach Files
- Read Message History
- Use Slash Commands
- Choose appropriate permissions based on bot functionality:
Generate Invitation URL:
- Scroll down, the "Generated URL" will appear
- Copy this URL
Add Bot to Server:
- Open the generated URL in a web browser
- Select the target server
- Confirm permissions
- Authorize bot installation
💡 Pro Tip: Always use the principle of least privilege. Only select permissions your bot absolutely needs.
Configuration
Settings
Bot Token
- Description: Your Discord bot's authentication token
- Mandatory: Yes
- How to Obtain: Discord Developer Portal > Bot section
Application ID
- Description: Your application's unique identifier
- How to Obtain: Discord Developer Portal > General Information
Usage
Once configured, your Hexabot will be available on Discord with:
- Mention-based interactions for server environments
- Automated responses
- User data retrieval
Testing Integration
- Invite bot to server
- Verify mention-based interactions work only in servers
- Verify direct messages work only in private discussions
- Check user data retrieval
Contributing
We welcome community contributions!
- Report bugs
- Suggest features
- Submit pull requests
Please review Contribution Guidelines
Join our Discord
License
Licensed under GNU Affero General Public License v3.0 (AGPLv3) with additional terms:
- "Hexabot" is a trademark of Hexastack
- Derivative works must attribute Hexastack and Hexabot
Happy Bot Building!