schemes

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttachmentImage    AttachmentType = "image"
	AttachmentVideo                   = "video"
	AttachmentAudio                   = "audio"
	AttachmentFile                    = "file"
	AttachmentContact                 = "contact"
	AttachmentSticker                 = "sticker"
	AttachmentShare                   = "share"
	AttachmentLocation                = "location"
	AttachmentKeyboard                = "inline_keyboard"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionRequestBody

type ActionRequestBody struct {
	Action SenderAction `json:"action"`
}

type Attachment

type Attachment struct {
	Type AttachmentType `json:"type"`
}

Generic schema representing message attachment

func (Attachment) GetAttachmentType

func (a Attachment) GetAttachmentType() AttachmentType

type AttachmentInterface

type AttachmentInterface interface {
	GetAttachmentType() AttachmentType
}

type AttachmentPayload

type AttachmentPayload struct {
	// Media attachment URL
	Url string `json:"url"`
}

type AttachmentRequest

type AttachmentRequest struct {
	Type AttachmentType `json:"type"`
}

Request to attach some data to message

type AttachmentType

type AttachmentType string

type AudioAttachment

type AudioAttachment struct {
	Attachment
	Payload MediaAttachmentPayload `json:"payload"`
}

type AudioAttachmentRequest

type AudioAttachmentRequest struct {
	AttachmentRequest
	Payload UploadedInfo `json:"payload"`
}

Request to attach audio to message. MUST be the only attachment in message

func NewAudioAttachmentRequest

func NewAudioAttachmentRequest(payload UploadedInfo) *AudioAttachmentRequest

type BotAddedToChatUpdate

type BotAddedToChatUpdate struct {
	Update
	ChatId int64 `json:"chat_id"` // Chat id where bots was added
	User   User  `json:"user"`    // User who added bots to chat
}

You will receive this update when bots has been added to chat

func (BotAddedToChatUpdate) GetChatID

func (b BotAddedToChatUpdate) GetChatID() int64

func (BotAddedToChatUpdate) GetUserID

func (b BotAddedToChatUpdate) GetUserID() int64

type BotCommand

type BotCommand struct {
	Name        string `json:"name"`                  // Command name
	Description string `json:"description,omitempty"` // Optional command description
}

type BotInfo

type BotInfo struct {
	UserId        int64        `json:"user_id"`                   // Users identifier
	Name          string       `json:"name"`                      // Users visible name
	Username      string       `json:"username,omitempty"`        // Unique public user name. Can be `null` if user is not accessible or it is not set
	AvatarUrl     string       `json:"avatar_url,omitempty"`      // URL of avatar
	FullAvatarUrl string       `json:"full_avatar_url,omitempty"` // URL of avatar of a bigger size
	Commands      []BotCommand `json:"commands,omitempty"`        // Commands supported by bots
	Description   string       `json:"description,omitempty"`     // Bot description
}

type BotPatch

type BotPatch struct {
	Name        string                         `json:"name,omitempty"`        // Visible name of bots
	Username    string                         `json:"username,omitempty"`    // Bot unique identifier. It can be any string 4-64 characters long containing any digit, letter or special symbols: \"-\" or \"_\". It **must** starts with a letter
	Description string                         `json:"description,omitempty"` // Bot description up to 16k characters long
	Commands    []BotCommand                   `json:"commands,omitempty"`    // Commands supported by bots. Pass empty list if you want to remove commands
	Photo       *PhotoAttachmentRequestPayload `json:"photo,omitempty"`       // Request to set bots photo
}

type BotRemovedFromChatUpdate

type BotRemovedFromChatUpdate struct {
	Update
	ChatId int64 `json:"chat_id"` // Chat identifier bots removed from
	User   User  `json:"user"`    // User who removed bots from chat
}

You will receive this update when bots has been removed from chat

func (BotRemovedFromChatUpdate) GetChatID

func (b BotRemovedFromChatUpdate) GetChatID() int64

func (BotRemovedFromChatUpdate) GetUserID

func (b BotRemovedFromChatUpdate) GetUserID() int64

type BotStartedUpdate

type BotStartedUpdate struct {
	Update
	ChatId int64 `json:"chat_id"` // Dialog identifier where event has occurred
	User   User  `json:"user"`    // User pressed the 'Start' button
}

Bot gets this type of update as soon as user pressed `Start` button

func (BotStartedUpdate) GetChatID

func (b BotStartedUpdate) GetChatID() int64

func (BotStartedUpdate) GetUserID

func (b BotStartedUpdate) GetUserID() int64

type Button

type Button struct {
	Type ButtonType `json:"type"`
	Text string     `json:"text"` // Visible text of button
}

func (Button) GetText

func (b Button) GetText() string

func (Button) GetType

func (b Button) GetType() ButtonType

type ButtonInterface

type ButtonInterface interface {
	GetType() ButtonType
	GetText() string
}

type ButtonType

type ButtonType string
const (
	LINK        ButtonType = "link"
	CALLBACK    ButtonType = "callback"
	CONTACT     ButtonType = "request_contact"
	GEOLOCATION ButtonType = "request_geo_location"
)

type Callback

type Callback struct {
	Timestamp  int64  `json:"timestamp"` // Unix-time when event has occurred
	CallbackID string `json:"callback_id"`
	Payload    string `json:"payload,omitempty"` // Button payload
	User       User   `json:"user"`              // User pressed the button
}

Object sent to bots when user presses button

func (Callback) GetChatID

func (b Callback) GetChatID() int64

func (Callback) GetUserID

func (b Callback) GetUserID() int64

type CallbackAnswer

type CallbackAnswer struct {
	Message      *NewMessageBody `json:"message,omitempty"`      // Fill this if you want to modify current message
	Notification string          `json:"notification,omitempty"` // Fill this if you just want to send one-time notification to user
}

Send this object when your bots wants to react to when a button is pressed

type CallbackButton

type CallbackButton struct {
	Button
	Payload string `json:"payload"`          // Button payload
	Intent  Intent `json:"intent,omitempty"` // Intent of button. Affects clients representation
}

After pressing this type of button client sends to server payload it contains

type CallbackButtonAllOf

type CallbackButtonAllOf struct {
	Payload string `json:"payload"`          // Button payload
	Intent  Intent `json:"intent,omitempty"` // Intent of button. Affects clients representation
}

type Chat

type Chat struct {
	ChatId            int64           `json:"chat_id"`                // Chats identifier
	Type              ChatType        `json:"type"`                   // Type of chat. One of: dialog, chat, channel
	Status            ChatStatus      `json:"status"`                 // Chat status. One of:  - active: bots is active member of chat  - removed: bots was kicked  - left: bots intentionally left chat  - closed: chat was closed
	Title             string          `json:"title,omitempty"`        // Visible title of chat. Can be null for dialogs
	Icon              *Image          `json:"icon"`                   // Icon of chat
	LastEventTime     int             `json:"last_event_time"`        // Time of last event occurred in chat
	ParticipantsCount int             `json:"participants_count"`     // Number of people in chat. Always 2 for `dialog` chat type
	OwnerId           int64           `json:"owner_id,omitempty"`     // Identifier of chat owner. Visible only for chat admins
	Participants      *map[string]int `json:"participants,omitempty"` // Participants in chat with time of last activity. Can be *null* when you request list of chats. Visible for chat admins only
	IsPublic          bool            `json:"is_public"`              // Is current chat publicly available. Always `false` for dialogs
	Link              string          `json:"link,omitempty"`         // Link on chat if it is public
	Description       *string         `json:"description"`            // Chat description
}

type ChatAdminPermission

type ChatAdminPermission string

ChatAdminPermission : Chat admin permissions

const (
	READ_ALL_MESSAGES  ChatAdminPermission = "read_all_messages"
	ADD_REMOVE_MEMBERS ChatAdminPermission = "add_remove_members"
	ADD_ADMINS         ChatAdminPermission = "add_admins"
	CHANGE_CHAT_INFO   ChatAdminPermission = "change_chat_info"
	PIN_MESSAGE        ChatAdminPermission = "pin_message"
	WRITE              ChatAdminPermission = "write"
)

