pro.zackpollard.telegrambot.api.internal.chat.message.content.NewParticipantContentImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtelegram-botapi Show documentation
Show all versions of jtelegram-botapi Show documentation
The Java Telegram Bot API is a wrapper for the Telegram HTTP Bot API
package pro.zackpollard.telegrambot.api.internal.chat.message.content;
import org.json.JSONObject;
import pro.zackpollard.telegrambot.api.chat.message.content.NewChatParticipantContent;
import pro.zackpollard.telegrambot.api.internal.user.UserImpl;
import pro.zackpollard.telegrambot.api.user.User;
/**
* @author Zack Pollard
*/
public class NewParticipantContentImpl implements NewChatParticipantContent {
private final User content;
private NewParticipantContentImpl(JSONObject jsonObject) {
this.content = UserImpl.createUser(jsonObject);
}
public static NewChatParticipantContent createNewParticipantContent(JSONObject jsonObject) {
return jsonObject != null ? new NewParticipantContentImpl(jsonObject) : null;
}
/**
* Gets the new participant in the chat
*
* @return The new participant, or null if there was no new participant
*/
@Override
public User getContent() {
return content;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy