tg

package
v0.0.0-...-446c4e2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TelegramBot

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

TelegramBot is a wrapper for TelegramBotAPI.

func New

func New(token string, debug bool, offset, timeout int) (*TelegramBot, error)

New makes a bot for Telegram.

func (*TelegramBot) GetUpdatesChan

func (b *TelegramBot) GetUpdatesChan() <-chan tgbotapi.Update

GetUpdatesChan returns a channel for receiving updates.

func (*TelegramBot) Send

func (b *TelegramBot) Send(chatID int64, request string) (response string, err error)

Send request to Telegram and returns the response.

type TelegramBotAPI

type TelegramBotAPI interface {
	GetUpdatesChan(config tgbotapi.UpdateConfig) tgbotapi.UpdatesChannel
	Send(c tgbotapi.Chattable) (tgbotapi.Message, error)
}

TelegramBotAPI is interface for TelegramBot with the possibility to mock it.

Jump to

Keyboard shortcuts

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