Add addAll method for keyboardrow

This commit is contained in:
d35h 2018-10-14 21:45:49 +02:00
parent ffc1f713dc
commit 4efaa253b8

View File

@ -4,6 +4,7 @@ import org.telegram.telegrambots.meta.api.interfaces.Validable;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
import java.util.ArrayList;
import java.util.List;
/**
* @author Ruben Bermudez
@ -20,6 +21,10 @@ public class KeyboardRow extends ArrayList<KeyboardButton> implements Validable
super.add(index, new KeyboardButton(text));
}
public void addAll(List<String> buttonNames) {
buttonNames.forEach(KeyboardButton::new);
}
public boolean contains(String text) {
return super.contains(new KeyboardButton(text));
}