telegram

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2018 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendPicture

func SendPicture(chat int64, filename string)

SendPicture to the chat.

func SendTextMessage

func SendTextMessage(chat int64, m string) error

SendTextMessage to the chat with provided ID.

Types

type Chat

type Chat struct {
	ID    int64  `json:"id"`
	Title string `json:"title"`
	Type  string `json:"type"`
}

type Entity

type Entity struct {
	Type   string `json:"type"`
	Offset int64  `json:"offset"`
	Length int64  `json:"length"`
}

type Message

type Message struct {
	ID       int64    `json:"message_id"`
	Date     int      `json:"date"`
	Chat     Chat     `json:"chat"`
	Entities []Entity `json:"entities"`
	Text     string   `json:"text"`
	From     User     `json:"from"`
}

type PhotoSize

type PhotoSize struct {
	ID       int64 `json:"file_id"`
	Width    int   `json:"width"`
	Height   int   `json:"height"`
	FileSize int64 `json:"file_size"`
}

type Update

type Update struct {
	ID      int64   `json:"update_id"`
	Message Message `json:"message"`
}

func GetUpdates

func GetUpdates(lastMsgID int64) ([]Update, error)

GetUpdates with IDs greater than provided value.

type UpdatesResponse

type UpdatesResponse struct {
	Ok      bool     `json:"ok"`
	Updates []Update `json:"result"`
}

type User

type User struct {
	ID        int64  `json:"id"`
	FirstName string `json:"first_name"`
	UserName  string `json:"username"`
}

Jump to

Keyboard shortcuts

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