channel

package
v0.0.0-...-415d151 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResultOfTelegramResponse

func GetResultOfTelegramResponse(rawResponse string) (map[string]interface{}, error)

Types

type Telegram

type Telegram struct {
	Token string
}

func (*Telegram) GetFile

func (telegram *Telegram) GetFile(fileId string) (TelegramFile, error)

func (*Telegram) Request

func (telegram *Telegram) Request(method string, endpoint string, data string, endpointName string) (string, error)

Telegram Request API

func (*Telegram) SendDocument

func (telegram *Telegram) SendDocument(message TelegramParamMessageDocument) (TelegramMessage, error)

func (*Telegram) SendMessage

func (telegram *Telegram) SendMessage(message TelegramParamMessageText) (TelegramMessage, error)

func (*Telegram) SetWebhook

func (telegram *Telegram) SetWebhook(urlWebhook string) error

type TelegramCallbackQuery

type TelegramCallbackQuery struct {
	MessageId       int    `json:"message_id"`
	Message         string `json:"message"`
	EditedMessage   string `json:"edited_message"`
	ChannelPost     string `json:"channel_post"`
	EditChannelPost string `json:"edit_channel_post"`
	CallbackQuery   string `json:"callback_query"`
}

Representative type response telegram

type TelegramChat

type TelegramChat struct {
	Id        int    `json:"id"`
	Type      string `json:"type"`
	Title     string `json:"title"`
	Username  string `json:"username"`
	FirstName string `json:"firstname"`
	LastName  string `json:"lastname"`
}

type TelegramDocument

type TelegramDocument struct {
	FileId   string        `json:"file_id"`
	Thumb    TelegramPhoto `json:"thumb"`
	FileName string        `json:"file_name"`
	MimeType string        `json:"mime_type"`
	FileSize int           `json:"file_size"`
}

type TelegramFile

type TelegramFile struct {
	FileId   string `json:"file_id"`
	FileSize int    `json:"file_size"`
	FilePath string `json:"file_path"`
}

type TelegramMessage

type TelegramMessage struct {
	MessageId        int                  `json:"message_id"`
	From             TelegramUser         `json:"from"`
	Date             int                  `json:"date"`
	Chat             TelegramChat         `json:"chat"`
	ForwardFrom      TelegramUser         `json:"forward_from"`
	ForwardFromChat  TelegramChat         `json:"forward_from_chat"`
	ForwardMessageId int                  `json:"forward_message_id"`
	ForwardDate      int                  `json:"forward_date"`
	ReplyToMessage   TelegramMessageReply `json:"reply_to_message"`
	Text             string               `json:"text"`
	Document         TelegramDocument     `json:"document"`
	Photo            []TelegramPhoto      `json:"photo"`
}

type TelegramMessageReply

type TelegramMessageReply struct {
	MessageId        int          `json:"message_id"`
	From             TelegramUser `json:"from"`
	Date             int          `json:"date"`
	Chat             TelegramChat `json:"chat"`
	ForwardFromChat  TelegramChat `json:"forward_from_chat"`
	ForwardFrom      TelegramUser `json:"forward_from"`
	ForwardMessageId int          `json:"forward_message_id"`
	ForwardDate      int          `json:"forward_date"`
	Text             string       `json:"text"`
}

type TelegramParamGetFile

type TelegramParamGetFile struct {
	FileId string `json:"file_id"`
}

Representative post parameter request to telegram

type TelegramParamMessageDocument

type TelegramParamMessageDocument struct {
	ChatId                string `json:"chat_id"`
	Document              string `json:"document"`
	Caption               string `json:"caption"`
	ParseMode             string `json:"parse_mode"`
	DisableWebPagePreview bool   `json:"disable_web_page_preview"`
	DisableNotification   bool   `json:"disable_notification"`
	ReplyToMessageId      int    `json:"reply_to_message_id"`
}

type TelegramParamMessageText

type TelegramParamMessageText struct {
	ChatId                string `json:"chat_id"`
	Text                  string `json:"text"`
	ParseMode             string `json:"parse_mode"`
	DisableWebPagePreview bool   `json:"disable_web_page_preview"`
	DisableNotification   bool   `json:"disable_notification"`
	ReplyToMessageId      int    `json:"reply_to_message_id"`
}

type TelegramParamWebhook

type TelegramParamWebhook struct {
	Url            string   `json:"url"`
	MaxConnections int      `json:"max_connections"`
	AllowedUpdates []string `json:"allowed_updates"`
}

type TelegramPhoto

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

type TelegramResponse

type TelegramResponse struct {
	Description string                 `json:"description"`
	ErrorCode   int                    `json:"error_code"`
	Ok          bool                   `json:"ok"`
	Result      map[string]interface{} `json:"result"`
}

type TelegramUpdate

type TelegramUpdate struct {
	UpdateId        int             `json:"update_id"`
	Message         TelegramMessage `json:"message"`
	EditedMessage   TelegramMessage `json:"edited_message"`
	ChannelPost     TelegramMessage `json:"channel_post"`
	EditChannelPost TelegramMessage `json:"edit_channel_post"`
	CallbackQuery   string          `json:"callback_query"`
}

type TelegramUser

type TelegramUser struct {
	Id        int    `json:"id"`
	IsBot     bool   `json:"is_bot"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Username  string `json:"username"`
}

Jump to

Keyboard shortcuts

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