telegram

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 11 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) EditText added in v0.16.10

func (a *Adapter) EditText(_ context.Context, externalID, messageID, text, parseMode string) error

EditText edits an existing Telegram message. Implements adapter.MessageEditor.

func (*Adapter) IsAllowed

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

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

func (*Adapter) IsDebug added in v0.16.10

func (a *Adapter) IsDebug(chatID int64) bool

IsDebug reports whether the given chat has debug mode enabled.

func (*Adapter) IsDebugByExternalID added in v0.16.10

func (a *Adapter) IsDebugByExternalID(externalID string) bool

IsDebugByExternalID is a convenience wrapper that parses an ExternalID string.

func (*Adapter) Name

func (a *Adapter) Name() string

func (*Adapter) Send

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

func (*Adapter) SendAndGetID added in v0.16.10

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

SendAndGetID sends a message and returns the Telegram message ID as a string. Implements adapter.MessageEditor.

func (*Adapter) SendTyping added in v0.15.0

func (a *Adapter) SendTyping(_ context.Context, externalID string) 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