List of ChatAdminPermission

type ChatList

type ChatList struct {
	Chats  []Chat `json:"chats"`  // List of requested chats
	Marker *int   `json:"marker"` // Reference to the next page of requested chats
}

type ChatMember

type ChatMember struct {
	UserId         int64                 `json:"user_id"`                   // Users identifier
	Name           string                `json:"name"`                      // Users visible name
	Username       string                `json:"username,omitempty"`        // Unique public user name. Can be `null` if user is not accessible or it is not set
	AvatarUrl      string                `json:"avatar_url,omitempty"`      // URL of avatar
	FullAvatarUrl  string                `json:"full_avatar_url,omitempty"` // URL of avatar of a bigger size
	LastAccessTime int                   `json:"last_access_time"`
	IsOwner        bool                  `json:"is_owner"`
	IsAdmin        bool                  `json:"is_admin"`
	JoinTime       int                   `json:"join_time"`
	Permissions    []ChatAdminPermission `json:"permissions,omitempty"` // Permissions in chat if member is admin. `null` otherwise
}

type ChatMembersList

type ChatMembersList struct {
	Members []ChatMember `json:"members"` // Participants in chat with time of last activity. Visible only for chat admins
	Marker  *int64       `json:"marker"`  // Pointer to the next data page
}

type ChatPatch

type ChatPatch struct {
	Icon  *PhotoAttachmentRequestPayload `json:"icon,omitempty"`
	Title string                         `json:"title,omitempty"`
}

type ChatStatus

type ChatStatus string

ChatStatus : Chat status for current bots

const (
	ACTIVE    ChatStatus = "active"
	REMOVED   ChatStatus = "removed"
	LEFT      ChatStatus = "left"
	CLOSED    ChatStatus = "closed"
	SUSPENDED ChatStatus = "suspended"
)

List of ChatStatus

type ChatTitleChangedUpdate

type ChatTitleChangedUpdate struct {
	Update
	ChatId int64  `json:"chat_id"` // Chat identifier where event has occurred
	User   User   `json:"user"`    // User who changed title
	Title  string `json:"title"`   // New title
}

Bot gets this type of update as soon as title has been changed in chat

func (ChatTitleChangedUpdate) GetChatID

func (b ChatTitleChangedUpdate) GetChatID() int64

func (ChatTitleChangedUpdate) GetUserID

func (b ChatTitleChangedUpdate) GetUserID() int64

type ChatType

type ChatType string

ChatType : Type of chat. Dialog (one-on-one), chat or channel

const (
	DIALOG  ChatType = "dialog"
	CHAT    ChatType = "chat"
	CHANNEL ChatType = "channel"
)

List of ChatType

type ContactAttachment

type ContactAttachment struct {
	Attachment
	Payload ContactAttachmentPayload `json:"payload"`
}

type ContactAttachmentPayload

type ContactAttachmentPayload struct {
	VcfInfo string `json:"vcfInfo,omitempty"` // User info in VCF format
	TamInfo *User  `json:"tamInfo"`           // User info
}

type ContactAttachmentRequest

type ContactAttachmentRequest struct {
	AttachmentRequest
	Payload ContactAttachmentRequestPayload `json:"payload"`
}

Request to attach contact card to message. MUST be the only attachment in message

type ContactAttachmentRequestPayload

type ContactAttachmentRequestPayload struct {
	Name      string `json:"name,omitempty"`      // Contact name
	ContactId int64  `json:"contactId,omitempty"` // Contact identifier
	VcfInfo   string `json:"vcfInfo,omitempty"`   // Full information about contact in VCF format
	VcfPhone  string `json:"vcfPhone,omitempty"`  // Contact phone in VCF format
}

type Error

type Error struct {
	ErrorText string `json:"error,omitempty"` // Error
	Code      string `json:"code"`            // Error code
	Message   string `json:"message"`         // Human-readable description
}

Server returns this if there was an exception to your request

func (Error) Error

func (e Error) Error() string

