Tourmaline::Handlers::CommandHandler
Inherits Tourmaline::EventHandler < Reference < Object
Constants
Constructors
Create a new CommandHandler instance using the provided commands. commands can
be a single command string, or an array of possible commands.
!!! warning
If #admin_only is true, get_chat_adminstrators will be run every time the
handler is invoked. This should be fine in testing, but in production it's
recommended to cache admins and do your own guarding.
Instance methods
Commands (without prefix) that this handler should respond to.
Used when registering the command with BotFather. If register is true, but this
is not set, the command will not be registered.
Used when registering the command with BotFather. If register is true, but this
is not set, the command will not be registered.
If true, this handler will only respond if the command is sent in a group.
If true, this handler will also run (or re-run) when messages are edited.
User API: if true, this command will only be activated by an outgoing message.
If true, this handler will only respond if the command is sent in private.
Register this command with BotFather. Only works is prefixes contains / (as
it does by default), as non-botcommands can't be registed with BotFather.
Register this command with BotFather. Only works is prefixes contains / (as
it does by default), as non-botcommands can't be registed with BotFather.
By default the first command in commands will be selected as the command name
to register. If this property is set, it will be used instead.