tg

package
v0.0.0-...-929c2b4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditInlineKeyboard

func EditInlineKeyboard(msgId uint64, chatId uint64, newKeyboard [][]InlineKeyboardButton) error

func GetFile

func GetFile(fileId string, targetPath string) error

func LoadToken

func LoadToken()

func SendLocation

func SendLocation(lat float64, lon float64, chatId uint64, replyId uint64) error

func SendMdMessage

func SendMdMessage(text string, chatId uint64, replyId uint64) error

func SendMdMessageWithKeyboard

func SendMdMessageWithKeyboard(text string, chatId uint64, replyId uint64, keyboard [][]InlineKeyboardButton) error

func SendPhotoByUrl

func SendPhotoByUrl(picUrl string, chatId uint64, replyId uint64) error

func SendPhotoGroup

func SendPhotoGroup(photoUrls []string, chatId uint64, replyId uint64) error

func SendPlainMessage

func SendPlainMessage(text string, chatId uint64, replyId uint64) error

func SendVideoByUrl

func SendVideoByUrl(vidUrl string, chatId uint64, caption string, replyId uint64) error

func StartCheckingUpdates

func StartCheckingUpdates() chan (interface{})

func WaitForReady

func WaitForReady()

Types

type CallbackQuery

type CallbackQuery struct {
	Id           string  `json:"id"`
	From         User    `json:"from"`
	Message      Message `json:"message"`
	ChatInstance string  `json:"chat_instance"`
	Data         string  `json:"data"`
}

type Chat

type Chat struct {
	Id   uint64 `json:"id"`
	Type string `json:"type"`
}

type Dummy

type Dummy struct{}

type GetFileResponse

type GetFileResponse struct {
	FileId   string `json:"file_id"`
	FileSize int64  `json:"file_size"`
	FilePath string `json:"file_path"`
}

type InlineKeyboard

type InlineKeyboard [][]InlineKeyboardButton

type InlineKeyboardButton

type InlineKeyboardButton struct {
	Text         string
	Url          string
	CallbackData interface{}
}

type InputMediaPhoto

type InputMediaPhoto struct {
	Type  string `json:"type"`
	Media string `json:"media"`
}

type Location

type Location struct {
	Longitude float64 `json:"longitude"`
	Latitude  float64 `json:"latitude"`
}

type Message

type Message struct {
	Id          uint64    `json:"message_id"`
	From        User      `json:"from"`
	Chat        Chat      `json:"chat"`
	ForwardFrom User      `json:"forward_from"`
	Text        string    `json:"text"`
	Location    *Location `json:"location"`
	PhotoSizes  []Photo   `json:"photo"`
}

func (*Message) GetLargestPhoto

func (msg *Message) GetLargestPhoto() Photo

type Photo

type Photo struct {
	FileId   string `json:"file_id"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
	FileSize int64  `json:"file_size"`
}

type ReplyMarkup

type ReplyMarkup struct {
	InlineKeyboard [][]inlineKeyboardButton `json:"inline_keyboard"`
}

type Response

type Response struct {
	Ok     bool            `json:"ok"`
	Result json.RawMessage `json:"result"`
}

type Update

type Update struct {
	Id            uint64         `json:"update_id"`
	Message       *Message       `json:"message"`
	CallbackQuery *CallbackQuery `json:"callback_query"`
}

func GetUpdates

func GetUpdates(offset uint64, timeoutSec uint) ([]Update, error)

type User

type User struct {
	Id           uint64 `json:"id"`
	IsBot        bool   `json:"is_bot"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	Username     string `json:"username"`
	LanguageCode string `json:"language_code"`
}

Jump to

Keyboard shortcuts

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