com.annimon.tgbotsmodule.api.methods.interfaces.ReplyMarkupSupportedMessageMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tgbots-module Show documentation
Show all versions of tgbots-module Show documentation
Simple Java telegram bots runner built on top of the Telegram Bots library
The newest version!
package com.annimon.tgbotsmodule.api.methods.interfaces;
import java.io.Serializable;
import java.util.List;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.ReplyKeyboard;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons.InlineKeyboardButton;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons.InlineKeyboardRow;
public interface ReplyMarkupSupportedMessageMethod
extends SendableMessageMethod {
ReplyKeyboard getReplyMarkup();
M setReplyMarkup(ReplyKeyboard replyMarkup);
default M setInlineKeyboard(List keyboard) {
return setReplyMarkup(new InlineKeyboardMarkup(keyboard));
}
default M setInlineKeyboard(InlineKeyboardButton button) {
return setSingleRowInlineKeyboard(button);
}
default M setSingleRowInlineKeyboard(List row) {
return setInlineKeyboard(List.of(new InlineKeyboardRow(row)));
}
default M setSingleRowInlineKeyboard(InlineKeyboardButton... buttons) {
return setSingleRowInlineKeyboard(List.of(buttons));
}
default M setSingleColumnInlineKeyboard(List column) {
return setInlineKeyboard(column.stream().map(InlineKeyboardRow::new).toList());
}
default M setSingleColumnInlineKeyboard(InlineKeyboardButton... buttons) {
return setSingleColumnInlineKeyboard(List.of(buttons));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy