Skip to content

Commit 3be5c23

Browse files
committed
Added the parameters scope and language_code to the method getMyCommands
1 parent e26a06e commit 3be5c23

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

library/src/main/java/com/pengrad/telegrambot/request/GetMyCommands.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.pengrad.telegrambot.request;
22

3+
import com.pengrad.telegrambot.model.botcommandscope.BotCommandScope;
34
import com.pengrad.telegrambot.response.GetMyCommandsResponse;
45

56
/**
@@ -11,4 +12,24 @@ public class GetMyCommands extends BaseRequest<GetMyCommands, GetMyCommandsRespo
1112
public GetMyCommands() {
1213
super(GetMyCommandsResponse.class);
1314
}
15+
16+
/**
17+
*
18+
* @param scope An object that extends the BotCommandScope class. For example: new BotCommandScopeAllPrivateChats()
19+
* @return
20+
*/
21+
public GetMyCommands scope(BotCommandScope scope) {
22+
add("scope", scope);
23+
return this;
24+
}
25+
26+
/**
27+
*
28+
* @param languageCode A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
29+
* @return
30+
*/
31+
public GetMyCommands languageCode(String languageCode) {
32+
add("language_code", languageCode);
33+
return this;
34+
}
1435
}

0 commit comments

Comments
 (0)