badge

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgeCache

type BadgeCache interface {
	MatchBadgeSet(broadcasterID string, ircBadge []twitchirc.Badge) map[string]twitchapi.BadgeVersion
}

type BadgeFetcher

type BadgeFetcher interface {
	GetGlobalChatBadges(ctx context.Context) ([]twitchapi.BadgeSet, error)
	GetChannelChatBadges(ctx context.Context, broadcasterID string) ([]twitchapi.BadgeSet, error)
}

type Cache

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

func NewCache

func NewCache(fetcher BadgeFetcher) *Cache

func (*Cache) MatchBadgeSet

func (c *Cache) MatchBadgeSet(broadcasterID string, ircBadge []twitchirc.Badge) map[string]twitchapi.BadgeVersion

badges=subscriber/6,arc-raiders-launch-2025/1 MatchBadgeSet uses the irc badge tag data to find and match the global and channel badges. The key of the result map is the badge set id with the matched version.

func (*Cache) RefreshChannel

func (c *Cache) RefreshChannel(ctx context.Context, broadcasterID string) error

func (*Cache) RefreshGlobal

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

type DisplayManager

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

type Replacer

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

func NewReplacer

func NewReplacer(httpClient *http.Client, cache BadgeCache, enableGraphics bool, theme save.Theme, displayManager DisplayManager) *Replacer

func (*Replacer) InjectContributorBadge added in v0.8.0

func (r *Replacer) InjectContributorBadge(loginName string, badges map[string]string) (string, error)

InjectContributorBadge adds a Chatuino contributor badge to the badge map if the user is a contributor. The badge key "!chatuino" sorts before all other badges (ASCII '!' < letters).

func (*Replacer) Replace

func (r *Replacer) Replace(broadcasterID string, badgeList []twitchirc.Badge) (string, map[string]string, error)

Jump to

Keyboard shortcuts

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