Two settings. One password.
Keep @mazalexebot and your existing mazal-exe Pages project. Confirm the database and Telegram token, upload the update, then unlock with the password you already chose.
Everything here uses your browser and Telegram. No GitHub, terminal, Node installation, or always-on laptop.
What goes where
Extract MAZAL-EXE-ALL-IN-ONE-v1.1.2.zip once. This is your complete download bundle. It contains the separately packaged deployment.
| Inside the bundle | Where to use it |
|---|---|
00_START_HERE.html00_START_HERE.txt | Open either on your device. This HTML guide also works offline. |
01_UPLOAD_TO_CLOUDFLARE_PAGES.zip | Upload this inner ZIP to Cloudflare Pages Direct Upload. It already contains the Worker, setup interface, quote bank and AI adapter. |
02_AVATARS_AND_REACTIONS/ | Optional pictures for Telegram. Open the folder and send individual images as photos. |
03_SOURCE_AND_VOICE.zip | Keep for future updates. Contains source, tests, all 50 quotes and the private quote-source audit. Do not upload this archive to the public site. |
04_RELEASE_NOTES.txt05_TEST_REPORT.txt | Read the changes and what was verified. |
01_UPLOAD_TO_CLOUDFLARE_PAGES.zip. The complete outer bundle is for you to keep.There is no second AI application to upload. Its code is already inside the deployment ZIP; you activate it with bindings and settings later.
Only two required Cloudflare entries
Open Cloudflare → Workers & Pages → mazal-exe → Settings. Confirm these in Production before uploading:
| Where | Setting | Use |
|---|---|---|
| Bindings → D1 database | DB | Select your existing mazal-exe-db. |
| Variables and Secrets | TELEGRAM_BOT_TOKENtype Secret / Encrypt | Keep the existing active token for @mazalexebot. |
If both are already correct, leave them in place. Keep your bot's username, chat and profile picture.
Update your existing bot
1. Confirm the two settings above
In the existing mazal-exe Pages project, keep DB → mazal-exe-db and the existing TELEGRAM_BOT_TOKEN. Save any missing binding or token before creating the deployment.
Nothing needs to be pasted into the D1 SQL console. Select mazal-exe-db as the DB binding in the Pages project's Production settings. Initialize DB will create the bot's namespaced tables automatically.
2. Upload the inner ZIP to Production
Choose Create a new deployment → Production. Upload 01_UPLOAD_TO_CLOUDFLARE_PAGES.zip unchanged, then Save and Deploy. This new deployment picks up your saved settings.
_worker.js and _routes.json at the root of the inner ZIP.Open mazal-exe.pages.dev/health. Look for:
{
"service": "mazal.exe",
"version": "1.1.2",
"runtime": "Cloudflare Worker",
"hosting": "Cloudflare Pages"
}If /health still says v1.1.0, the old build is live. Complete the new v1.1.2 Production upload before using the simplified password setup. Changing settings alone does not install the update.
The guide is at mazal-exe.pages.dev/guide. A static “backend is not executing here” page means the upload target needs correcting.
3. Unlock and initialize
- Open mazal-exe.pages.dev/setup. Enter your chosen password and click Unlock / Check. Clear password clears the entered value from the page.
- Confirm the token identifies @mazalexebot. Click Initialize DB. It is safe to run again and preserves your existing Mazal v1 data.
- Click Unlock / Check again. If your owner account is already linked, skip pairing.
- Only if no owner is linked: if an older webhook is active, expand Moving the same bot from an older webhook? and click Disconnect old webhook for pairing first. Then click Create pairing code, send the exact
/pair CODEto @mazalexebot from your own private chat, and click Complete pairing. If you already sent the command before disconnecting, resend it afterwards while valid, or create a new code if expired.
4. Register webhook — required once for v1.1.2
Then click Unlock / Check. The webhook should be https://mazal-exe.pages.dev/telegram.
5. Try it in Telegram
Open @mazalexebot and send /start, then fortune, meme lottery, or give me a riddle. /start and these built-in requests need no AI setup. Owner /test checks the approval-and-delivery path; /invite creates a one-use invitation for a friend.
Where your OpenAI key goes
Open your existing mazal-exe gateway
Your gateway is already created. In AI → AI Gateway → mazal-exe, select Provider Keys. The overview's code examples have no key input; the provider-key form is inside this gateway.
mazal-exeOpenAI provider key alias:
defaultThese are different settings. Keep your existing gateway.
The Cloudflare API token shown in the curl example is not needed by this bot's AI binding. There is no curl or terminal step.
If your credits are in your OpenAI API organization, use a project API key from that organization. In Cloudflare:
Provider: OpenAI
API key: your OpenAI project key
Alias:
defaultClick Save.
Then open that gateway's Settings and turn Require provider credentials ON. Keep gateway authentication enabled. This uses your OpenAI organization's billing/eligible credits and prevents fallback to Cloudflare-managed provider credentials. Reuse a correctly stored key if it is already there.
If you purchased Cloudflare AI Gateway credits instead: use the funded gateway with Unified Billing; this route needs no OpenAI key. A stored OpenAI key under alias default takes precedence over Cloudflare credits.
Connect the gateway to the Pages project
- In mazal-exe → Settings → Bindings → Production, add or reuse a Workers AI binding named
AI. - Under Variables and Secrets → Production, use these plain-text variables:
Use your existing gateway IDAI_GATEWAY_ID = mazal-exe AI_MODEL = openai/gpt-5.6-lunamazal-exe;defaultis the provider-key alias. - After saving any settings changes, create a new Production deployment using the same inner ZIP.
- At /setup, enter your chosen password and click Unlock / Check → Test AI → Enable AI. Test AI makes one metered call.
The agreed model stays openai/gpt-5.6-luna. The Worker handles permissions, cards, quotes and delivery. AI interprets language and drafts replies; personal AI replies to friends wait for your approval and keep the AI disclosure.
Eligible ChatGPT API-credit benefits must be activated for the relevant OpenAI organization. Check its balance and model access. API usage does not inherit this ChatGPT conversation or its private history. No Cloudflare API token is required by this bot; the AI binding authenticates within your Cloudflare account.
AI starts off for a new database. Defaults are 20 AI requests per person and 100 total per UTC day, with at most 900 output tokens per call and no automatic model upgrade. Deterministic features use no model calls. These limits reduce usage; they do not guarantee a zero bill.
Install the pictures where you want them
Your existing bot profile picture can stay. The 02_AVATARS_AND_REACTIONS folder includes the profile, dealer, surprised, Kappa, MLG, Bateman and hardbass images, plus the frog prize and an interface concept board.
| Image | Action |
|---|---|
MAZAL-EXE-Profile.png | Optional: BotFather → select existing @mazalexebot → edit profile picture. |
MAZAL-EXE-Dealer.png | In your own bot chat, send /avatar, then send this image as a photo. |
MAZAL-Frog-Prize.png or a reaction image | Send /memeadd, then one image as a photo. Repeat for other lottery prizes. |
Choose Telegram's photo/image option. Uploading the PNG as a document does not install it in the bot. The PNGs are reaction images; this bundle does not automatically publish a Telegram sticker set.
If something stops you
| What you see | What to do |
|---|---|
_routes.json is not supported, or a static fallback appears | Use the existing mazal-exe Pages project and upload the complete inner deployment ZIP as Production. |
| Old URL or older version | Open https://mazal-exe.pages.dev and check /health for version 1.1.2. Wait for the new Production deployment to finish. |
| Password is rejected | Enter the password you already chose, unchanged. Confirm you are on the v1.1.2 deployment. A deliberately configured MAZAL_PASSWORD override replaces the packaged password; see DEPLOY.txt. |
| DB or Telegram token is missing | Confirm DB → mazal-exe-db and the active TELEGRAM_BOT_TOKEN in Production, then deploy the inner ZIP again. |
| Bot stops replying after this update | Unlock the setup page and click Register webhook once. v1.1.2 automatically derives a new verification value for Telegram deliveries. |
| Owner already linked | Keep the existing owner, skip pairing and click Register webhook. |
| Pairing is not found | If an old webhook is active, click Disconnect old webhook for pairing before sending or resending the unexpired command to the same bot from your own private chat. Then Complete pairing. Keep pending messages. |
| No gateway exists in the account | Only in that case: AI → AI Gateway → Create Gateway → name mazal-exe → Create, then open it. Your current mazal-exe gateway already exists, so skip creation. |
| AI test fails | Keep AI off. Check AI, the gateway name, model access and the chosen key/credit balance. Games and quotes remain usable. |
/pause suspends new games/AI and queued approved replies. /resume restores service. Your approval controls remain separate from guest messages and model output.
What this release includes
Fifty direct Alexey quotes (30 English, 20 Russian), random draws without repeats until each cycle finishes, blackjack, meme lottery, bilingual riddles, owner-set status, map-search links, natural-language routing, short approved-chat context and Telegram approvals. The selected voice examples are included in the model prompt; no fine-tuning has been run.
Written messages are implemented. Voice-note transcription, spoken replies, Gmail and personal WhatsApp connections are future integrations. The test report distinguishes local verification from the live checks you complete in your own account.
Official setup references
- AI Gateway getting started — create a named gateway manually in the dashboard.
- Cloudflare Pages Direct Upload — ZIP upload and root _worker.js support.
- Pages bindings — D1, Workers AI and redeployment.
- Telegram BotFather — existing bots and token management.
- AI binding and gateway — model calls and default provider-key alias.
- AI Gateway billing — credits and credential precedence.
- GPT-5.6 Luna on Cloudflare — agreed model.
- ChatGPT API-credit eligibility — activation and billing boundaries.