Hamesuderet bot setup
Connect the Telegram bot after checking credentials and testing a conversion. Existing landing pages and Cloudflare click statistics stay separate.
Use a separate Telegram test bot first. Run the checks and a conversion test before activating a production webhook. Activation requires the Windows bot to be stopped.
1. Configure Cloudflare
In Cloudflare, open Workers & Pages → hamesuderet-bot → Settings → Variables and Secrets.
Add these as Secret values using your existing credentials:
TELEGRAM_BOT_TOKEN— the token from Telegram BotFather. Start with the separate test bot's token.ALI_APP_KEY,ALI_APP_SECRET,ALI_TRACKING_ID— your AliExpress affiliate credentials.ADMIN_API_KEY— a new, long random key for this setup page. Use at least 32 random characters.
The webhook verification secret is configured automatically. Do not put credentials in URLs or paste your .env file into chat.
Configure these variables:
ADMIN_CHAT_ID— your numeric Telegram user ID.ALLOWED_USER_IDS— comma-separated numeric IDs allowed to use the bot. To deliberately make the bot public, setALLOW_PUBLIC_BOT=true.DEEPLINK_USER_IDS— optional comma-separated IDs that receive smart links by default. If omitted, it defaults to the administrator.HA_URLand secretHA_TOKEN— for Home Assistant down/degraded alerts through health and heartbeat only. HA must be securely reachable from Cloudflare. Alternatively, setHA_DISABLED=true.
WRAP_URL is already configured. Keep it pointed at your existing smart-link domain.
Home Assistant receives health and heartbeat for alerts. Conversion counts, bot status and click analytics are available on the Cloudflare stats page.
2. Check and test
The key is kept only in this page's memory and sent in an Authorization header. It is never placed in a URL or saved in browser storage. Reloading the page clears it.
Checks inspect credentials, settings, Telegram webhook status and HA issues. They do not change the Telegram webhook.
The test calls AliExpress and uses your API quota. It returns the conversion result here without sending a Telegram message.
3. Activate the webhook
- Confirm the configuration check reports readiness and the conversion test succeeds.
- Stop the Windows bot and its automatic restart task or service.
- Confirm below, then activate. Send a Telegram link to verify the complete flow.
Activation changes where Telegram delivers this bot's updates. Deactivation removes the webhook. For rollback, deactivate it before restarting the Windows bot.
Result
No action has run.
Check the configuration to begin.