telegram

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

func New

func New(token string, allowedUsers []int64, logger *slog.Logger, voiceOpts *VoiceOpts) (*Adapter, error)

func (*Adapter) IsAllowed

func (a *Adapter) IsAllowed(userID int64) bool

IsAllowed checks if a user ID is in the allowed list.

func (*Adapter) Name

func (a *Adapter) Name() string

func (*Adapter) Send

func (a *Adapter) Send(ctx context.Context, msg adapter.OutgoingMessage) error

func (*Adapter) SetCallbackResolver

func (a *Adapter) SetCallbackResolver(r adapter.CallbackResolver)

SetCallbackResolver sets the resolver used to handle inline keyboard button clicks (callback queries). Call this after adapter construction, before Start.

func (*Adapter) Start

func (a *Adapter) Start(ctx context.Context, incoming chan<- adapter.IncomingMessage) error

func (*Adapter) Stop

func (a *Adapter) Stop() error

type VoiceOpts

type VoiceOpts struct {
	STT            voice.STTProvider
	TTS            voice.TTSProvider
	TTSVoice       string
	AutoVoiceReply bool
}

VoiceOpts configures optional voice (STT/TTS) support for the adapter.

Jump to

Keyboard shortcuts

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