-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commands Reference
Complete reference for all available bot commands.
All commands use Discord's slash command system. Type / to see available commands.
Description: Display all products you own on SourceXchange.
Permissions Required:
- None (any user can use this command)
Usage:
/products
Response:
Success:
**Purchased Products:** SourceXChange Sync BotNo products:
You haven't purchased any products yet.
Error:
Failed to fetch products. Make sure your Discord is linked.
Example Use Cases:
- Check which products you own
- Verify a purchase went through
- Debug role sync issues
Notes:
- Requires Discord account to be linked on SourceXchange
- Shows all products, not just the one configured for role sync
- Product IDs are displayed for reference
Description: Sync your Discord role based on your SourceXchange product purchases.
Permissions Required:
- None (any user can use this command)
Usage:
/sync
Response:
Role granted:
Role **[Role Name]** has been added!Role removed:
Role **[Role Name]** has been removed.Role already correct:
You already have the **[Role Name]** role.Possible Errors:
Discord not linked:
Failed to sync roles. Make sure your Discord is linked.
Role not found:
Role not found in this server.
Example Use Cases:
- After purchasing a product on SourceXchange
- When joining a new server
- After linking your Discord account
- When you believe your role is out of sync
Notes:
- Checks if you own the product configured in
PRODUCT_ID - Adds the role if you own the product
- Removes the role if you don't own the product
- Safe to run multiple times
Rate Limiting:
- No built-in rate limit
- SourceXchange API may have rate limits
- Don't spam the command
- User runs command → Discord sends the interaction
- Bot receives interaction → Defers reply (shows "Bot is thinking...")
- Bot makes API request → Calls SourceXchange API with user's Discord ID
- Bot processes response → Checks product ownership
- Bot takes action → Grants/removes role or displays products
- Bot sends reply → User receives confirmation message
- Typical: 1-3 seconds
- Slow API: 5-10 seconds
- Timeout: 15 seconds (Discord limit)
If a command times out, it failed but you can try again.
The bot gracefully handles:
- SourceXchange API errors
- Discord permission errors
- Network timeouts
- Invalid configurations
- Missing roles
GET https://sourcexchange.net/api/users/discord
Authorization: Bearer {API_TOKEN}
Query: id={USER_DISCORD_ID}
GET https://sourcexchange.net/api/users/discord
Authorization: Bearer {API_TOKEN}
Query: id={USER_DISCORD_ID}
Then manages Discord roles via Discord API.
For commands to work properly, the bot requires:
- Use Slash Commands (to be able to use commands)
- Send Messages (to respond)
- Manage Roles (for
/sync)
If you have suggestions for new commands or improvements:
- Open an issue
- Submit a pull request
- User Guide - Learn how to use the bot
- Troubleshooting - Fix common issues