• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java InlineKeyboardMarkup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup的典型用法代码示例。如果您正苦于以下问题:Java InlineKeyboardMarkup类的具体用法?Java InlineKeyboardMarkup怎么用?Java InlineKeyboardMarkup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InlineKeyboardMarkup类属于org.telegram.telegrambots.api.objects.replykeyboard包,在下文中一共展示了InlineKeyboardMarkup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ligar

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineKeyboardMarkup ligar() {
	InlineKeyboardMarkup markupInline = new InlineKeyboardMarkup();
	List<List<InlineKeyboardButton>> rowsInline = new ArrayList<List<InlineKeyboardButton>>();
	List<InlineKeyboardButton> row1 = new ArrayList<InlineKeyboardButton>();
	for (int i = 0; i < 9; i++) {
		if (!State.d[i]) {
			row1.add(new InlineKeyboardButton().setText("liga led " + (i + 1)).setCallbackData(i + "on"));
		} else {
			row1.add(new InlineKeyboardButton().setText("desliga led " + (i + 1)).setCallbackData(i + "off"));
		}
		if (i % 2 == 0 || i == 0) {
			rowsInline.add(row1);
			row1 = new ArrayList<InlineKeyboardButton>();
		}
	}
	rowsInline.add(acionaTodos());
	rowsInline.add(desacionaTodos());
	markupInline.setKeyboard(rowsInline);
	return markupInline;
}
 
开发者ID:alexNeto,项目名称:smart-home-bot,代码行数:21,代码来源:Start.java


示例2: createFilterKeyboard

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
/**
 * Creates the keyboard for filtering of the dishes message
 * @param mensaId id of the mensa of the dishes
 * @param date of the dishes
 * @param selectedValue currently selected filter
 * @return the inline keyboard of the filters
 */
public InlineKeyboardMarkup createFilterKeyboard(String mensaId, LocalDate date, String selectedValue) {
    List<List<InlineKeyboardButton>> rows = new ArrayList<>();
    List<InlineKeyboardButton> currentRow = new ArrayList<>();
    for (FilterConfig filter : config.getFilters()) {
        InlineKeyboardButton button = new InlineKeyboardButton();
        if (StringUtils.equals(selectedValue, filter.getValue())) {
            button.setText(messagesService.getMessage(Messages.FILTER_ALL));
            button.setCallbackData(FilterInfo.of(BotConstants.FILTER_ALL_VALUE, mensaId, date).toString());
        } else {
            button.setText(messagesService.getMessage(filter.getMessageKey()));
            button.setCallbackData(FilterInfo.of(filter.getValue(), mensaId, date).toString());
        }
        currentRow.add(button);
        if (currentRow.size() % 2 == 0) {
            rows.add(currentRow);
            currentRow = new ArrayList<>();
        }
    }
    if (!currentRow.isEmpty()) {
        rows.add(currentRow);
    }
    InlineKeyboardMarkup inlineKeyboardMarkup = new InlineKeyboardMarkup();
    inlineKeyboardMarkup.setKeyboard(rows);
    return inlineKeyboardMarkup;
}
 
开发者ID:xabgesagtx,项目名称:mensa-api,代码行数:33,代码来源:KeyboardUtils.java


示例3: getInlineKeyboardMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
private static InlineKeyboardMarkup getInlineKeyboardMarkup() {
    InlineKeyboardButton button = new InlineKeyboardButton()
            .setText("Button1")
            .setCallbackData("Callback");
    List<InlineKeyboardButton> row = new ArrayList<>();
    row.add(button);
    List<List<InlineKeyboardButton>> keyboard = new ArrayList<>();
    keyboard.add(row);
    return new InlineKeyboardMarkup()
            .setKeyboard(keyboard);
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:12,代码来源:BotApiMethodHelperFactory.java


示例4: createSelectMensaMessage

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
private SendMessage createSelectMensaMessage() {
    SendMessage result = new SendMessage();
    result.setText(messagesService.getMessage(Messages.RESPONSE_SELECT_MENSA));
    InlineKeyboardMarkup markup = new InlineKeyboardMarkup();
    markup.setKeyboard(mensaRepo.findAllByOrderByName().stream()
            .map(mensa -> {
                InlineKeyboardButton button = new InlineKeyboardButton();
                button.setText(mensa.getName());
                button.setCallbackData(mensa.getId());
                return Arrays.asList(button);
            }).collect(Collectors.toList()));
    result.setReplyMarkup(markup);
    return result;
}
 
开发者ID:xabgesagtx,项目名称:mensa-api,代码行数:15,代码来源:MensaBot.java


示例5: getReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineKeyboardMarkup getReplyMarkup() {
    return replyMarkup;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:4,代码来源:InlineQueryResultVenue.java


示例6: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultVenue setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultVenue.java


示例7: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultAudio setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultAudio.java


示例8: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultContact setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultContact.java


示例9: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultMpeg4Gif setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultMpeg4Gif.java


示例10: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedPhoto setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedPhoto.java


示例11: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedDocument setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedDocument.java


示例12: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedGif setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedGif.java


示例13: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedVideo setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedVideo.java


示例14: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedAudio setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedAudio.java


示例15: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedSticker setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedSticker.java


示例16: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedMpeg4Gif setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedMpeg4Gif.java


示例17: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultCachedVoice setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultCachedVoice.java


示例18: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultPhoto setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultPhoto.java


示例19: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultGame setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultGame.java


示例20: setReplyMarkup

import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; //导入依赖的package包/类
public InlineQueryResultArticle setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
    this.replyMarkup = replyMarkup;
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:5,代码来源:InlineQueryResultArticle.java



注:本文中的org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConfigurationException类代码示例发布时间:2022-05-22
下一篇:
Java IEventCategory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap