telegram

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *gorm.DB) provider.Provider

Types

type Chat

type Chat struct {
	gorm.Model
	ID       int `json:"id" gorm:"unique"`
	Messages []Message
	Name     string `json:"name"`
	Type     string `json:"type"`
}

func (Chat) TableName

func (Chat) TableName() string

type Member

type Member struct {
	gorm.Model
	MessageID int
	Message   Message
	Name      string `json:"name"`
}

func (Member) TableName

func (Member) TableName() string

func (*Member) UnmarshalJSON

func (m *Member) UnmarshalJSON(b []byte) error

type Message

type Message struct {
	gorm.Model
	ChatID                    int
	Chat                      Chat
	ID                        int            `json:"id" gorm:"unique"`
	Action                    string         `json:"action"`
	Actor                     string         `json:"actor"`
	ActorID                   int            `json:"actor_id"`
	Address                   string         `json:"address"`
	Author                    string         `json:"author"`
	ContactVcard              string         `json:"contact_vcard"`
	Date                      types.DateTime `json:"date"`
	DiscardReason             string         `json:"discard_reason"`
	Duration                  int            `json:"duration"`
	DurationSeconds           int            `json:"duration_seconds"`
	Edited                    string         `json:"edited"`
	File                      string         `json:"file"`
	ForwardedFrom             string         `json:"forwarded_from"`
	From                      string         `json:"from"`
	FromID                    int            `json:"from_id"`
	GameDescription           string         `json:"game_description"`
	GameLink                  string         `json:"game_link"`
	GameMessageID             int            `json:"game_message_id"`
	GameTitle                 string         `json:"game_title"`
	Height                    int            `json:"height"`
	Inviter                   string         `json:"inviter"`
	LiveLocationPeriodSeconds int            `json:"live_location_period_seconds"`
	MediaType                 string         `json:"media_type"`
	MessageID                 int            `json:"message_id"`
	MimeType                  string         `json:"mime_type"`
	Performer                 string         `json:"performer"`
	Photo                     string         `json:"photo"`
	PlaceName                 string         `json:"place_name"`
	ReplyToMessageID          int            `json:"reply_to_message_id"`
	SavedFrom                 string         `json:"saved_from"`
	Score                     int            `json:"score"`
	SelfDestructPeriodSeconds int            `json:"self_destruct_period_seconds"`
	StickerEmoji              string         `json:"sticker_emoji"`
	Thumbnail                 string         `json:"thumbnail"`
	Title                     string         `json:"title"`
	Type                      string         `json:"type"`
	ViaBot                    string         `json:"via_bot"`
	Width                     int            `json:"width"`

	Text            string // todo: links, mentions
	TextAttachments []TextAttachment

	ContactInformationFirstName   string
	ContactInformationLastName    string
	ContactInformationPhoneNumber string

	LocationInformationLatitude  float64
	LocationInformationLongitude float64

	PollClosed      bool
	PollQuestion    string
	PollTotalVoters int
	PollAnswers     []PollAnswer
	Members         []Member
}

func (Message) TableName

func (Message) TableName() string

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(b []byte) error

type PollAnswer

type PollAnswer struct {
	gorm.Model
	MessageID int
	Message   Message
	Chosen    bool
	Text      string
	Voters    int
}

func (PollAnswer) TableName

func (PollAnswer) TableName() string

func (*PollAnswer) UnmarshalJSON

func (a *PollAnswer) UnmarshalJSON(b []byte) error

type TextAttachment

type TextAttachment struct {
	gorm.Model
	MessageID int
	Message   Message
	Type      string `json:"type"`
	Text      string `json:"text"`
	Href      string `json:"href"`
}

func (TextAttachment) TableName

func (TextAttachment) TableName() string

type TextPartOrTextAttachment

type TextPartOrTextAttachment struct {
	Part       string
	Attachment TextAttachment
	// contains filtered or unexported fields
}

func (*TextPartOrTextAttachment) UnmarshalJSON

func (t *TextPartOrTextAttachment) UnmarshalJSON(b []byte) error

type TextWithAttachments

type TextWithAttachments struct {
	Text        string
	Attachments []TextAttachment
}

func (*TextWithAttachments) UnmarshalJSON

func (t *TextWithAttachments) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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