domain

package
v0.0.0-...-72a7257 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Video = MediaType{"video"}
	Image = MediaType{"image"}
)
View Source
var RedditVideo = Source{/* contains filtered or unexported fields */}

Functions

This section is empty.

Types

type ChatId

type ChatId int64

func (ChatId) String

func (m ChatId) String() string

type MediaType

type MediaType struct {
	// contains filtered or unexported fields
}

func NewMediaTypeFromString

func NewMediaTypeFromString(typeStr string) (MediaType, error)

func (MediaType) IsZero

func (h MediaType) IsZero() bool

func (MediaType) String

func (m MediaType) String() string

type Message

type Message struct {
	Id int

	ReplytoMessage ReplytoMessage
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(message *tgbotapi.Message) Message

func (Message) AsReaction

func (m Message) AsReaction() Reaction

func (Message) ChatId

func (m Message) ChatId() ChatId

func (Message) From

func (m Message) From() UserRef

func (Message) GetEmbeddedUrl

func (m Message) GetEmbeddedUrl() (*url.URL, error)

func (Message) HasDownloadableUrl

func (m Message) HasDownloadableUrl() bool

func (Message) HasMedia

func (m Message) HasMedia() bool

func (Message) IsBotPost

func (m Message) IsBotPost() bool

func (Message) IsCommand

func (m Message) IsCommand(commandName string) bool

func (Message) IsSelfReply

func (m Message) IsSelfReply() bool

func (Message) MediaId

func (m Message) MediaId() string

func (Message) MediaType

func (m Message) MediaType() MediaType

func (Message) MessageId

func (m Message) MessageId() MessageId

type MessageId

type MessageId int

func (MessageId) String

func (m MessageId) String() string

type Post

type Post struct {
	Id                string
	ExternalSourceUrl *url.URL
	OriginalMessageId MessageId
	Type              MediaType
	Reactions         []Reaction
	PostedOn          time.Time
	ChatId            ChatId
	Poster            UserRef
}

func NewPost

func NewPost(mediaId string, poster UserRef, chatId ChatId, mediaType MediaType) Post

func NewPostFromExternalSource

func NewPostFromExternalSource(externalSourceUrl *url.URL, poster UserRef, chatId ChatId, messageId MessageId) Post

func (*Post) AddReaction

func (p *Post) AddReaction(reaction Reaction)

type Reaction

type Reaction struct {
	Text     string
	PostedOn time.Time
	Reactor  UserRef
}

type ReplytoMessage

type ReplytoMessage struct {
	// contains filtered or unexported fields
}

func (ReplytoMessage) GetUserRef

func (m ReplytoMessage) GetUserRef() (UserRef, error)

Based on the fact that bot posts always contain exactly one mention

func (ReplytoMessage) HasMedia

func (m ReplytoMessage) HasMedia() bool

func (ReplytoMessage) IsPostedByBot

func (m ReplytoMessage) IsPostedByBot() bool

type Source

type Source struct {
	// contains filtered or unexported fields
}

type UserRef

type UserRef struct {
	DisplayName string
	Id          int64
}

func NewUserRef

func NewUserRef(id int64, firstName string, lastName string) UserRef

func (UserRef) AsUserMention

func (ur UserRef) AsUserMention() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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