本文整理汇总了Java中org.telegram.telegrambots.api.objects.CallbackQuery类的典型用法代码示例。如果您正苦于以下问题:Java CallbackQuery类的具体用法?Java CallbackQuery怎么用?Java CallbackQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CallbackQuery类属于org.telegram.telegrambots.api.objects包,在下文中一共展示了CallbackQuery类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleCallbackQuery
import org.telegram.telegrambots.api.objects.CallbackQuery; //导入依赖的package包/类
private void handleCallbackQuery(CallbackQuery query) {
String data = query.getData();
if (query.getMessage() == null) {
simpleCallbackAnswer(query.getId());
log.info("Ignoring callback query because message is empty");
} else {
Long chatId = query.getMessage().getChatId();
Integer messageId = query.getMessage().getMessageId();
String queryId = query.getId();
Optional<FilterInfo> filterInfo = FilterInfo.fromString(data);
if (filterInfo.isPresent()) {
handleFilterQuery(filterInfo.get(), messageId, chatId, queryId);
} else {
handleMensaChange(data, chatId, queryId);
}
}
}
开发者ID:xabgesagtx,项目名称:mensa-api,代码行数:18,代码来源:MensaBot.java
示例2: assertCallbackQuery
import org.telegram.telegrambots.api.objects.CallbackQuery; //导入依赖的package包/类
private void assertCallbackQuery(CallbackQuery callbackQuery) {
Assert.assertNotNull(callbackQuery);
Assert.assertEquals("4382bfdwdsb323b2d9", callbackQuery.getId());
Assert.assertEquals("Data from button callback", callbackQuery.getData());
Assert.assertEquals("1234csdbsk4839", callbackQuery.getInlineMessageId());
assertFromUser(callbackQuery.getFrom());
}
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:8,代码来源:TestDeserialization.java
示例3: sendAnswerCallbackQuery
import org.telegram.telegrambots.api.objects.CallbackQuery; //导入依赖的package包/类
/**
*
* @param text The text that should be shown
* @param alert If the text should be shown as a alert or not
* @param callbackquery
* @throws TelegramApiException
*/
private void sendAnswerCallbackQuery(String text, boolean alert, CallbackQuery callbackquery) throws TelegramApiException{
AnswerCallbackQuery answerCallbackQuery = new AnswerCallbackQuery();
answerCallbackQuery.setCallbackQueryId(callbackquery.getId());
answerCallbackQuery.setShowAlert(alert);
answerCallbackQuery.setText(text);
answerCallbackQuery(answerCallbackQuery);
}
开发者ID:rubenlagus,项目名称:TelegramBotsExample,代码行数:15,代码来源:ElektrollArtFanHandler.java
示例4: sendAnswerCallbackQuery
import org.telegram.telegrambots.api.objects.CallbackQuery; //导入依赖的package包/类
public void sendAnswerCallbackQuery(String text, boolean alert, CallbackQuery callbackquery) throws TelegramApiException {
AnswerCallbackQuery answerCallbackQuery = new AnswerCallbackQuery();
answerCallbackQuery.setCallbackQueryId(callbackquery.getId());
answerCallbackQuery.setShowAlert(alert);
answerCallbackQuery.setText(text);
answerCallbackQuery(answerCallbackQuery);
}
开发者ID:freedomotic,项目名称:freedomotic,代码行数:8,代码来源:FreedomoticBotHandlers.java
注:本文中的org.telegram.telegrambots.api.objects.CallbackQuery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论