-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add official telegram test environment support #1320
Conversation
https://core.telegram.org/bots/webapps **** Using bots in the test environment To log in to the test environment, use either of the following: iOS: tap 10 times on the Settings icon > Accounts > Login to another account > Test. Telegram Desktop: open ☰ Settings > Shift + Alt + Right click ‘Add Account’ and select ‘Test Server’. macOS: click the Settings icon 10 times to open the Debug Menu, ⌘ + click ‘Add Account’ and log in via phone number. 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. 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 Note: When working with the test environment, you may use HTTP links without TLS to test your Web App. *****
A semicolon were missing in the Standalone reply code. The reply signature changed and needs a BiConsumer<BaseAbilityBot, Update> instead of Consumer<Update> in the Ability reply
Add getMessageId to MaybeInaccessibleMessage According to https://core.telegram.org/bots/api#maybeinaccessiblemessage
…ed from 'Boolean' to 'String' (according to TelegramBotAPI Official Documentation). (rubenlagus#1315)
* fix force=true for WriteAccessAllowed * + test and fixtures on write access allowed
* Fix path for GetMyName method * Add missing sticker methods from API 6.6 * Fix possible NPE in InputSticker validation * Add ReplyParameters to SendInvoice API method * Removed mysterious fields in SetChatTitle
c4394aa
to
7df1524
Compare
bc4fd52
to
65c33e0
Compare
@@ -279,6 +279,14 @@ private List<Update> getUpdatesFromServer() throws IOException { | |||
} | |||
} | |||
|
|||
private String getApiUrl() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need this method? It look like duplication of logic with getBaseUrl()
@@ -123,7 +120,11 @@ public final DefaultBotOptions getOptions() { | |||
} | |||
|
|||
public String getBaseUrl() { | |||
return options.getBaseUrl() + getBotToken() + "/"; | |||
String baseUrl = options.getBaseUrl() + getBotToken() + "/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not it better to allow user set url for http request on start? For example, using standard setBaseUrl, and just use everywhere method getBaseUrl(). And don't add implicit changes. What if in future telegram decide to change url again.
Add "/test/" into telegram api url for test environments.
From the docs:
https://core.telegram.org/bots/webapps
Using bots in the test environment
To log in to the test environment, use either of the following:
iOS: tap 10 times on the Settings icon > Accounts > Login to another account > Test.
Telegram Desktop: open ☰ Settings > Shift + Alt + Right click ‘Add Account’ and select ‘Test Server’.
macOS: click the Settings icon 10 times to open the Debug Menu, ⌘ + click ‘Add Account’ and log in via phone number.
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.
After receiving your bot token, you can send requests to the Bot API in this format:
https://api.telegram.org/bot/test/METHOD_NAME
Note: When working with the test environment, you may use HTTP links without TLS to test your Web App. *****