Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fluxerapp/fluxer/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Creating a bot on Fluxer involves registering an application, which automatically generates a bot user and authentication credentials. This guide walks you through the process.Prerequisites
- A Fluxer account (cannot be an unclaimed account)
- Basic understanding of HTTP APIs
- Secure storage for your bot token
Creating an Application
Using the API
Create a new application with a bot user:The name of your bot (used to generate the bot username)
Whether anyone can invite the bot to their guild
Whether the bot requires a full OAuth2 code grant flow
OAuth2 redirect URIs (optional for bot-only applications)
Response
The API returns your application details including the bot token:Understanding Bot Tokens
Token Format
Bot tokens follow this structure:123456789012345678- Your application ID.- SeparatordGhpcyBpcyBhIHNlY3JldCB0b2tlbiBleGFtcGxl- Base64URL-encoded random secret
Token Storage
Bot User Generation
When you create an application, Fluxer automatically:-
Generates Bot User ID: Derived from the application ID using
applicationIdToUserId() -
Creates Username: Sanitizes your application name:
- Replaces spaces, hyphens, dots with underscores
- Removes non-alphanumeric characters (except underscores)
- Truncates to 32 characters maximum
- Ensures minimum 2 characters (prefixes with “bot” if needed)
- Assigns Discriminator: Finds an available 4-digit discriminator for the username
Username Examples
| Application Name | Generated Username |
|---|---|
| My Awesome Bot | my_awesome_bot |
| Cool-Bot 2000 | cool_bot_2000 |
| @#$% | bot |
| Music🎵Player | musicplayer |
If the sanitized username has no available discriminators, Fluxer generates a random username instead.
Bot User Properties
Bot users have the following characteristics:Customizing Your Bot
Update Bot Profile
Change your bot’s appearance and metadata:New username (2-32 characters, alphanumeric + underscores)
Base64-encoded image data or null to remove
Base64-encoded image data or null to remove
Bot description (up to 190 characters)
Bot behavior flags (see Bot Flags section below)
Bot Flags
Control bot behavior with these flags:1048576):
- Automatically accepts friend requests
- Users can DM the bot without being friends
- Ideal for support and utility bots
2097152):
- Requires manual approval for friend requests
- Prevents auto-acceptance even with FRIENDLY_BOT flag
- Use with FRIENDLY_BOT for controlled relationships
Managing Your Bot
Rotating Bot Token
If your token is compromised, generate a new one:Listing Your Applications
Retrieve all applications you own:Deleting Your Bot
Permanently delete a bot application:Inviting Your Bot
OAuth2 Authorization URL
Generate an invite link for your bot:Your application ID
Always
bot for bot invitationsBitfield of requested permissions (see Permissions section)
Pre-select a specific guild (user must have MANAGE_GUILD permission)
Permission Calculation
Calculate the permissions bitfield:Common Permission Sets
- Basic Bot
- Moderation Bot
- Admin Bot
Testing Your Bot
Verify Token
Test your bot token works:Get Gateway Info
Verify your bot can access the Gateway:Next Steps
Now that you have a bot account and token:Connect to Gateway
Establish a WebSocket connection to receive real-time events
Send Your First Message
Use the REST API to send messages
Handle Commands
Process user commands and interactions
Set Up Webhooks
Configure webhooks for event delivery
Troubleshooting
Error: Unclaimed accounts cannot create applications
Error: Unclaimed accounts cannot create applications
You must verify your email address before creating bot applications. Check your inbox for a verification email.
Error: Bot user generation failed
Error: Bot user generation failed
This occurs when the username generation exhausts available discriminators (rare). The system will retry with random usernames up to 100 times. Contact support if this persists.
Bot token not working
Bot token not working
Ensure you’re using the correct authorization header format:Not
Bearer, but Bot as the prefix.Cannot change bot discriminator
Cannot change bot discriminator
Bot discriminators are automatically assigned and cannot be directly changed. Changing the username will trigger a new discriminator assignment.
Security Best Practices
Use Environment Variables
Never hardcode tokens in your source code. Use environment variables or secure secret management systems.
Rotate Tokens Regularly
Set up a schedule to rotate bot tokens (e.g., every 90 days) to minimize the impact of potential compromises.
Use Separate Bots
Maintain separate bot applications for development, staging, and production environments.