types

package
v0.0.0-...-82299e7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2016 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

This package define all inline type used in Telegram Bot API.

More information : https://core.telegram.org/bots/api#inline-mode

This package define all type used in Telegram Bot API.

More information : https://core.telegram.org/bots/api#available-types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audio

type Audio struct {
	// Unique identifier for this file
	FileId string `json:"file_id"`
	// Duration of the audio in seconds as defined by sender
	Duration float64 `json:"duration"`
	// Optional. Performer of the audio as defined by sender or by audio tags
	Performer string `json:"performer"`
	// Optional. Title of the audio as defined by sender or by audio tags
	Title string `json:"title"`
	// Optional. MIME type of the file as defined by sender
	MimeType string `json:"mime_type"`
	// Optional. File size
	FileSize float64 `json:"file_size"`
}

This object represents an audio file to be treated as music by the Telegram clients. Optional means this variable could be nil or empty.

type Chat

type Chat struct {
	Id        float64 `json:"id"`
	Type      string  `json:"type"`
	FirstName string  `json:"first_name"`
	LastName  string  `json:"last_name"`
	Username  string  `json:"username"`
	Title     string  `json:"title"`
}

Chat object. Representatives GroupChat and User Chat. Optional means this variable could be nil or empty.

type ChosenInlineResult

type ChosenInlineResult struct {
	ResultId string `json:"result_id"`
	From     *User  `json:"from"`
	Query    string `json:"query"`
}

type Contact

type Contact struct {
	PhoneNumber string `json:"phone_number"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Username    string `json:"username"`
}

This object represents a phone contact.

type Document

type Document struct {
	// Unique file identifier
	FileId string `json:"file_id"`
	// Optional. Document thumbnail as defined by sender
	Thumb PhotoSize `json:"thumb"`
	// Optional. Original filename as defined by sender
	FileName string `json:"file_name"`
	// Optional. MIME type of the file as defined by sender
	MimeType string `json:"mime_type"`
	// Optional. File size
	FileSize float64 `josn:"file_size"`
}

This object represents a general file (as opposed to photos, voice messages and audio files). Optional means this variable could be nil or empty.

type File

type File struct {
	FileId   string  `json:"file_id"`
	FileSize float64 `json:"file_size"`
	FilePath string  `json:"file_path"`
}

type ForceReply

type ForceReply struct {
	ForceReply bool `json:"force_reply"`
	Selective  bool `json:"selective"`
}

func (*ForceReply) ToJson

func (rkm *ForceReply) ToJson() (string, error)

type GroupChat

type GroupChat struct {
	//	Unique identifier for this group chat
	Id float64 `json:"id"`
	// Group name
	Title string `json:"title"`
}

GroupChat object. Optional means this variable could be nil or empty.

type InlineQuery

type InlineQuery struct {
	Id    string `json:"id"`
	From  *User  `json:"from"`
	Query string `json:"query"`
	// contains filtered or unexported fields
}

type InlineQueryResult

type InlineQueryResult struct {
	Type                  string `json:"type"`
	Id                    string `json:"id"`
	ParseMode             string `json:"parse_mode,omitempty"`
	DisableWebPagePreview bool   `json:"description,omitempty"`
}

type InlineQueryResultArticle

type InlineQueryResultArticle struct {
	InlineQueryResult
	Title       string  `json:"title"`
	MessageText string  `json:"message_text"`
	Url         string  `json:"url,omitempty"`
	HideUrl     bool    `json:"hide_url,omitempty"`
	Description string  `json:"description,omitempty"`
	ThumbUrl    string  `json:"thumb_url,omitempty"`
	ThumbWidth  float64 `json:"thumb_width,omitempty"`
	ThumbHeight float64 `json:"thumb_height,omitempty"`
}

func NewInlineQueryResultArticl

func NewInlineQueryResultArticl() *InlineQueryResultArticle

type InlineQueryResultGif

type InlineQueryResultGif struct {
	InlineQueryResult
	GifUrl      string  `json:"gif_url"`
	GifWidth    float64 `json:"gif_width,omitempty"`
	GifHeight   float64 `json:"gif_height,omitempty"`
	ThumbUrl    string  `json:"thumb_url"`
	Title       string  `json:"title,omitempty"`
	Caption     string  `json:"caption,omitempty"`
	MessageText string  `json:"message_text,omitempty"`
}

func NewInlineQueryResultGif

func NewInlineQueryResultGif() *InlineQueryResultGif

type InlineQueryResultMpeg4Gif

type InlineQueryResultMpeg4Gif struct {
	InlineQueryResult
	Mpeg4Url    string  `json:"mpeg4_url"`
	Mpeg4Width  float64 `json:"mpeg4_width,omitempty"`
	Mpeg4Height float64 `json:"mpeg4_height,omitempty"`
	ThumbUrl    string  `json:"thumb_url"`
	Title       string  `json:"title,omitempty"`
	Caption     string  `json:"caption,omitempty"`
	MessageText string  `json:"message_text,omitempty"`
}

func NewInlineQueryResultMpeg4Gif

func NewInlineQueryResultMpeg4Gif() *InlineQueryResultMpeg4Gif

type InlineQueryResultPhoto

type InlineQueryResultPhoto struct {
	InlineQueryResult
	PhotoUrl    string  `json:"photo_url"`
	PhotoWidth  float64 `json:"photo_width,omitempty"`
	PhotoHeight float64 `json:"photo_height,omitempty"`
	ThumbUrl    string  `json:"thumb_url"`
	Title       string  `json:"title,omitempty"`
	Description string  `json:"description,omitempty"`
	Caption     string  `json:"caption,omitempty"`
	MessageText string  `json:"message_text,omitempty"`
}

func NewInlineQueryResultPhoto

func NewInlineQueryResultPhoto() *InlineQueryResultPhoto

type InlineQueryResultVideo

type InlineQueryResultVideo struct {
	InlineQueryResult
	VideoUrl      string  `json:"video_url"`
	MimeType      string  `json:"mime_type"`
	MessageText   string  `json:"message_text"`
	VideoWidth    float64 `json:"video_width,omitempty"`
	VideoHeight   float64 `json:"video_height,omitempty"`
	VideoDuration float64 `json:"video_duration,omitempty"`
	Title         string  `json:"title"`
	ThumbUrl      string  `json:"thumb_url"`
	Description   string  `json:"description,omitempty"`
}

func NewInlineQueryResultVideo

func NewInlineQueryResultVideo() *InlineQueryResultVideo

type Location

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

This object represents a point on the map.

type Message

type Message struct {
	// Unique message identifier
	Message_Id float64 `josn:"message_id"`
	// Sender
	From *User `json:"from"`
	// Date the message was sent.
	Date float64 `json:"date"`
	// Conversation the message belongs to.
	Chat *Chat `json:"chat"`
	// Optional. For forwarded messages, sender of the original message
	ForwardFrom *User `json:"forward_from,omitempty"`
	// Optional. For forwarded messages, date the original message was sent.
	ForwardDate float64 `json:"forward_date,omitempty"`
	// Optional. For text messages
	Text string `json:"text,omitempty"`
	// Optional. Message is an audio file
	Audio *Audio `json:"audio,omitempty"`
	// Optional. Message is a general file
	Document *Document `json:"document,omitempty"`
	// Optional. Message is a photo
	Photo *[]*PhotoSize `json:"photo,omitempty"`
	// Optional. Message is a sticker
	Sticker *Sticker `json:"sticker,omitempty"`
	// Optional. Message is a video
	Video *Video `json:"video,omitempty"`
	// Optional. Message is a voice message
	Voice *Voice `json:"voice,omitempty"`
	// Optional. Caption for the photo or video
	Caption string `json:"caption,omitempty"`
	// Optional. Message is a shared contact
	Contact *Contact `json:"contact,omitempty"`
	// Optional. Message is a shared location
	Location *Location `json:"location,omitempty"`
	// Optional. A new member was added to the group
	NewChatParticipant *User `json:"new_chat_participant,omitempty"`
	// Optional. A member was removed from the group
	LeftChatParticipant *User `json:"left_chat_participant,omitempty"`
	//	Optional. A group title was changed to this value
	NewChatTitle string `json:"new_chat_title,omitempty"`
	//	Optional. A group photo was change to this value
	NewChatPhoto *[]*PhotoSize `json:"new_chat_photo,omitempty"`
	// Optional. Informs that the group photo was deleted
	DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"`
	// Optional. Informs that the group has been created
	GroupChatCreated bool `json:"group_chat_created,omitempty"`
}

Message object. Optional means this variable could be nil or empty.

type PhotoSize

type PhotoSize struct {
	// Unique identifier for this file
	FileId string `json:"file_id"`
	// Photo width
	Width float64 `json:"width"`
	// Photo height
	Height float64 `json:"height"`
	// Optional. File size
	FileSize float64 `json:"file_size"`
}

This object represents one size of a photo or a file / sticker thumbnail. Optional means this variable could be nil or empty.

type ReplyKeyboardHide

type ReplyKeyboardHide struct {
	HideKeyboard bool `json:"hide_keyboard"`
	Selective    bool `json:"selective"`
}

func (*ReplyKeyboardHide) ToJson

func (rkm *ReplyKeyboardHide) ToJson() (string, error)

type ReplyKeyboardMarkup

type ReplyKeyboardMarkup struct {
	Keyboard        [][]string `json:"keyboard"`
	ResizeKeyboard  bool       `json:"resize_keyboard,omitempty"`
	OneTimeKeyboard bool       `json:"one_time_keyboard,omitempty"`
	Selective       bool       `json:"selective,omitempty"`
}

func (*ReplyKeyboardMarkup) ToJson

func (rkm *ReplyKeyboardMarkup) ToJson() (string, error)

type ReplyMarkup

type ReplyMarkup interface {
	ToJson() (string, error)
}

type Sticker

type Sticker struct {
	// Unique identifier for this file
	FileId string `json:"file_id"`

	// Optional. Sticker thumbnail in .webp or .jpg format
	Thumb PhotoSize `json:"thumb"`
	// Optional. File size
	FileSize float64 `josn:"file_size"`
	// contains filtered or unexported fields
}

This object represents a sticker. Optional means this variable could be nil or empty.

type Update

type Update struct {
	// The update‘s unique identifier.
	UpdateId float64 `json:"update_id"`
	// Optional. New incoming message of any kind
	Message *Message `json:"message,omitempty"`
	// Optional. New incoming inline query
	InlineQuery *InlineQuery `json:"inline_query,omitempty"`
	// Optional. The result of a inline query that was chosen by a user and sent to their chat partner
	ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"`
}

Update object. Optional means this variable could be nil or empty.

type User

type User struct {
	// Unique identifier for this user or bot
	Id float64 `json:"id"`
	// User‘s or bot’s first name
	FirstName string `json:"first_name"`
	// Optional. User‘s or bot’s last name
	LastName string `json:"last_name"`
	// Optional. User‘s or bot’s username
	Username string `json:"username"`
}

User object. Optional means this variable could be nil or empty.

type UserProfilePhotos

type UserProfilePhotos struct {
	TotalCount float64          `json:"total_count"`
	Photos     *[]*[]*PhotoSize `json:"photos"`
}

type Video

type Video struct {
	FileId string `json:"file_id"`

	Thumb    PhotoSize `json:"thumb"`
	Duration float64   `json:"duration"`
	MimeType string    `json:"mime_type"`
	FileSize float64   `josn:"file_size"`
	// contains filtered or unexported fields
}

This object represents a video file.

type Voice

type Voice struct {
	FileId   string  `json:"file_id"`
	Duration float64 `json:"duration"`
	MimeType string  `json:"mime_type"`
	FileSize float64 `json:"file_size"`
}

This object represents a voice note.

Jump to

Keyboard shortcuts

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