All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pro.zackpollard.telegrambot.api.chat.CallbackQuery Maven / Gradle / Ivy

package pro.zackpollard.telegrambot.api.chat;

import org.json.JSONObject;
import pro.zackpollard.telegrambot.api.TelegramBot;
import pro.zackpollard.telegrambot.api.user.User;

/**
 * @author zackp
 */
public interface CallbackQuery {

    TelegramBot getBotInstance();

    String getId();

    default CallbackQueryType getType() {

        return CallbackQueryType.UNKNOWN;
    }

    User getFrom();

    String getData();

    JSONObject asJson();

    default boolean answer(String text, boolean showAlert) {

        return getBotInstance().answerCallbackQuery(getId(), text, showAlert);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy