pro.zackpollard.telegrambot.api.internal.chat.ChatImpl 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;
import org.json.JSONObject;
import pro.zackpollard.telegrambot.api.chat.Chat;
/**
* @author Zack Pollard
*/
public class ChatImpl {
public static Chat createChat(JSONObject jsonObject) {
String chatType = jsonObject.getString("type");
switch(chatType) {
case "private": return IndividualChatImpl.createIndividualChat(jsonObject);
case "group": return GroupChatImpl.createGroupChat(jsonObject);
case "channel": return ChannelChatImpl.createChannelChat(jsonObject);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy