tgtype

package
v0.0.0-...-dea42bd Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	FileID   string     `json:"file_id"`
	Thumb    *PhotoSize `json:"thumb,omitempty"`
	FileName string     `json:"file_name,omitempty"`
	MimeType string     `json:"mime_type,omitempty"`
	FileSize int64      `json:"file_size,omitempty"`
}

Animation - You can provide an animation for your game so that it looks stylish in chats (check out Lumberjack for an example). This object represents an animation file to be displayed in the message containing a game.

type Audio

type Audio struct {
	FileID    string `json:"file_id"`
	Duration  int64  `json:"duration"`
	Performer string `json:"performer,omitempty"`
	Title     string `json:"title,omitempty"`
	MimeType  string `json:"mime_type,omitempty"`
	FileSize  int64  `json:"file_size,omitempty"`
}

Audio - This object represents an audio file to be treated as music by the Telegram clients.

type Chat

type Chat struct {
	ID                          int64  `json:"id"`
	TypeString                  string `json:"type"`
	Title                       string `json:"title, omitempty"`
	Username                    string `json:"username, omitempty"`
	FirstName                   string `json:"first_name, omitempty"`
	LastName                    string `json:"last_name, omitempty"`
	AllMembersAreAdministrators bool   `json:"all_members_are_administrators, omitempty"`
}

Chat - This object represents a chat.

type Contact

type Contact struct {
	PhoneNumber string `json:"phone_number"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name,omitempty"`
	UserID      int64  `json:"user_id,omitempty"`
}

Contact - This object represents a phone contact.

type Document

type Document struct {
	FileID   string     `json:"file_id"`
	Thumb    *PhotoSize `json:"thumb,omitempty"`
	FileName string     `json:"file_name,omitempty"`
	MimeType string     `json:"mime_type,omitempty"`
	FileSize int64      `json:"file_size,omitempty"`
}

Document - This object represents a general file (as opposed to photos, voice messages and audio files).

type File

type File struct {
	FileID   string `json:"file_id"`
	FileSize int64  `json:"file_size,omitempty"`
	FilePath string `json:"file_path,omitempty"`
}

File - This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

type Game

type Game struct {
	Title        string          `json:"title"`
	Description  string          `json:"description"`
	Photo        []PhotoSize     `json:"photo"`
	Text         string          `json:"text,omitempty"`
	TextEntities []MessageEntity `json:"text_entities,omitempty"`
	Animation    *Animation      `json:"animation,omitempty"`
}

Game - This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

type GameHighScore

type GameHighScore struct {
	Position int64 `json:"position"`
	User     *User `json:"user"`
	Score    int64 `json:"score"`
}

GameHighScore - This object represents one row of the high scores table for a game.

type Location

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

Location - This object represents a point on the map.

type Message

type Message struct {
	MessageID             int64           `json:"message_id"`
	From                  *User           `json:"from,omitempty"`
	Date                  int64           `json:"date"`
	Chat                  *Chat           `json:"chat"`
	ForwardFrom           *User           `json:"forward_from,omitempty"`
	ForwardFromChat       *Chat           `json:"forward_from_chat,omitempty"`
	ForwardFromMessageID  int64           `json:"forward_from_message_id,omitempty"`
	ForwardDate           int64           `json:"forward_date,omitempty"`
	ReplyToMessage        *Message        `json:"reply_to_message,omitempty"`
	EditDate              int64           `json:"edit_date,omitempty"`
	Text                  string          `json:"text,omitempty"`
	Entities              []MessageEntity `json:"entities,omitempty"`
	Audio                 *Audio          `json:"audio,omitempty"`
	Document              *Document       `json:"document,omitempty"`
	Game                  *Game           `json:"game,omitempty"`
	Photo                 []PhotoSize     `json:"photo,omitempty"`
	Sticker               *Sticker        `json:"sticker,omitempty"`
	Video                 *Video          `json:"video,omitempty"`
	Voice                 *Voice          `json:"voice,omitempty"`
	Caption               string          `json:"caption,omitempty"`
	Contact               *Contact        `json:"contact,omitempty"`
	Location              *Location       `json:"location,omitempty"`
	Venue                 *Venue          `json:"venue,omitempty"`
	NewChatMember         *User           `json:"new_chat_member,omitempty"`
	LeftChatMember        *User           `json:"left_chat_member,omitempty"`
	NewChatTitle          string          `json:"new_chat_title,omitempty"`
	NewChatPhoto          []PhotoSize     `json:"new_chat_photo,omitempty"`
	DeleteChatPhoto       bool            `json:"delete_chat_photo,omitempty"`
	GroupChatCreated      bool            `json:"group_chat_created,omitempty"`
	SupergroupChatCreated bool            `json:"supergroup_chat_created,omitempty"`
	ChannelChatCreated    bool            `json:"channel_chat_created,omitempty"`
	MigrateToChatID       int64           `json:"migrate_to_chat_id,omitempty"`
	MigrateFromChatID     int64           `json:"migrate_from_chat_id,omitempty"`
	PinnedMessage         *Message        `json:"pinned_message,omitempty"`
}

Message - This object represents a message.

type MessageEntity

type MessageEntity struct {
	TypeString string `json:"type"`
	Offset     int64  `json:"offset"`
	Length     int64  `json:"length"`
	URL        string `json:"url,omitempty"`
	User       *User  `json:"user,omitempty"`
}

MessageEntity - This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

type PhotoSize

type PhotoSize struct {
	FileID   string `json:"file_id"`
	Width    int64  `json:"width"`
	Height   int64  `json:"height"`
	FileSize int64  `json:"file_size,omitempty"`
}

PhotoSize - This object represents one size of a photo or a file / sticker thumbnail.

type Sticker

type Sticker struct {
	FileID   string     `json:"file_id"`
	Width    int64      `json:"width"`
	Height   int64      `json:"height"`
	Thumb    *PhotoSize `json:"thumb,omitempty"`
	Emoji    string     `json:"emoji,omitempty"`
	FileSize int64      `json:"file_size,omitempty"`
}

Sticker - This object represents a sticker.

type TGType

type TGType interface {
}

TGType - a telegram bot api type

type Update

type Update struct {
	UpdateID          int64    `json:"update_id"`
	Message           *Message `json:"message,omitempty"`
	EditedMessage     *Message `json:"edited_message,omitempty"`
	ChannelPost       *Message `json:"channel_post,omitempty"`
	EditedChannelPost *Message `json:"edited_channel_post,omitempty"`
}

Update - This object represents incomming update.

type Updates

type Updates struct {
	Updates []Update
}

Updates -- encapsulates multiple updates

type User

type User struct {
	ID        int64  `json:"id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name,omitempty"`
	Username  string `json:"username,omitempty"`
}

User - This object represents a Telegram user or bot.

type UserProfilePhotos

type UserProfilePhotos struct {
	TotalCount int64      `json:"total_count"`
	Photos     *PhotoSize `json:"photos"`
}

UserProfilePhotos - This object represent a user's profile pictures.

type Venue

type Venue struct {
	Location     *Location `json:"location"`
	Title        string    `json:"title"`
	Address      string    `json:"address"`
	FoursquareID string    `json:"foursquare_id,omitempty"`
}

Venue - This object represents a venue.

type Video

type Video struct {
	FileID   string     `json:"file_id"`
	Width    int64      `json:"width"`
	Height   int64      `json:"height"`
	Duration int64      `json:"duration"`
	Thumb    *PhotoSize `json:"thumb,omitempty"`
	MimeType string     `json:"mime_type,omitempty"`
	FileSize int64      `json:"file_size,omitempty"`
}

Video - This object represents a video file.

type Voice

type Voice struct {
	FileID   string `json:"file_id"`
	Duration int64  `json:"duration"`
	MimeType string `json:"mime_type,omitempty"`
	FileSize int64  `json:"file_size,omitempty"`
}

Voice - This object represents a voice note.

Jump to

Keyboard shortcuts

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