telegram

package
v0.0.0-...-df94c59 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityTypeLink    = "link"
	EntityTypePlain   = "plain"
	EntityTypeHashtag = "hashtag"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	ID       int         `json:"id"`
	Messages []MessageTg `json:"messages"`
}

type Message

type Message struct {
	ID            int      `json:"id"`
	Date          string   `json:"date"`
	Text          string   `json:"text_entities"`
	Hashtags      []string `json:"hashtags,omitempty"`
	From          string   `json:"from,omitempty"`
	FromId        string   `json:"from_id,omitempty"`
	ForwardedFrom string   `json:"forwarded_from"`
	MessageId     int      `json:"message_id,omitempty"`
}

type MessageFull

type MessageFull struct {
	ID               int          `json:"id"`
	Type             string       `json:"type"`
	Date             string       `json:"date"`
	DateUnixtime     string       `json:"date_unixtime"`
	Actor            string       `json:"actor,omitempty"`
	ActorID          string       `json:"actor_id,omitempty"`
	Action           string       `json:"action,omitempty"`
	Text             []TextEntity `json:"text_entities"`
	Photo            string       `json:"photo,omitempty"`
	Width            int          `json:"width,omitempty"`
	Height           int          `json:"height,omitempty"`
	Edited           string       `json:"edited,omitempty"`
	EditedUnixtime   string       `json:"edited_unixtime,omitempty"`
	From             string       `json:"from,omitempty"`
	FromId           string       `json:"from_id,omitempty"`
	ForwardedFrom    string       `json:"forwarded_from"`
	MessageId        int          `json:"message_id,omitempty"`
	ReplyToMessageId int          `json:"reply_to_message_id,omitempty"`
	Poll             struct {
		Question    string `json:"question"`
		Closed      bool   `json:"closed"`
		TotalVoters int    `json:"total_voters"`
		Answers     []struct {
			Text   string `json:"text"`
			Voters int    `json:"voters"`
			Chosen bool   `json:"chosen"`
		} `json:"answers"`
	} `json:"poll,omitempty"`
	File            string `json:"file,omitempty"`
	Thumbnail       string `json:"thumbnail,omitempty"`
	MediaType       string `json:"media_type,omitempty"`
	MimeType        string `json:"mime_type,omitempty"`
	DurationSeconds int    `json:"duration_seconds,omitempty"`
}

type MessageTg

type MessageTg struct {
	ID            int          `json:"id"`
	Type          string       `json:"type"`
	Date          string       `json:"date"`
	Text          []TextEntity `json:"text_entities"`
	From          string       `json:"from,omitempty"`
	FromId        string       `json:"from_id,omitempty"`
	ForwardedFrom string       `json:"forwarded_from"`
	MessageId     int          `json:"message_id,omitempty"`
}

func (*MessageTg) ToMessage

func (m *MessageTg) ToMessage() *Message

type TextEntity

type TextEntity struct {
	Type string `json:"type"`
	Text string `json:"text"`
	Href string `json:"href,omitempty"`
}

Jump to

Keyboard shortcuts

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