handler

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GuestImgMaxSize = 737280
)
View Source
const MAXONEPAGEOBJ = MAXROW * 7
View Source
const MAXROW = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	api.DrawConfig `yaml:",inline"`
	PrePhotoID     string `json:"pre_photo_id,omitempty" yaml:"pre_photo_id,omitempty"`
	ControlPhotoID string `json:"control_photo_id,omitempty" yaml:"control_photo_id,omitempty"`
}

func (*Config) CorrectCfg

func (cfg *Config) CorrectCfg(u *user.UserInfo, gTag, gUc, transTag, transUc, gSeed bool)

func (*Config) Fomate2TgHTML

func (c *Config) Fomate2TgHTML() []byte

func (*Config) Fomate2TgMdV2

func (c *Config) Fomate2TgMdV2() []byte

type ConfigFunc added in v0.2.0

type ConfigFunc func(h *Handler)

func WithCache added in v0.2.0

func WithCache(cache cache.Cache) ConfigFunc

func WithOwnerID added in v0.2.0

func WithOwnerID(id int64) ConfigFunc

func WithWebhook added in v0.2.0

func WithWebhook(webhookHost string) ConfigFunc

https only

type Handler added in v0.2.0

type Handler struct {
	// contains filtered or unexported fields
}

func New added in v0.2.0

func New(tgToken string, configs ...ConfigFunc) (*Handler, error)

func (*Handler) Bot added in v0.2.0

func (h *Handler) Bot() *tgbotapi.BotAPI

func (*Handler) Cache added in v0.2.0

func (h *Handler) Cache() cache.Cache

func (*Handler) HandleCallback added in v0.2.0

func (h *Handler) HandleCallback(CallbackQuery *tgbotapi.CallbackQuery)

func (*Handler) HandleCmd added in v0.2.0

func (h *Handler) HandleCmd(Message tgbotapi.Message)

func (*Handler) HandleMsg added in v0.2.0

func (h *Handler) HandleMsg(Message *tgbotapi.Message)

func (*Handler) Run added in v0.2.0

func (h *Handler) Run(ctx context.Context)

func (*Handler) SetCommand added in v0.2.0

func (h *Handler) SetCommand()

func (*Handler) WebhookEnabled added in v0.2.0

func (h *Handler) WebhookEnabled() bool

func (*Handler) WebhookHandler added in v0.2.0

func (h *Handler) WebhookHandler() func(w http.ResponseWriter, r *http.Request)

only Enable Webhook

func (*Handler) WebhookUriPath added in v0.2.0

func (h *Handler) WebhookUriPath() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL