emote

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmoteCacheDir added in v0.4.0

func EmoteCacheDir() (string, error)

func SaveCache added in v0.4.0

func SaveCache(e Emote, dec DecodedEmote) error

Types

type BTTVEmoteFetcher added in v0.0.3

type BTTVEmoteFetcher interface {
	GetGlobalEmotes(context.Context) (bttv.GlobalEmoteResponse, error)
	GetChannelEmotes(ctx context.Context, broadcaster string) (bttv.UserResponse, error)
}

type DecodedEmote added in v0.4.0

type DecodedEmote struct {
	ID     int            `json:"-"`
	Cols   int            `json:"cols"`
	Images []DecodedImage `json:"images"`
}

func (DecodedEmote) DisplayUnicodePlaceholder added in v0.4.0

func (d DecodedEmote) DisplayUnicodePlaceholder() string

func (DecodedEmote) MarshalEasyJSON added in v0.5.0

func (v DecodedEmote) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DecodedEmote) PrepareCommand added in v0.4.0

func (d DecodedEmote) PrepareCommand() string

func (*DecodedEmote) UnmarshalEasyJSON added in v0.5.0

func (v *DecodedEmote) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type DecodedImage added in v0.4.0

type DecodedImage struct {
	Width       int    `json:"width"`
	Height      int    `json:"height"`
	EncodedPath string `json:"encoded_path"`
	DelayInMS   int    `json:"delay_in_ms"`
}

func (DecodedImage) MarshalEasyJSON added in v0.5.0

func (v DecodedImage) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*DecodedImage) UnmarshalEasyJSON added in v0.5.0

func (v *DecodedImage) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Emote

type Emote struct {
	ID         string
	Text       string
	Platform   Platform
	URL        string
	IsAnimated bool
	Format     string
}

type EmoteSet

type EmoteSet []Emote

func (EmoteSet) GetByText

func (set EmoteSet) GetByText(text string) (Emote, bool)

type EmoteStore added in v0.4.0

type EmoteStore interface {
	GetByTextAllChannels(text string) (Emote, bool)
	GetByText(channelID, text string) (Emote, bool)
}

type Platform

type Platform int
const (
	Unknown Platform = iota
	Twitch
	SevenTV
	BTTV
)

func (Platform) String

func (p Platform) String() string

type Replacer added in v0.4.0

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

func NewReplacer added in v0.4.0

func NewReplacer(httpClient *http.Client, store EmoteStore, enableGraphics bool, cellWidth, cellHeight float32, theme save.Theme) *Replacer

func (*Replacer) ConvertEmote added in v0.4.0

func (i *Replacer) ConvertEmote(e Emote, r io.Reader) (DecodedEmote, error)

func (*Replacer) Replace added in v0.4.0

func (i *Replacer) Replace(channelID, content string) (string, string, error)

type SevenTVEmoteFetcher

type SevenTVEmoteFetcher interface {
	GetGlobalEmotes(context.Context) (seventv.EmoteResponse, error)
	GetChannelEmotes(ctx context.Context, broadcaster string) (seventv.ChannelEmoteResponse, error)
}

type Store

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

func NewStore

func NewStore(logger zerolog.Logger, twitchEmotes TwitchEmoteFetcher, sevenTVEmotes SevenTVEmoteFetcher, bttvEmotes BTTVEmoteFetcher) *Store

func (*Store) AddUserEmotes added in v0.5.1

func (s *Store) AddUserEmotes(userID string, emotes []Emote)

func (*Store) AllEmotesUsableByUser added in v0.5.1

func (s *Store) AllEmotesUsableByUser(userID string) []Emote

func (*Store) GetAll added in v0.4.0

func (s *Store) GetAll() EmoteSet

func (*Store) GetAllForUser

func (s *Store) GetAllForUser(id string) EmoteSet

func (*Store) GetByText

func (s *Store) GetByText(channelID, text string) (Emote, bool)

func (*Store) GetByTextAllChannels added in v0.4.0

func (s *Store) GetByTextAllChannels(text string) (Emote, bool)

func (*Store) RefreshGlobal

func (s *Store) RefreshGlobal(ctx context.Context) error

func (*Store) RefreshLocal

func (s *Store) RefreshLocal(ctx context.Context, channelID string) error

type TwitchEmoteFetcher

type TwitchEmoteFetcher interface {
	GetGlobalEmotes(context.Context) (twitch.EmoteResponse, error)
	GetChannelEmotes(ctx context.Context, broadcaster string) (twitch.EmoteResponse, error)
}

Jump to

Keyboard shortcuts

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