Example of a telegram bot that uses TonConnect 2.0
siandreev opened this issue · comments
Summary
At this step, it is proposed to explain how to create a telegram bot with authorization and sending transactions through the Ton Connect 2.0. Further, we suggest leaving the example running on the server provided by the author for 15 days.
Context
There are many examples of integrating Ton Connect into frontend applications (https://github.com/ton-connect/demo-dapp, https://github.com/ton-connect/demo-dapp-with-react-ui), as well as many examples of authorization on the backend through tone proof (https://github.com/ton-connect/demo-dapp-backend). However, there are no examples of working with Ton Connect for telegram bots (that is, examples when user sessions are stored and processed on the backend). When integrating the Ton Connect into a telegram bot, there are some difficulties: you need to manage user sessions and close unused connections to wallets.
Goals
Help those who wish to integrate the Ton Connect into telegram bots. This will simplify the creation of telegram bots in the Ton ecosystem, and increase the number of quality dApps based on telegram bots.
Deliverables
- an article about integrating the Ton Connect to a telegram bot
- a repository with the implementation of a simple telegram bot with a connection to the wallet via Ton Connect
- through the bot you can connect or disconnect the wallet
- through the bot you can send a transaction (0.001 ton to the zero address)
- the bot will be running on the author's server for at least 15 days
Definition of Done
- a repository with the implementation of a simple telegram bot in JavaScript (or TypeScript) with a connection to the wallet through the Ton Connect has been created
- the repository README.md describes in detail how the bot works, how to run it locally
- the bot allows you to connect any of the http-bridge-compatible wallets that support the Ton Connect 2.0 at the moment
- the bot allows you to send a simple transaction
- the bot drops the sse connection to the wallet if the user is not using the bot and reconnects when the user wants to send a transaction
Reward
- 600 USD in TON
- Standard TON Footstep NFT
Total: $600
It could be assigned to me
Let's add "article on using Ton Connect 2.0 in Telegram bot's at ton.org/dev" to deliverables, otherwise LGTM
@siandreev, any updates?
WIP right now. Creating a wallet selection bot pseudoUI took more time than I expected
@delovoyhomie the task is done.
Ton docs PR: ton-community/ton-docs#217
Bot example source code: https://github.com/ton-connect/demo-telegram-bot
Bot instance: ton_connect_example_bot
@siandreev, create a PR to Hall of Fame according to the instructions in Readme.
@delovoyhomie, PR created: #197