Documentation
¶
Index ¶
- func CompileCbQryData(command, args string) string
- func DecompileCbQryData(cbQryData string) (command, args string)
- func ParseMessageCommand(msg *telegrambot.Message) (command string, args string)
- func StartChatAction(api telegrambot.API, params *telegrambot.SendChatActionParams) (stop func(), err error)
- type ReplyKeyboardHandler
- func (rkh ReplyKeyboardHandler) HandleMessageKeyboardButton(msg *telegrambot.Message) (handled bool, err error)
- func (rkh ReplyKeyboardHandler) ReplyMarkup() telegrambot.ReplyMarkup
- func (rkh ReplyKeyboardHandler) ReplyMarkupWithOptions(options telegrambot.ReplyKeyboardMarkup) telegrambot.ReplyMarkup
- type ReplyKeyboardHandlerButton
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileCbQryData ¶
Compiles callback data in command-args type. Concatenates command and args with \x00 symbol
func DecompileCbQryData ¶
Decompiles callback data in command-args type. Use to decompile output from CompileCbQryData.
func ParseMessageCommand ¶
func ParseMessageCommand(msg *telegrambot.Message) (command string, args string)
Returns command name from msg. If command not found, return nothing. If command is not placed at the start of a message, returns nothing.
func StartChatAction ¶
func StartChatAction(api telegrambot.API, params *telegrambot.SendChatActionParams) (stop func(), err error)
Starts continually send chat action every 4 seconds until stop function is called
Types ¶
type ReplyKeyboardHandler ¶
type ReplyKeyboardHandler [][]ReplyKeyboardHandlerButton
Stores keyboard with handlers for each buttons. See methods for this type for more information.
func (ReplyKeyboardHandler) HandleMessageKeyboardButton ¶
func (rkh ReplyKeyboardHandler) HandleMessageKeyboardButton(msg *telegrambot.Message) (handled bool, err error)
Runs handler for a button stored in ReplyKeyboardHandler. If no handler found, returns handled == false
func (ReplyKeyboardHandler) ReplyMarkup ¶
func (rkh ReplyKeyboardHandler) ReplyMarkup() telegrambot.ReplyMarkup
Returns reply markup with pre-defined options composed from ReplyKeyboardHandler
func (ReplyKeyboardHandler) ReplyMarkupWithOptions ¶
func (rkh ReplyKeyboardHandler) ReplyMarkupWithOptions(options telegrambot.ReplyKeyboardMarkup) telegrambot.ReplyMarkup
Returns reply markup with passed options composed from ReplyKeyboardHandler. You should not pass keyboard field in options.
type ReplyKeyboardHandlerButton ¶
type ReplyKeyboardHandlerButton struct {
// Button text
Text string
// Used by HandleMessageKeyboardButton.
// Must not be nil.
Handler func() error
}
Button for ReplyKeyboardHandler