bot icon indicating copy to clipboard operation
bot copied to clipboard

Able to connect bot to the test network

Open saneqq opened this issue 1 year ago • 1 comments

The test environment is completely separate from the main environment, so you will need to create a new user account and a new bot with @BotFather. This is very convenient when connecting a web app with a bot https://docs.ton.org/develop/dapps/telegram-apps/testing-apps examples https://docs.pyrogram.org/topics/test-servers

saneqq avatar Jun 11 '24 10:06 saneqq

What actions are required for this support?

negasus avatar Jul 18 '24 14:07 negasus

Hi @negasus

ran into the same question as @saneqq

Bot API 6.0 introduced the test environment

After receiving your bot token, you can send requests to the Bot API in this format:

https://api.telegram.org/bot<token>/test/METHOD_NAME

so i guess to support that it would need a flag - eg UseTestEnvironment - to pass to bot.New - using bot tokens created with an account in the test env get rejected by as Unauthorized when initializing the bot.

fvbock avatar Aug 20 '24 11:08 fvbock

thanks @negasus !

works well.

fvbock avatar Aug 23 '24 02:08 fvbock