Documentation ¶
Index ¶
- Variables
- func AuthClient(ctx context.Context, config *config.TGConfig, sessionStr string, ...) (*telegram.Client, error)
- func BotClient(ctx context.Context, KV kv.KV, config *config.TGConfig, token string, ...) (*telegram.Client, error)
- func CalculateChunkSize(start, end int64) int64
- func DeleteMessages(ctx context.Context, client *telegram.Client, channelId int64, ids []int) error
- func GetBotInfo(ctx context.Context, KV kv.KV, config *config.TGConfig, token string) (*types.BotInfo, error)
- func GetChannelById(ctx context.Context, client *tg.Client, channelId int64) (*tg.InputChannel, error)
- func GetChunk(ctx context.Context, client *tg.Client, location tg.InputFileLocationClass, ...) ([]byte, error)
- func GetLocation(ctx context.Context, client *tg.Client, channelId int64, partId int64) (location *tg.InputDocumentFileLocation, err error)
- func GetMediaContent(ctx context.Context, client *tg.Client, location tg.InputFileLocationClass) (*bytes.Buffer, error)
- func GetMessages(ctx context.Context, client *tg.Client, ids []int, channelId int64) ([]tg.MessageClass, error)
- func Middlewares(config *config.TGConfig, retries int) []telegram.Middleware
- func New(ctx context.Context, config *config.TGConfig, handler telegram.UpdateHandler, ...) (*telegram.Client, error)
- func NoAuthClient(ctx context.Context, config *config.TGConfig, handler telegram.UpdateHandler, ...) (*telegram.Client, error)
- func RunWithAuth(ctx context.Context, client *telegram.Client, token string, ...) error
- type BotWorker
- type Client
- type ClientStatus
- type Option
- type StopFunc
- type StreamWorker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInValidChannelID = errors.New("invalid channel id") ErrInvalidChannelMessages = errors.New("invalid channel messages") )
Functions ¶
func AuthClient ¶
func CalculateChunkSize ¶
func DeleteMessages ¶
func GetBotInfo ¶
func GetChannelById ¶
func GetLocation ¶
func GetMediaContent ¶
func GetMessages ¶
func Middlewares ¶
func Middlewares(config *config.TGConfig, retries int) []telegram.Middleware
func NoAuthClient ¶
Types ¶
type BotWorker ¶
type BotWorker struct {
// contains filtered or unexported fields
}
func NewBotWorker ¶
func NewBotWorker() *BotWorker
type Client ¶
type Client struct { Tg *telegram.Client Stop StopFunc Status ClientStatus UserID string }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithBotToken ¶
func WithContext ¶
type StreamWorker ¶
type StreamWorker struct {
// contains filtered or unexported fields
}
func NewStreamWorker ¶
func NewStreamWorker(cnf *config.Config, kv kv.KV, logger *zap.SugaredLogger) *StreamWorker
func (*StreamWorker) DecActiveStreams ¶
func (w *StreamWorker) DecActiveStreams() error
func (*StreamWorker) IncActiveStream ¶
func (w *StreamWorker) IncActiveStream() error
func (*StreamWorker) Set ¶
func (w *StreamWorker) Set(bots []string, channelID int64)
Click to show internal directories.
Click to hide internal directories.