Skip to content

Commit d144e90

Browse files
committed
deleteMyCommands test
1 parent 4a93a76 commit d144e90

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,24 @@ public void setMyCommands() {
18921892
assertArrayEquals(commandsResponse.commands(), commands);
18931893
}
18941894

1895+
@Test
1896+
public void deleteMyCommands() {
1897+
DeleteMyCommands cmds = new DeleteMyCommands();
1898+
cmds.languageCode("en");
1899+
cmds.scope(new BotCommandScopeAllChatAdministrators());
1900+
1901+
BaseResponse response = bot.execute(cmds);
1902+
assertTrue(response.isOk());
1903+
1904+
GetMyCommands getCmds = new GetMyCommands();
1905+
getCmds.languageCode("en");
1906+
getCmds.scope(new BotCommandScopeAllChatAdministrators());
1907+
1908+
GetMyCommandsResponse commandsResponse = bot.execute(getCmds);
1909+
assertTrue(commandsResponse.isOk());
1910+
assertArrayEquals(commandsResponse.commands(), new BotCommand[0]);
1911+
}
1912+
18951913
@Test
18961914
public void inviteLinks() {
18971915
int memberLimit = 2;

0 commit comments

Comments
 (0)