emote

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPartialFetch = errors.New("emote data could only be partially fetched")

Functions

This section is empty.

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 Cache added in v0.6.2

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

func NewCache added in v0.6.2

func NewCache(logger zerolog.Logger, twitchEmotes TwitchEmoteFetcher, sevenTVEmotes SevenTVEmoteFetcher, bttvEmotes BTTVEmoteFetcher) *Cache

func (*Cache) AddUserEmotes added in v0.6.2

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

func (*Cache) AllEmotesUsableByUser added in v0.6.2

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

func (*Cache) GetAll added in v0.6.2

func (s *Cache) GetAll() EmoteSet

func (*Cache) GetAllForChannel added in v0.6.2

func (s *Cache) GetAllForChannel(id string) EmoteSet

GetAllForChannel retrieves all emotes for a specific user.

func (*Cache) GetByText added in v0.6.2

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

func (*Cache) GetByTextAllChannels added in v0.6.2

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

func (*Cache) LoadSetForeignEmote added in v0.6.2

func (s *Cache) LoadSetForeignEmote(emoteID, emoteText string) Emote

func (*Cache) RefreshGlobal added in v0.6.2

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

func (*Cache) RefreshLocal added in v0.6.2

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

RefreshLocal refreshes the local emote cache for a specific channel. When a 3rd party API fails, the cache will still be refreshed but a ErrPartialFetch will be returned.

func (*Cache) RemoveEmoteSetForChannel added in v0.6.2

func (s *Cache) RemoveEmoteSetForChannel(channelID string)

type DisplayManager added in v0.6.2

type DisplayManager interface {
	Convert(unit kittyimg.DisplayUnit) (kittyimg.KittyDisplayUnit, error)
}

type Emote

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

	// For channel specific twitch emotes
	// bitstier, follower, subscriptions
	TTVEmoteType 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)
	LoadSetForeignEmote(emoteID, emoteText string) Emote
}

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, theme save.Theme, displayManager DisplayManager) *Replacer

func (*Replacer) Replace added in v0.4.0

func (i *Replacer) Replace(channelID, content string, emoteList []twitchirc.Emote) (string, map[string]string, error)

type SevenTVEmoteFetcher

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

type TwitchEmoteFetcher

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

Jump to

Keyboard shortcuts

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