model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ChatTypePrivate    = "private"
	ChatTypeGroup      = "group"
	ChatTypeSuperGroup = "supergroup"
	ChatTypeChannel    = "channel"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackQuery

type CallbackQuery struct {
	ID              string `json:"id"`
	From            User   `json:"from"`
	InlineMessageID string `json:"inline_message_id"` // optional
	ChatInstance    string `json:"chat_instance"`
	Data            string `json:"data"`            // optional
	GameShortName   string `json:"game_short_name"` // optional
}

CallbackQuery is data sent when a keyboard button with callback data is clicked.

type Contact

type Contact struct {
	PhoneNumber string `json:"phone_number"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"` // optional
	UserID      int    `json:"user_id"`   // optional
}

Contact contains information about a contact.

Note that LastName and UserID may be empty.

type Location

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

Location contains information about a place.

type Message

type Message struct {
	Type                  MessageType
	Data                  string
	CallbackQuery         CallbackQuery
	Caption               string
	Replies               chan *Message
	From                  User
	Contact               Contact
	Location              Location
	ChatID                int64
	ChatType              string
	DisablePreview        bool
	Markdown              bool
	InlineButtons         []map[string]string
	WithURLInlineButtons  bool
	WithDataInlineButtons bool
	Buttons               [][]string
	ContactButton         string
	LocationButton        string
	OneTimeKeyboard       bool
	ForwardDate           int
}

type MessageType

type MessageType int
const (
	MessageText MessageType = iota
	MessageContact
	MessageLocation
	MessageDocument
	MessageSticker
	MessagePhoto
	MessageVideo
	MessageAudio
	MessageKeyboard
	MessageInlineKeyboard
	MessageContactButton
	MessageLocationButton
)

type User

type User struct {
	ID           int    `json:"id"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`     // optional
	UserName     string `json:"username"`      // optional
	LanguageCode string `json:"language_code"` // optional
}

User is a user on Telegram.

Jump to

Keyboard shortcuts

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