Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Butlertron ¶
type Butlertron struct { Bot *telebot.Bot Config Config Location *telebot.Location // contains filtered or unexported fields }
func NewButlertron ¶
func NewButlertron() (*Butlertron, error)
func (*Butlertron) CancelOnText ¶
func (b *Butlertron) CancelOnText()
CancelOnText cancels the current command assigned to OnText If there is no OnText handler, it has been cancelled, or it has timed out, it is a noop
func (*Butlertron) RegisterInlineKeyboard ¶
func (b *Butlertron) RegisterInlineKeyboard(commands [][]InlineCommand) *telebot.ReplyMarkup
func (*Butlertron) SetOnText ¶
func (b *Butlertron) SetOnText(h telebot.HandlerFunc, timeout time.Duration, cancelAfterHandling bool)
SetOnText will set the command that will run when text is next sent If the deadline is exceed or it has been cancelled, there will be no reply
func (*Butlertron) SetOnTextDefault ¶
func (b *Butlertron) SetOnTextDefault(h telebot.HandlerFunc)
SetOnTextDefault sets the default responder if no OnText has been manually trigger
type Command ¶
type Command interface { Name() string // Description returns a brief description of the command. Description() string // Command is the string which will call the command Command() string // Execute is called when the command is triggered. Execute(c telebot.Context) error }
Command is the interface that all bot commands must implement.
type InlineCommand ¶
type InlineCommand struct { // Name of the Inline Command Name string // Description of the Inline Command, this will be displayed on the button Description string // The Selector that stores this command Selector *telebot.ReplyMarkup // The Handler which is executed Handler telebot.HandlerFunc // The Parent Command. The inline command buttons will be displayed below this Parent Command // Conditional refers to if it should be loaded by default as a button. If true, it will not be added on init Conditional bool }
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
func NewLocation ¶
func NewLocation(b *Butlertron) *Location
func (Location) Description ¶
func (*Location) LocationMiddleware ¶
func (l *Location) LocationMiddleware(next telebot.HandlerFunc) telebot.HandlerFunc
Click to show internal directories.
Click to hide internal directories.