PERSONAL INSTANCE / CONTROL ROOM / v1.1.2 / PAGES

MAZAL.EXE

A digital understudy. An unreasonably well-administered frog department.
Keep using @mazalexebot and its existing token. Connect this deployment first; switch on AI when the bot is working.
Open the upload and setup guide for the exact file map.

1One password. In you go.

Paste the password you chose for this package. It unlocks every setup action and stays only in this tab's memory.

Cloudflare needs your existing bot token and DB binding. Webhook verification is automatic. Setup guide

CONNECTION

Ready when you are.

Enter your chosen password, then Unlock / Check. Connection results appear here.

2Initialize memory

In this Pages project's Production settings, bind your existing mazal-exe-db database using the variable name DB. You do not need to type SQL or add rows manually: Initialize DB creates the bot's tables.

Safe to run again for this release. Your existing Mazal v1 data is preserved.

Exact Cloudflare configuration
D1 database binding: DB → mazal-exe-db
Required secret: TELEGRAM_BOT_TOKEN
  Keep the existing @mazalexebot token.
Optional AI binding: AI
Required for AI: AI_GATEWAY_ID = mazal-exe
Default AI_MODEL: openai/gpt-5.6-luna
Optional owner override: TELEGRAM_OWNER_ID
  Your numeric user ID, never the bot ID.

3Pair real Alexey

If Unlock / Check already shows your owner account, skip this step and Register webhook. Otherwise create a code, send the exact command to @mazalexebot in your own private Telegram chat, then return here to complete pairing.

Moving the same bot from an older webhook?

When the owner is not linked in this database, disconnect the old webhook before sending the pairing command. This preserves pending Telegram updates. Then create a code, send or resend it to the same bot, complete pairing, and register this deployment. Keep the same Telegram token.

If a backlog prevents pairing, reuse the already-paired v1 database. Alternatively copy your own numeric owner ID from the previous setup Check into the TELEGRAM_OWNER_ID Production variable and redeploy. This does not discard queued messages. Never use the bot's numeric ID.

Keep the pairing command private. Pairing normally identifies your account without a numeric ID lookup.

4Connect Telegram

Click Register webhook once after installing v1.1.2, even if it was connected before. Verification is now generated automatically from the existing bot token. This reconnects the same bot and preserves pending Telegram updates.

Use mazal-exe.pages.dev/setup, then open @mazalexebot 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.

5Give the understudy a voice

Open Cloudflare → AI → AI Gateway → mazal-exe. That is your existing gateway. The key fields are inside the gateway, under Provider Keys.

Inside that gateway: Provider Keys → Add API Key → OpenAI. Paste your OpenAI key and keep the alias default. In gateway Settings, enable Require provider credentials to use that OpenAI account's billing. The bot's AI binding handles Cloudflare authentication.

If you bought Cloudflare AI Gateway credits, use the funded gateway without an OpenAI key. In either case, add the AI binding and AI_GATEWAY_ID=mazal-exe to this Pages project's Production settings, then redeploy the same ZIP.

Test AI uses one metered call. AI setup guide · Billing and guardrails. Guest AI replies wait for your approval in Telegram.

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.