https://github.com/nyavro/positive
Web App Telegram bot
https://github.com/nyavro/positive
bot telegram webapp
Last synced: 7 months ago
JSON representation
Web App Telegram bot
- Host: GitHub
- URL: https://github.com/nyavro/positive
- Owner: nyavro
- Created: 2022-04-19T16:09:49.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-21T15:02:22.000Z (over 3 years ago)
- Last Synced: 2025-02-28T08:05:40.842Z (8 months ago)
- Topics: bot, telegram, webapp
- Language: TypeScript
- Homepage:
- Size: 261 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Positive
Positive is a simple [Telegram](https://telegram.org/) bot demonstrating *Web Apps*
feature introduced in [Bot API v.6.0](https://core.telegram.org/bots/api#april-16-2022)The bot itself is a modified [echo bot](https://github.com/kotlin-telegram-bot/kotlin-telegram-bot/tree/main/samples/echo) implemented using Kotlin wrapper around Telegram bot API
Web application source code is under **UI** folder, it is implemented using React and Typescript.### Running
To run the bot:
1. Create the bot account and obtain bot token at [@BotFather](https://t.me/botfather)
2. Save the token to an environment variable named POSITIVE_BOT_TOKEN, it is used throught the project
3. Build Web App:cd ui
npm i
npm run build
After build is done you'll see web static files required for Bot web app at /dist folder.
4. Host generated static somewhere available by HTTPS protocol, for example https://nyavro.github.io/index.html
5. Go to @BotFather and run command /setmenubutton with an URL configured at previous step.
6. Run main Main.kt. This will start echo bot.
7. Open your bot in Telegram and click at Bot's 'menu' button configured at step 5.
8. See the web app, click buttons and get a response from web app to the bot:
