tgbotsender

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViewRoom       = "room.html"
	ViewFeedItems  = "feeditems.html"
	ViewSources    = "sources.html"
	ViewSubscribed = "subscribed.html"
	ViewAppStart   = "appstart.html"
	ViewAppStop    = "appstop.html"
	ViewSuccess    = "success.html"
	ViewError      = "error.html"
	ViewNotFound   = "notfound.html"
	ViewForbidden  = "forbidden.html"
)
View Source
const PluginName = "tgbotsender"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Owner int64 `mapstructure:"owner"`
}

type Plugin

type Plugin struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Plugin) Init

func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger, botApi *tgbotapi.BotAPI) error

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns user-friendly plugin name

func (*Plugin) Owner

func (p *Plugin) Owner() int64

func (*Plugin) SendText

func (p *Plugin) SendText(chatId int64, text string)

func (*Plugin) SendView

func (p *Plugin) SendView(chatId int64, view View, data any)

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

type TelegramSender

type TelegramSender interface {
	Owner() int64
	SendView(chatId int64, view View, data any)
	SendText(chatId int64, text string)
}

type View

type View string

Jump to

Keyboard shortcuts

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