type FileAttachment

type FileAttachment struct {
	Attachment
	Payload  FileAttachmentPayload `json:"payload"`
	Filename string                `json:"filename"` // Uploaded file name
	Size     int64                 `json:"size"`     // File size in bytes
}

type FileAttachmentPayload

type FileAttachmentPayload struct {
	Url   string `json:"url"`   // Media attachment URL
	Token string `json:"token"` // Use `token` in case when you are trying to reuse the same attachment in other message
}

type FileAttachmentRequest

type FileAttachmentRequest struct {
	AttachmentRequest
	Payload UploadedInfo `json:"payload"`
}

Request to attach file to message. MUST be the only attachment in message

func NewFileAttachmentRequest

func NewFileAttachmentRequest(payload UploadedInfo) *FileAttachmentRequest

type GetSubscriptionsResult

type GetSubscriptionsResult struct {
	Subscriptions []Subscription `json:"subscriptions"` // Current subscriptions
}

List of all WebHook subscriptions

type Image

type Image struct {
	Url string `json:"url"` // URL of image
}

Generic schema describing image object

type InlineKeyboardAttachment

type InlineKeyboardAttachment struct {
	Attachment
	Payload Keyboard `json:"payload"`
}

Buttons in messages

type InlineKeyboardAttachmentRequest

type InlineKeyboardAttachmentRequest struct {
	AttachmentRequest
	Payload Keyboard `json:"payload"`
}

Request to attach keyboard to message

func NewInlineKeyboardAttachmentRequest

func NewInlineKeyboardAttachmentRequest(payload Keyboard) *InlineKeyboardAttachmentRequest

type Intent

type Intent string

Intent : Intent of button

const (
	POSITIVE Intent = "positive"
	NEGATIVE Intent = "negative"
	DEFAULT  Intent = "default"
)

List of Intent

type Keyboard

type Keyboard struct {
	Buttons [][]ButtonInterface `json:"buttons"`
}

Keyboard is two-dimension array of buttons

type LinkButton

type LinkButton struct {
	Button
	Url string `json:"url"`
}

After pressing this type of button user follows the link it contains

type LinkedMessage

type LinkedMessage struct {
	Type    MessageLinkType `json:"type"`              // Type of linked message
	Sender  User            `json:"sender,omitempty"`  // User sent this message. Can be `null` if message has been posted on behalf of a channel
	ChatId  int64           `json:"chat_id,omitempty"` // Chat where message has been originally posted. For forwarded messages only
	Message MessageBody     `json:"message"`
}

type LocationAttachment

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

type LocationAttachmentRequest

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

Request to attach keyboard to message

func NewLocationAttachmentRequest

func NewLocationAttachmentRequest(latitude float64, longitude float64) *LocationAttachmentRequest

type MediaAttachmentPayload

type MediaAttachmentPayload struct {
	Url   string `json:"url"`   // Media attachment URL
	Token string `json:"token"` // Use `token` in case when you are trying to reuse the same attachment in other message
}

type Message

type Message struct {
	Sender    User           `json:"sender,omitempty"` // User that sent this message. Can be `null` if message has been posted on behalf of a channel
	Recipient Recipient      `json:"recipient"`        // Message recipient. Could be user or chat
	Timestamp int64          `json:"timestamp"`        // Unix-time when message was created
	Link      *LinkedMessage `json:"link,omitempty"`   // Forwarder or replied message
	Body      MessageBody    `json:"body"`             // Body of created message. Text + attachments. Could be null if message contains only forwarded message
	Stat      *MessageStat   `json:"stat,omitempty"`   // Message statistics. Available only for channels in [GET:/messages](#operation/getMessages) context
}

Message in chat

type MessageBody

type MessageBody struct {
	Mid            string            `json:"mid"`            // Unique identifier of message
	Seq            int64             `json:"seq"`            // Sequence identifier of message in chat
	Text           string            `json:"text,omitempty"` // Message text
	RawAttachments []json.RawMessage `json:"attachments"`    // Message attachments. Could be one of `Attachment` type. See description of this schema
	Attachments    []interface{}
	ReplyTo        string `json:"reply_to,omitempty"` // In case this message is reply to another, it is the unique identifier of the replied message
}

