chat

package
v1.783.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatProvider

type ChatProvider interface {
	SendMessage(chatId string, text string) error
	ParseWebhookRequest(body []byte) (*IncomingMessage, error)
	SetWebhook(webhookUrl string) error
}

func GetChatProvider

func GetChatProvider(typ string, clientSecret string, lang string) (ChatProvider, error)

type IncomingMessage

type IncomingMessage struct {
	ChatId   string
	UserId   string
	Text     string
	Username string
}

type TelegramChatProvider

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

func NewTelegramChatProvider

func NewTelegramChatProvider(botToken string, httpClient *http.Client) (*TelegramChatProvider, error)

func (*TelegramChatProvider) ParseWebhookRequest

func (p *TelegramChatProvider) ParseWebhookRequest(body []byte) (*IncomingMessage, error)

func (*TelegramChatProvider) SendMessage

func (p *TelegramChatProvider) SendMessage(chatId string, text string) error

func (*TelegramChatProvider) SetWebhook

func (p *TelegramChatProvider) SetWebhook(webhookUrl string) error

Jump to

Keyboard shortcuts

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