Documentation
¶
Index ¶
- func Escape(s string) string
- func NotifyAvailable(user *db.User, reward *patreon.RewardResult, campaign *patreon.Campaign)
- func NotifyMissing(user *db.User, missing []*patreon.RewardResult)
- func StartBot(ctx context.Context) *bot.Bot
- type CommandHandler
- type ConversationBot
- type ConversationEnd
- type ConversationHandler
- type ConversationStage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Escape ¶
Escape Escapes the string (using HTML entities) to make it compatible with Telegram's HTML format.
The API only supports the following entities: `<`, `>` and `&`, therefore only the characters corresponding to those will be escaped
func NotifyAvailable ¶
func NotifyMissing ¶
func NotifyMissing(user *db.User, missing []*patreon.RewardResult)
Types ¶
type CommandHandler ¶
type CommandHandler struct { Pattern string Description string ChatAction models.ChatAction HandlerType bot.HandlerType MatchType bot.MatchType HandlerFunc bot.HandlerFunc }
func (*CommandHandler) ChatActionHandler ¶
func (ch *CommandHandler) ChatActionHandler() bot.HandlerFunc
type ConversationBot ¶
type ConversationEnd ¶
type ConversationEnd struct { Command string Function bot.HandlerFunc }
type ConversationHandler ¶
type ConversationHandler struct {
// contains filtered or unexported fields
}
func NewConversationHandler ¶
func NewConversationHandler(stages ConversationStage, end *ConversationEnd) *ConversationHandler
func (*ConversationHandler) CreateHandlerMiddleware ¶
func (c *ConversationHandler) CreateHandlerMiddleware() bot.Middleware
func (*ConversationHandler) EndConversation ¶
func (c *ConversationHandler) EndConversation(chatId int64)
func (*ConversationHandler) SetActiveConversationStage ¶
func (c *ConversationHandler) SetActiveConversationStage(chatId int64, stageId int)
type ConversationStage ¶
type ConversationStage map[int]bot.HandlerFunc
Click to show internal directories.
Click to hide internal directories.