MAZAL.EXE
A digital understudy. An unreasonably well-administered frog department.
Connect Telegram first. Switch on AI when the bot is working.
1Unlock setup
Use the ADMIN_SETUP_KEY you saved as a Cloudflare secret. It stays in this page's memory until you close or reload it.
Need to generate the two secrets?
Generate locally in this browser. Save each value in Cloudflare → your Pages project → Settings → Variables and Secrets → Production, type Secret, then redeploy the same ZIP. Add the BotFather token separately as TELEGRAM_BOT_TOKEN.
2Initialize memory
Create a fresh D1 database in Cloudflare and bind it to this Pages project in Production with variable name DB. Then initialize the bot's tables.
Safe to run again for this release. Your existing Mazal v1 data is preserved.
Exact bindings and secrets
D1 database binding: DB Required secrets: TELEGRAM_BOT_TOKEN TELEGRAM_WEBHOOK_SECRET ADMIN_SETUP_KEY Optional AI binding: AI Required for AI: AI_GATEWAY_ID = mazal Default AI_MODEL: openai/gpt-5.6-luna
3Pair real Alexey
Create a code, then send the exact command to your new bot from your own private Telegram chat. Return here to complete pairing.
No numeric ID lookup is needed. Keep the pairing command private.
4Connect Telegram
Register the webhook after pairing. It connects this stable production Pages URL to your bot.
Then open your bot with /start. Type “meme lottery” or “give me a riddle”. Owner /test sends a synthetic approval draft to you.
Upload the included dealer image with /avatar and frog image with /memeadd.
Ready when you are.
Start with Check. This page does not ask for your Telegram bot token.
5AI, when ready
Create a gateway called mazal. Store your OpenAI project key under its default provider alias and enable Require provider credentials. Add the AI binding and AI_GATEWAY_ID=mazal to Production, then redeploy the same ZIP. Test uses one metered model call. Games work without AI. Read AI and billing instructions before enabling.
Guest AI messages become drafts in your Telegram chat. Approve the exact text, edit it, or reject it. No Gmail or personal WhatsApp sending is connected.
Maintenance
Retry known pending deliveries, or remove expired records. Bot activity also processes retries and runs cleanup at most daily. This Pages package has no Cron Trigger; use these buttons for idle maintenance.
Delivery recovery
A timeout can leave delivery uncertain. These messages are held for your review. Check Telegram before resending: a message may already have arrived.
Disconnect this bot
Stops incoming Telegram delivery to the Worker. Pending Telegram updates are preserved. Register again to reconnect.
Guests join through your one-use /invite links. /pause suspends games, AI and queued approved replies; a send already in flight cannot be recalled. /resume restores service. All personal AI replies carry a disclosure.