Skip to content

Commit b3a132a

Browse files
committed
setMyCommands and getMyCommands tests
1 parent 3be5c23 commit b3a132a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.pengrad.telegrambot.checks.WebhookInfoTest;
2020
import com.pengrad.telegrambot.impl.TelegramBotClient;
2121
import com.pengrad.telegrambot.model.*;
22+
import com.pengrad.telegrambot.model.botcommandscope.BotCommandScopeAllChatAdministrators;
2223
import com.pengrad.telegrambot.model.request.ChatAction;
2324
import com.pengrad.telegrambot.model.request.ForceReply;
2425
import com.pengrad.telegrambot.model.request.InlineKeyboardButton;
@@ -1874,10 +1875,19 @@ public void setMyCommands() {
18741875
new BotCommand("c2", "desc2"),
18751876
new BotCommand("c3", "desc3"),
18761877
};
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);
18781884
assertTrue(response.isOk());
18791885

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);
18811891
assertTrue(commandsResponse.isOk());
18821892
assertArrayEquals(commandsResponse.commands(), commands);
18831893
}

0 commit comments

Comments
 (0)