emote

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emote

type Emote struct {
	ID       string
	Text     string
	Platform Platform
	URL      string
}

type EmoteSet

type EmoteSet []Emote

func (EmoteSet) GetByText

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

type Platform

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

func (Platform) String

func (p Platform) String() string

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) Store

func (*Store) GetAllForUser

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

func (*Store) GetByText

func (s *Store) GetByText(channelID, 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