|
19 | 19 | import com.pengrad.telegrambot.checks.WebhookInfoTest; |
20 | 20 | import com.pengrad.telegrambot.impl.TelegramBotClient; |
21 | 21 | import com.pengrad.telegrambot.model.*; |
| 22 | +import com.pengrad.telegrambot.model.botcommandscope.BotCommandScopeAllChatAdministrators; |
22 | 23 | import com.pengrad.telegrambot.model.request.ChatAction; |
23 | 24 | import com.pengrad.telegrambot.model.request.ForceReply; |
24 | 25 | import com.pengrad.telegrambot.model.request.InlineKeyboardButton; |
@@ -1874,10 +1875,19 @@ public void setMyCommands() { |
1874 | 1875 | new BotCommand("c2", "desc2"), |
1875 | 1876 | new BotCommand("c3", "desc3"), |
1876 | 1877 | }; |
1877 | | - BaseResponse response = bot.execute(new SetMyCommands(commands)); |
| 1878 | + |
| 1879 | + SetMyCommands cmds = new SetMyCommands(commands); |
| 1880 | + cmds.languageCode("en"); |
| 1881 | + cmds.scope(new BotCommandScopeAllChatAdministrators()); |
| 1882 | + |
| 1883 | + BaseResponse response = bot.execute(cmds); |
1878 | 1884 | assertTrue(response.isOk()); |
1879 | 1885 |
|
1880 | | - GetMyCommandsResponse commandsResponse = bot.execute(new GetMyCommands()); |
| 1886 | + GetMyCommands getCmds = new GetMyCommands(); |
| 1887 | + getCmds.languageCode("en"); |
| 1888 | + getCmds.scope(new BotCommandScopeAllChatAdministrators()); |
| 1889 | + |
| 1890 | + GetMyCommandsResponse commandsResponse = bot.execute(getCmds); |
1881 | 1891 | assertTrue(commandsResponse.isOk()); |
1882 | 1892 | assertArrayEquals(commandsResponse.commands(), commands); |
1883 | 1893 | } |
|
0 commit comments