sponsorblock

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

README

sponsorblock-plugin

Documentation

Index

Constants

View Source
const (
	EventTypeSegmentsLoaded = "SegmentsLoaded"
	EventTypeSegmentSkipped = "SegmentSkipped"
	EventTypeChaptersLoaded = "ChaptersLoaded"
	EventTypeChapterStarted = "ChapterStarted"
)
View Source
const (
	SegmentCategorySponsor       = "sponsor"
	SegmentCategorySelfpromo     = "selfpromo"
	SegmentCategoryInteraction   = "interaction"
	SegmentCategoryIntro         = "intro"
	SegmentCategoryOutro         = "outro"
	SegmentCategoryPreview       = "preview"
	SegmentCategoryMusicOfftopic = "music_offtopic"
	SegmentCategoryFiller        = "filler"
)

Variables

This section is empty.

Functions

func DeleteCategories

func DeleteCategories(client disgolink.RestClient, sessionID string, guildID snowflake.ID) error

DeleteCategories deletes the categories to skip for the guild.

func SetCategories

func SetCategories(client disgolink.RestClient, sessionID string, guildID snowflake.ID, categories []SegmentCategory) error

SetCategories sets the categories to skip for the guild.

Types

type Chapter

type Chapter struct {
	Name     string            `json:"name"`
	Start    lavalink.Duration `json:"start"`
	End      lavalink.Duration `json:"end"`
	Duration lavalink.Duration `json:"duration"`
}

type ChapterStartedEvent

type ChapterStartedEvent struct {
	GuildID_ snowflake.ID `json:"guild_id"`
	Chapter  Chapter      `json:"chapter"`
}

func (ChapterStartedEvent) GuildID

func (e ChapterStartedEvent) GuildID() snowflake.ID

func (ChapterStartedEvent) Op

func (ChapterStartedEvent) Type

type ChaptersLoadedEvent

type ChaptersLoadedEvent struct {
	GuildID_ snowflake.ID `json:"guild_id"`
	Chapters []Chapter    `json:"chapters"`
}

func (ChaptersLoadedEvent) GuildID

func (e ChaptersLoadedEvent) GuildID() snowflake.ID

func (ChaptersLoadedEvent) Op

func (ChaptersLoadedEvent) Type

type Plugin

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

func New

func New() *Plugin

func NewWithLogger

func NewWithLogger(logger *slog.Logger) *Plugin

func (*Plugin) EventPlugins

func (p *Plugin) EventPlugins() []disgolink.EventPlugin

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Version

func (p *Plugin) Version() string

type Segment

type Segment struct {
	Category SegmentCategory   `json:"category"`
	Start    lavalink.Duration `json:"start"`
	End      lavalink.Duration `json:"end"`
}

type SegmentCategory

type SegmentCategory string

func GetCategories

func GetCategories(client disgolink.RestClient, sessionID string, guildID snowflake.ID) ([]SegmentCategory, error)

GetCategories gets the categories to skip for the guild.

type SegmentEventListener

type SegmentEventListener interface {
	OnSegmentsLoaded(player disgolink.Player, event SegmentsLoadedEvent)
	OnSegmentSkipped(player disgolink.Player, event SegmentSkippedEvent)
}

type SegmentSkippedEvent

type SegmentSkippedEvent struct {
	GuildID_ snowflake.ID `json:"guild_id"`
	Segment  Segment      `json:"segment"`
}

func (SegmentSkippedEvent) GuildID

func (e SegmentSkippedEvent) GuildID() snowflake.ID

func (SegmentSkippedEvent) Op

func (SegmentSkippedEvent) Type

type SegmentsLoadedEvent

type SegmentsLoadedEvent struct {
	GuildID_ snowflake.ID `json:"guild_id"`
	Segments []Segment    `json:"segments"`
}

func (SegmentsLoadedEvent) GuildID

func (e SegmentsLoadedEvent) GuildID() snowflake.ID

func (SegmentsLoadedEvent) Op

func (SegmentsLoadedEvent) Type

Jump to

Keyboard shortcuts

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