Schema representing body of message

type MessageCallbackUpdate

type MessageCallbackUpdate struct {
	Update
	Callback Callback `json:"callback"`
	Message  *Message `json:"message"` // Original message containing inline keyboard. Can be `null` in case it had been deleted by the moment a bots got this update
}

You will get this `update` as soon as user presses button

func (MessageCallbackUpdate) GetChatID

func (b MessageCallbackUpdate) GetChatID() int64

func (MessageCallbackUpdate) GetUserID

func (b MessageCallbackUpdate) GetUserID() int64

type MessageCreatedUpdate

type MessageCreatedUpdate struct {
	Update
	Message Message `json:"message"` // Newly created message
}

You will get this `update` as soon as message is created

func (MessageCreatedUpdate) GetChatID

func (b MessageCreatedUpdate) GetChatID() int64

func (MessageCreatedUpdate) GetUserID

func (b MessageCreatedUpdate) GetUserID() int64

type MessageEditedUpdate

type MessageEditedUpdate struct {
	Update
	Message Message `json:"message"` // Edited message
}

You will get this `update` as soon as message is edited

func (MessageEditedUpdate) GetChatID

func (b MessageEditedUpdate) GetChatID() int64

func (MessageEditedUpdate) GetUserID

func (b MessageEditedUpdate) GetUserID() int64

type MessageLinkType

type MessageLinkType string

MessageLinkType : Type of linked message

const (
	FORWARD MessageLinkType = "forward"
	REPLY   MessageLinkType = "reply"
)

List of MessageLinkType

type MessageList

type MessageList struct {
	Messages []Message `json:"messages"` // List of messages
}

Paginated list of messages

type MessageRemovedUpdate

type MessageRemovedUpdate struct {
	Update
	MessageId string `json:"message_id"` // Identifier of removed message
}

You will get this `update` as soon as message is removed

func (MessageRemovedUpdate) GetChatID

func (b MessageRemovedUpdate) GetChatID() int64

func (MessageRemovedUpdate) GetUserID

func (b MessageRemovedUpdate) GetUserID() int64

type MessageStat

type MessageStat struct {
	Views int `json:"views"`
}

Message statistics

type NewMessageBody

type NewMessageBody struct {
	Text        string          `json:"text,omitempty"`        // Message text
	Attachments []interface{}   `json:"attachments,omitempty"` // Message attachments. See `AttachmentRequest` and it's inheritors for full information
	Link        *NewMessageLink `json:"link"`                  // Link to Message
	Notify      bool            `json:"notify,omitempty"`      // If false, chat participants wouldn't be notified
}
type NewMessageLink struct {
	Type MessageLinkType `json:"type"` // Type of message link
	Mid  string          `json:"mid"`  // Message identifier of original message
}

type PhotoAttachment

type PhotoAttachment struct {
	Attachment
	Payload PhotoAttachmentPayload `json:"payload"`
}

Image attachment

type PhotoAttachmentPayload

type PhotoAttachmentPayload struct {
	PhotoId int64  `json:"photo_id"` // Unique identifier of this image
	Token   string `json:"token"`
	Url     string `json:"url"` // Image URL
}

type PhotoAttachmentRequest

type PhotoAttachmentRequest struct {
	AttachmentRequest
	Payload PhotoAttachmentRequestPayload `json:"payload"`
}

type PhotoAttachmentRequestAllOf

type PhotoAttachmentRequestAllOf struct {
	Payload PhotoAttachmentRequestPayload `json:"payload"`
}

type PhotoAttachmentRequestPayload

type PhotoAttachmentRequestPayload struct {
	Url    string                `json:"url,omitempty"`    // Any external image URL you want to attach
	Token  string                `json:"token,omitempty"`  // Token of any existing attachment
	Photos map[string]PhotoToken `json:"photos,omitempty"` // Tokens were obtained after uploading images
}

Request to attach image. All fields are mutually exclusive

