Skip to content

Commit 9cd21c5

Browse files
committed
Added the ability to set different bot names for different user languages using the method setMyName
1 parent 891b3f7 commit 9cd21c5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.pengrad.telegrambot.request;
2+
3+
import com.pengrad.telegrambot.response.BaseResponse;
4+
5+
public class SetMyName extends BaseRequest<SetMyName, BaseResponse> {
6+
7+
public SetMyName() {
8+
super(BaseResponse.class);
9+
}
10+
11+
/**
12+
*
13+
* @param name New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
14+
* @return
15+
*/
16+
public SetMyName name(String name) {
17+
add("name", name);
18+
return this;
19+
}
20+
21+
/**
22+
*
23+
* @param languageCode A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
24+
* @return
25+
*/
26+
public SetMyName languageCode(String languageCode) {
27+
add("language_code", languageCode);
28+
return this;
29+
}
30+
31+
}

0 commit comments

Comments
 (0)