English | 简体中文
-
Verify Bot is Running
curl https://matrix-chatgpt-bot.facilis-velox.workers.dev/status
Expected:
{"isRunning":true,"syncToken":"..."} -
Check Secrets
wrangler secret list
Required secrets:
MATRIX_USER_ID(e.g.,@botuser:oi6.uk)MATRIX_PASSWORDOPENAI_API_KEY
Optional:
OPENAI_BASE_URLBOT_ADMIN_USERS(if set, only these users can use the bot)DEFAULT_MODEL
In your Matrix client:
/invite @your-bot-user-id:oi6.uk
Important: The bot accepts invites automatically every 2 minutes (via cron). Wait 2-3 minutes after inviting before testing.
Check if the bot appears in the room member list.
✅ Correct message formats:
Option 1: Use !gpt command (Easiest, recommended)
!gpt hello
!gpt what is the weather like?
Option 2: Mention the bot
@your-bot-user-id:oi6.uk hello
@your-bot-user-id:oi6.uk what is the weather like?
Option 3: Use other commands
!help
!reset
❌ Incorrect formats (bot will NOT respond):
hello
hey bot, how are you?
The bot responds to:
!gpt <message>- Chat with GPT (no mention needed)@bot-user-id message- Traditional mention!command- Other bot commands
- Bot checks for new messages every 2 minutes (cron schedule)
- Response should appear within 2-3 minutes
- If no response after 5 minutes, check logs
- Go to https://dash.cloudflare.com
- Navigate to: Workers & Pages → matrix-chatgpt-bot
- Click "Logs" tab
- Look for:
"Joined room: !...""Processing message from @sender:..."- Any error messages
Issue: Bot doesn't reply to messages
Possible causes:
-
Message format incorrect
- Solution: Use
!gpt helloor include full bot user ID:@botname:oi6.uk hello
- Solution: Use
-
User not in allowed list
- Check if
BOT_ADMIN_USERSsecret is set - If set, only listed users can use bot
- Solution: Add yourself to the list or remove the secret
- Check if
-
Bot hasn't joined room yet
- Wait 2-3 minutes after inviting
- Check Cloudflare logs for "Joined room" message
-
API key issues
- Invalid or expired
OPENAI_API_KEY - Check logs for API errors
- Invalid or expired
-
Cron not triggering
- Verify in Cloudflare dashboard: Workers → Triggers → Cron Triggers
- Should show:
*/2 * * * *(every 2 minutes)
Issue: Bot doesn't accept invite
Solution:
- Wait 2-3 minutes (cron runs every 2 minutes)
- Check logs for errors
- Verify bot has valid authentication
- Try re-inviting
Issue: Bot fails to login
Solution:
# Re-login
curl -X POST https://matrix-chatgpt-bot.facilis-velox.workers.dev/login
# Check result
curl https://matrix-chatgpt-bot.facilis-velox.workers.dev/status# Check health
curl https://matrix-chatgpt-bot.facilis-velox.workers.dev/health
# Check status
curl https://matrix-chatgpt-bot.facilis-velox.workers.dev/status
# Force login
curl -X POST https://matrix-chatgpt-bot.facilis-velox.workers.dev/login
# Start sync (if stopped)
curl https://matrix-chatgpt-bot.facilis-velox.workers.dev/start
# Stop sync (for debugging)
curl https://matrix-chatgpt-bot.facilis-velox.workers.dev/stop- Deploy bot:
wrangler deploy - Login:
curl -X POST https://your-worker.workers.dev/login - Start:
curl https://your-worker.workers.dev/start - In Matrix:
/invite @botuser:oi6.uk - Wait 2-3 minutes
- Send:
!gpt hello!or@botuser:oi6.uk hello! - Wait up to 2 minutes for response
Watch logs in real-time:
wrangler tailOr use Cloudflare dashboard for historical logs.
Try these commands once the bot is working:
!gpt tell me a joke
!gpt explain quantum computing
!help
!reset
!provider list
!model
@botuser:oi6.uk what is AI?
If bot still not responding after following all steps:
- Check Cloudflare Workers logs for errors
- Verify all secrets are set correctly
- Ensure MATRIX_HOMESERVER matches your user domain
- Try deleting and re-deploying:
wrangler delete && wrangler deploy