当前位置: 首页>>代码示例>>Java>>正文


Java InlineKeyboardMarkup类代码示例

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


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


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