twitter

package
v0.0.0-...-1120f02 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTweetNotFound  = errors.New("tweet not found")
	ErrPrivateAccount = errors.New("unable to view this tweet because account is private")
)

Common Twitter errors

Functions

func New

func New() artworks.Provider

Types

type Artwork

type Artwork struct {
	Videos      []Video
	Photos      []string
	ID          string
	FullName    string
	Username    string
	Content     string
	Permalink   string
	Timestamp   time.Time
	Likes       int
	Replies     int
	Retweets    int
	NSFW        bool
	AIGenerated bool
}

func (*Artwork) Len

func (a *Artwork) Len() int

func (*Artwork) MessageSends

func (a *Artwork) MessageSends(footer string, _ bool) ([]*discordgo.MessageSend, error)

MessageSends transforms an artwork to discordgo embeds.

func (*Artwork) StoreArtwork

func (artwork *Artwork) StoreArtwork() *store.Artwork

func (*Artwork) URL

func (a *Artwork) URL() string

type Twitter

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

func (Twitter) Enabled

func (Twitter) Enabled(g *store.Guild) bool

func (*Twitter) Find

func (t *Twitter) Find(id string) (artworks.Artwork, error)

func (Twitter) Match

func (Twitter) Match(s string) (string, bool)

type Video

type Video struct {
	URL     string
	Preview string
}

Jump to

Keyboard shortcuts

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