public final class AbilityUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
addTag(String username) |
static Consumer<MessageContext> |
commitTo(DBContext db)
Commits to DB.
|
static Long |
getChatId(org.telegram.telegrambots.api.objects.Update update)
Fetches the direct chat ID of the specified update.
|
static org.telegram.telegrambots.api.objects.User |
getUser(org.telegram.telegrambots.api.objects.Update update)
Fetches the user who caused the update.
|
static Predicate<org.telegram.telegrambots.api.objects.Update> |
isReplyTo(String msg) |
static boolean |
isUserMessage(org.telegram.telegrambots.api.objects.Update update) |
static String |
stripTag(String username) |
public static String stripTag(String username)
username - any usernamepublic static Consumer<MessageContext> commitTo(DBContext db)
db - the database to commit onMessageContext, used in post actions for abilitiespublic static org.telegram.telegrambots.api.objects.User getUser(org.telegram.telegrambots.api.objects.Update update)
update - a Telegram UpdateIllegalStateException - if the user could not be foundpublic static Long getChatId(org.telegram.telegrambots.api.objects.Update update)
update - a Telegram UpdateIllegalStateException - if the chat ID could not be foundpublic static boolean isUserMessage(org.telegram.telegrambots.api.objects.Update update)
update - a Telegram Updatepublic static String addTag(String username)
username - the username to add the tag topublic static Predicate<org.telegram.telegrambots.api.objects.Update> isReplyTo(String msg)
msg - the message to be replied toCopyright © 2017. All rights reserved.