ton-society / grants-and-bounties

TON Foundation invites talent to imagine and realize projects that have the potential to integrate with the daily lives of users.
https://ton.org/grants
314 stars 137 forks source link

Example of a telegram bot that uses TonConnect 2.0 #176

Closed siandreev closed 1 year ago

siandreev commented 1 year ago

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

Definition of Done

Reward

Total: $600

siandreev commented 1 year ago

It could be assigned to me

Naltox commented 1 year ago

Let's add "article on using Ton Connect 2.0 in Telegram bot's at ton.org/dev" to deliverables, otherwise LGTM

delovoyhomie commented 1 year ago

@siandreev, any updates?

siandreev commented 1 year ago

WIP right now. Creating a wallet selection bot pseudoUI took more time than I expected

siandreev commented 1 year ago

@delovoyhomie the task is done. Ton docs PR: https://github.com/ton-community/ton-docs/pull/217 Bot example source code: https://github.com/ton-connect/demo-telegram-bot Bot instance: ton_connect_example_bot

delovoyhomie commented 1 year ago

@siandreev, create a PR to Hall of Fame according to the instructions in Readme.

siandreev commented 1 year ago

@delovoyhomie, PR created: https://github.com/ton-society/ton-footsteps/pull/197