type PhotoToken

type PhotoToken struct {
	Token string `json:"token"` // Encoded information of uploaded image
}

type PhotoTokens

type PhotoTokens struct {
	Photos map[string]PhotoToken `json:"photos"`
}

This is information you will receive as soon as an image uploaded

type Recipient

type Recipient struct {
	ChatId   int64    `json:"chat_id,omitempty"` // Chat identifier
	ChatType ChatType `json:"chat_type"`         // Chat type
	UserId   int64    `json:"user_id,omitempty"` // User identifier, if message was sent to user
}

New message recipient. Could be user or chat

type RequestContactButton

type RequestContactButton struct {
	Button
}

After pressing this type of button client sends new message with attachment of current user contact

type RequestGeoLocationButton

type RequestGeoLocationButton struct {
	Button
	Quick bool `json:"quick,omitempty"` // If *true*, sends location without asking user's confirmation
}

After pressing this type of button client sends new message with attachment of current user geo location

type SendMessageResult

type SendMessageResult struct {
	Message Message `json:"message"`
}

type SenderAction

type SenderAction string

SenderAction : Different actions to send to chat members

const (
	TYPING_ON     SenderAction = "typing_on"
	TYPING_OFF    SenderAction = "typing_off"
	SENDING_PHOTO SenderAction = "sending_photo"
	SENDING_VIDEO SenderAction = "sending_video"
	SENDING_AUDIO SenderAction = "sending_audio"
	MARK_SEEN     SenderAction = "mark_seen"
)

List of SenderAction

type ShareAttachment

type ShareAttachment struct {
	Attachment
	Payload AttachmentPayload `json:"payload"`
}

type SimpleQueryResult

type SimpleQueryResult struct {
	Success bool   `json:"success"`           // `true` if request was successful. `false` otherwise
	Message string `json:"message,omitempty"` // Explanatory message if the result is not successful
}

Simple response to request

type StickerAttachment

type StickerAttachment struct {
	Attachment
	Payload StickerAttachmentPayload `json:"payload"`
	Width   int                      `json:"width"`  // Sticker width
	Height  int                      `json:"height"` // Sticker height
}

type StickerAttachmentPayload

type StickerAttachmentPayload struct {
	Url  string `json:"url"`  // Media attachment URL
	Code string `json:"code"` // Sticker identifier
}

type StickerAttachmentRequest

type StickerAttachmentRequest struct {
	AttachmentRequest
	Payload StickerAttachmentRequestPayload `json:"payload"`
}

Request to attach sticker. MUST be the only attachment request in message

type StickerAttachmentRequestPayload

type StickerAttachmentRequestPayload struct {
	Code string `json:"code"` // Sticker code
}

type Subscription

type Subscription struct {
	Url         string   `json:"url"`                    // Webhook URL
	Time        int64    `json:"time"`                   // Unix-time when subscription was created
	UpdateTypes []string `json:"update_types,omitempty"` // Update types bots subscribed for
	Version     string   `json:"version,omitempty"`
}

Schema to describe WebHook subscription

type SubscriptionRequestBody

type SubscriptionRequestBody struct {
	Url         string   `json:"url"`                    // URL of HTTP(S)-endpoint of your bots. Must starts with http(s)://
	UpdateTypes []string `json:"update_types,omitempty"` // List of update types your bots want to receive. See `Update` object for a complete list of types
	Version     string   `json:"version,omitempty"`      // Version of API. Affects model representation
}

Request to set up WebHook subscription

type Update

type Update struct {
	UpdateType UpdateType `json:"update_type"`
	Timestamp  int        `json:"timestamp"` // Unix-time when event has occurred
}

`Update` object represents different types of events that happened in chat. See its inheritors

func (Update) GetUpdateTime

func (u Update) GetUpdateTime() time.Time

func (Update) GetUpdateType

func (u Update) GetUpdateType() UpdateType

type UpdateInterface

type UpdateInterface interface {
	GetUpdateType() UpdateType
	GetUpdateTime() time.Time
	GetUserID() int64
	GetChatID() int64
}

type UpdateList

