Interface ICommandHandler
- All Superinterfaces:
ITelegramHandler
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetUsage()voidonCommandMessage(AbstractTelegramBot bot, org.telegram.telegrambots.meta.api.objects.Update update, org.telegram.telegrambots.meta.api.objects.message.Message message, List<String> args) Fired when user types in /command arg0 arg1 arg2..Methods inherited from interface com.github.unafraid.telegrambot.handlers.ITelegramHandler
getRequiredAccessLevel
-
Method Details
-
getCommand
String getCommand()- Returns:
- The command that will trigger @{link onCommandMessage} method
-
getUsage
String getUsage()- Returns:
- The usage of the command whenever user types in /command without parameters some commands may return that if requires arguments to be supplied
-
getDescription
String getDescription()- Returns:
- The description of the command shown in /help
-
getCategory
- Returns:
- The category mapping whenever u type in /help that would group current command to the returned category
-
onCommandMessage
void onCommandMessage(AbstractTelegramBot bot, org.telegram.telegrambots.meta.api.objects.Update update, org.telegram.telegrambots.meta.api.objects.message.Message message, List<String> args) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException Fired when user types in /command arg0 arg1 arg2..- Parameters:
bot- the botupdate- the updatemessage- the messageargs- the arguments after command separated by space or wrapped within "things here are considered one arg"- Throws:
org.telegram.telegrambots.meta.exceptions.TelegramApiException- the exception
-