Interface ICommandHandler
-
- All Superinterfaces:
ITelegramHandler
public interface ICommandHandler extends ITelegramHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.StringgetCategory()java.lang.StringgetCommand()java.lang.StringgetDescription()java.lang.StringgetUsage()voidonCommandMessage(AbstractTelegramBot bot, org.telegram.telegrambots.meta.api.objects.Update update, org.telegram.telegrambots.meta.api.objects.Message message, java.util.List<java.lang.String> args)Fired when user types in /command arg0 arg1 arg2..-
Methods inherited from interface com.github.unafraid.telegrambot.handlers.ITelegramHandler
getRequiredAccessLevel
-
-
-
-
Method Detail
-
getCommand
java.lang.String getCommand()
- Returns:
- The command that will trigger @{link onCommandMessage} method
-
getUsage
java.lang.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
java.lang.String getDescription()
- Returns:
- The description of the command shown in /help
-
getCategory
default java.lang.String 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, java.util.List<java.lang.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
-
-