TGStory is a Telegram bot that allows users to share images & videos within chats using Mini Apps.
-
Create Bot:
- Start a chat with
@BotFather
. - Use
/newbot
and follow the prompts.
- Start a chat with
-
Configure Mini App:
- Create web app for bot:
/newapp
and follow the prompts.
- Create web app for bot:
- Open Mini App:
https://t.me/botusername/appname
- With
startapp
parameter:https://t.me/botusername/appname?startapp=command
- With
startapp
and compact mode:https://t.me/botusername/appname?startapp=command&mode=compact
-
Deploy
story.js
to Cloudflare Worker. -
Create KV Namespace:
- Name it
IMAGES
.
- Name it
-
Bind KV Namespace to Worker.
-
Set Environment Variables:
TOKEN
: Your bot token.DOMAIN
: Worker URL, e.g.,https://example.subdomain.workers.dev/
-
Set Webhook:
https://api.telegram.org/botTOKEN/setWebhook?url=https://example.subdomain.workers.dev/bot
-
Done! Start sending images to the bot.