type UpdateList struct {
	Updates []json.RawMessage `json:"updates"` // Page of updates
	Marker  *int64            `json:"marker"`  // Pointer to the next data page
}

List of all updates in chats your bots participated in

type UpdateType

type UpdateType string
const (
	TypeMessageCallback  UpdateType = "message_callback"
	TypeMessageCreated   UpdateType = "message_created"
	TypeMessageRemoved   UpdateType = "message_removed"
	TypeMessageEdited    UpdateType = "message_edited"
	TypeBotAdded         UpdateType = "bot_added"
	TypeBotRemoved       UpdateType = "bot_removed"
	TypeUserAdded        UpdateType = "user_added"
	TypeUserRemoved      UpdateType = "user_removed"
	TypeBotStarted       UpdateType = "bot_started"
	TypeChatTitleChanged UpdateType = "chat_title_changed"
)

type UploadEndpoint

type UploadEndpoint struct {
	Url string `json:"url"` // URL to upload
}

Endpoint you should upload to your binaries

type UploadType

type UploadType string

UploadType : Type of file uploading

const (
	PHOTO UploadType = "photo"
	VIDEO UploadType = "video"
	AUDIO UploadType = "audio"
	FILE  UploadType = "file"
)

List of UploadType

type UploadedInfo

type UploadedInfo struct {
	FileID int64  `json:"file_id,omitempty"`
	Token  string `json:"token,omitempty"` // Token is unique uploaded media identfier
}

This is information you will receive as soon as audio/video is uploaded

type User

type User struct {
	UserId   int64  `json:"user_id"`            // Users identifier
	Name     string `json:"name"`               // Users visible name
	Username string `json:"username,omitempty"` // Unique public user name. Can be `null` if user is not accessible or it is not set
}

type UserAddedToChatUpdate

type UserAddedToChatUpdate struct {
	Update
	ChatId    int64 `json:"chat_id"`    // Chat identifier where event has occurred
	User      User  `json:"user"`       // User added to chat
	InviterId int64 `json:"inviter_id"` // User who added user to chat
}

You will receive this update when user has been added to chat where bots is administrator

func (UserAddedToChatUpdate) GetChatID

func (b UserAddedToChatUpdate) GetChatID() int64

func (UserAddedToChatUpdate) GetUserID

func (b UserAddedToChatUpdate) GetUserID() int64

type UserIdsList

type UserIdsList struct {
	UserIds []int `json:"user_ids"`
}

type UserRemovedFromChatUpdate

type UserRemovedFromChatUpdate struct {
	Update
	ChatId  int64 `json:"chat_id"`  // Chat identifier where event has occurred
	User    User  `json:"user"`     // User removed from chat
	AdminId int64 `json:"admin_id"` // Administrator who removed user from chat
}

You will receive this update when user has been removed from chat where bots is administrator

func (UserRemovedFromChatUpdate) GetChatID

func (b UserRemovedFromChatUpdate) GetChatID() int64

func (UserRemovedFromChatUpdate) GetUserID

func (b UserRemovedFromChatUpdate) GetUserID() int64

type UserWithPhoto

type UserWithPhoto struct {
	UserId        int64  `json:"user_id"`                   // Users identifier
	Name          string `json:"name"`                      // Users visible name
	Username      string `json:"username,omitempty"`        // Unique public user name. Can be `null` if user is not accessible or it is not set
	AvatarUrl     string `json:"avatar_url,omitempty"`      // URL of avatar
	FullAvatarUrl string `json:"full_avatar_url,omitempty"` // URL of avatar of a bigger size
}

type VideoAttachment

type VideoAttachment struct {
	Attachment
	Payload MediaAttachmentPayload `json:"payload"`
}

type VideoAttachmentRequest

type VideoAttachmentRequest struct {
	AttachmentRequest
	Payload UploadedInfo `json:"payload"`
}

Request to attach video to message

func NewVideoAttachmentRequest

func NewVideoAttachmentRequest(payload UploadedInfo) *VideoAttachmentRequest

Jump to

Keyboard shortcuts

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