This commit is contained in:
Rubenlagus 2017-05-11 01:35:44 +02:00 committed by Ruben Bermudez
parent e61a52dc11
commit 48a7503c7f
2 changed files with 11 additions and 5 deletions

View File

@ -14,10 +14,9 @@ import java.util.Objects;
/** /**
* @author Ruben Bermudez * @author Ruben Bermudez
* @version 1.0 * @version 1.0
* @brief Use this method to unban a previously kicked user in a supergroup. The user will not * Use this method to unban a previously kicked user in a supergroup. The user will not
* return to the group automatically, but will be able to join via link, etc. The bot must be an * return to the group automatically, but will be able to join via link, etc. The bot must be an
* administrator in the group for this to work. Returns True on success. * administrator in the group for this to work. Returns True on success.
* @date 10 of April of 2016
*/ */
public class UnbanChatMember extends BotApiMethod<Boolean> { public class UnbanChatMember extends BotApiMethod<Boolean> {
public static final String PATH = "unbanchatmember"; public static final String PATH = "unbanchatmember";

View File

@ -6,9 +6,8 @@ import org.telegram.telegrambots.api.interfaces.BotApiObject;
/** /**
* @author Ruben Bermudez * @author Ruben Bermudez
* @version 1.0 * @version 3.0
* @brief This object represents a Telegram user or bot. * This object represents a Telegram user or bot.
* @date 20 of June of 2015
*/ */
public class User implements BotApiObject { public class User implements BotApiObject {
@ -16,6 +15,7 @@ public class User implements BotApiObject {
private static final String FIRSTNAME_FIELD = "first_name"; private static final String FIRSTNAME_FIELD = "first_name";
private static final String LASTNAME_FIELD = "last_name"; private static final String LASTNAME_FIELD = "last_name";
private static final String USERNAME_FIELD = "username"; private static final String USERNAME_FIELD = "username";
private static final String LANGUAGECODE_FIELD = "language_code";
@JsonProperty(ID_FIELD) @JsonProperty(ID_FIELD)
private Integer id; ///< Unique identifier for this user or bot private Integer id; ///< Unique identifier for this user or bot
@ -25,6 +25,8 @@ public class User implements BotApiObject {
private String lastName; ///< Optional. Users or bots last name private String lastName; ///< Optional. Users or bots last name
@JsonProperty(USERNAME_FIELD) @JsonProperty(USERNAME_FIELD)
private String userName; ///< Optional. Users or bots username private String userName; ///< Optional. Users or bots username
@JsonProperty(LANGUAGECODE_FIELD)
private String languageCode; ///< Optional. IETF language tag of the user's language
public User() { public User() {
super(); super();
@ -46,6 +48,10 @@ public class User implements BotApiObject {
return userName; return userName;
} }
public String getLanguageCode() {
return languageCode;
}
@Override @Override
public String toString() { public String toString() {
return "User{" + return "User{" +
@ -53,6 +59,7 @@ public class User implements BotApiObject {
", firstName='" + firstName + '\'' + ", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' + ", lastName='" + lastName + '\'' +
", userName='" + userName + '\'' + ", userName='" + userName + '\'' +
", languageCode='" + languageCode + '\'' +
'}'; '}';
} }
} }