3.8 KiB
Discord Commands Registration - Admin Panel
Overview
You can now register Discord slash commands directly from the Admin Panel, without needing terminal access.
How to Register Commands
Step 1: Go to Admin Panel
- Navigate to
https://aethex.dev/admin - Click on the "Discord" tab
Step 2: Click "Register Commands"
You'll see a new card titled "Discord Commands" at the top with a blue button that says "Register Commands".
Click this button.
Step 3: Enter Admin Token
A popup will appear asking for your admin registration token.
This token is:
- Set in your Vercel environment variables as
DISCORD_ADMIN_REGISTER_TOKEN - A random secure string (e.g.,
sk-admin-aethex-discord-2024)
Example popup:
Enter admin registration token (from environment variables):
[_________________________] [OK] [Cancel]
Step 4: Wait for Confirmation
The button will show "Registering..." with a spinning loader.
Once complete, you'll see one of:
✅ Success:
✅ Registered 5 new commands (Entry Point already exists)
⚠️ Partial Success (Error 50240):
✅ Registered 5 new commands (Entry Point managed by Discord)
❌ Error:
❌ Invalid or expired access token
What Gets Registered
The button registers these 5 Discord slash commands:
/verify- Link your Discord account to AeThex/set-realm- Choose your primary arm (Labs, GameForge, Corp, Foundation, Dev-Link)/profile- View your linked AeThex profile/unlink- Disconnect your Discord account/verify-role- Check your assigned Discord roles
Plus Discord's auto-generated "Entry Point" command (for Discord Activities).
Troubleshooting
"Unauthorized" Error
Issue: Getting this error when registering.
Solution:
- Check your
DISCORD_ADMIN_REGISTER_TOKENenvironment variable in Vercel - Make sure you entered the token exactly as it's set (case-sensitive)
- Verify token doesn't have extra spaces
"Failed to register commands" Error
Issue: Generic error when clicking the button.
Check:
- Is your bot deployed on PebbleHost?
- Are your
DISCORD_BOT_TOKENandDISCORD_CLIENT_IDenv vars set on Vercel (backend)? - Open browser console (F12) → Network tab → Check the POST request to
/api/discord/admin-register-commands
"Entry Point command already exists" (Not an Error)
This is expected! When you enable Discord Activities:
- Discord auto-creates an "Entry Point" command
- Our script recognizes this and doesn't try to overwrite it
- Your bot's 5 commands live alongside it peacefully
Environment Variables Required
On Vercel (Backend):
DISCORD_BOT_TOKEN=<your-bot-token>
DISCORD_CLIENT_ID=578971245454950421
DISCORD_ADMIN_REGISTER_TOKEN=sk-admin-aethex-discord-2024
On PebbleHost (Bot):
DISCORD_BOT_TOKEN=<your-bot-token>
DISCORD_CLIENT_ID=578971245454950421
DISCORD_PUBLIC_KEY=<your-public-key>
SUPABASE_URL=https://kmdeisowhtsalsekkzqd.supabase.co
SUPABASE_SERVICE_ROLE=<your-service-role>
Alternative Methods
If the admin button doesn't work, you can also register commands using:
curl (if you have PebbleHost console access)
curl -X POST https://aethex.dev/api/discord/admin-register-commands \
-H "Authorization: Bearer YOUR_DISCORD_ADMIN_REGISTER_TOKEN" \
-H "Content-Type: application/json"
Postman
- Create POST request to
https://aethex.dev/api/discord/admin-register-commands - Add header:
Authorization: Bearer YOUR_DISCORD_ADMIN_REGISTER_TOKEN - Click Send
Summary
✅ Click "Register Commands" in Admin → Discord tab
✅ Enter your admin token
✅ Wait for success confirmation
✅ Commands are now live in Discord
Done! 🎉