lavalinkbot

package
v0.0.0-...-19f2381 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadThings

func ReadThings(things embed.FS) (map[string]Thing, error)

Types

type Bot

type Bot struct {
	Cfg        Config
	Client     bot.Client
	Maven      *maven.Maven
	Lavalink   disgolink.Client
	GitHub     *github.Client
	MusicQueue *PlayerManager
	Webhooks   map[string]webhook.Client
	Things     map[string]Thing
}

func (*Bot) Start

func (b *Bot) Start() error

func (*Bot) Stop

func (b *Bot) Stop()

type BotConfig

type BotConfig struct {
	Token    string         `yaml:"token"`
	GuildIDs []snowflake.ID `yaml:"guild_ids"`
}

func (BotConfig) String

func (c BotConfig) String() string

type Config

type Config struct {
	Log     LogConfig     `yaml:"log"`
	Bot     BotConfig     `yaml:"bot"`
	GitHub  GitHubConfig  `yaml:"github"`
	Nodes   NodeConfigs   `yaml:"nodes"`
	Plugins PluginConfigs `yaml:"plugins"`
}

func ReadConfig

func ReadConfig(path string) (Config, error)

func (Config) String

func (c Config) String() string

type GitHubConfig

type GitHubConfig struct {
	ServerAddr    string                         `yaml:"server_addr"`
	WebhookSecret string                         `yaml:"webhook_secret"`
	Releases      map[string]GithubReleaseConfig `yaml:"releases"`
}

func (GitHubConfig) String

func (c GitHubConfig) String() string

type GithubReleaseConfig

type GithubReleaseConfig struct {
	WebhookID    snowflake.ID `yaml:"webhook_id"`
	WebhookToken string       `yaml:"webhook_token"`
	PingRole     snowflake.ID `yaml:"ping_role"`
}

func (GithubReleaseConfig) String

func (c GithubReleaseConfig) String() string

type LogConfig

type LogConfig struct {
	Level     slog.Level `yaml:"level"`
	Format    string     `yaml:"format"`
	AddSource bool       `yaml:"add_source"`
	NoColor   bool       `yaml:"no_color"`
}

func (LogConfig) String

func (c LogConfig) String() string

type NodeConfig

type NodeConfig struct {
	Name      string `yaml:"name"`
	Address   string `yaml:"address"`
	Password  string `yaml:"password"`
	Secure    bool   `yaml:"secure"`
	SessionID string `yaml:"session_id"`
}

func (NodeConfig) String

func (c NodeConfig) String() string

func (NodeConfig) ToNodeConfig

func (c NodeConfig) ToNodeConfig() disgolink.NodeConfig

type NodeConfigs

type NodeConfigs []NodeConfig

func (NodeConfigs) String

func (c NodeConfigs) String() string

type PlayerManager

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

func NewPlayerManager

func NewPlayerManager() *PlayerManager

func (*PlayerManager) Add

func (q *PlayerManager) Add(guildID snowflake.ID, channelID snowflake.ID, tracks ...lavalink.Track)

func (*PlayerManager) ChannelID

func (q *PlayerManager) ChannelID(guildID snowflake.ID) snowflake.ID

func (*PlayerManager) Clear

func (q *PlayerManager) Clear(guildID snowflake.ID)

func (*PlayerManager) Delete

func (q *PlayerManager) Delete(guildID snowflake.ID)

func (*PlayerManager) Get

func (q *PlayerManager) Get(guildID snowflake.ID) (RepeatMode, []lavalink.Track)

func (*PlayerManager) Next

func (q *PlayerManager) Next(guildID snowflake.ID) (lavalink.Track, bool)

func (*PlayerManager) Remove

func (q *PlayerManager) Remove(guildID snowflake.ID, from int, to int)

func (*PlayerManager) SetRepeatMode

func (q *PlayerManager) SetRepeatMode(guildID snowflake.ID, mode RepeatMode)

func (*PlayerManager) Shuffle

func (q *PlayerManager) Shuffle(guildID snowflake.ID) bool

type PluginConfig

type PluginConfig struct {
	Name       string `yaml:"name"`
	Dependency string `yaml:"dependency"`
	Repository string `yaml:"repository"`
	Git        string `yaml:"git"`
}

func (PluginConfig) String

func (c PluginConfig) String() string

type PluginConfigs

type PluginConfigs []PluginConfig

func (PluginConfigs) String

func (c PluginConfigs) String() string

type RepeatMode

type RepeatMode string
const (
	RepeatModeNone  RepeatMode = "none"
	RepeatModeTrack RepeatMode = "track"
	RepeatModeQueue RepeatMode = "queue"
)

type Thing

type Thing struct {
	Name     string
	FileName string
	Content  string
	Files    []ThingFile
}

type ThingFile

type ThingFile struct {
	Name string
	Buf  []byte
}

func (ThingFile) Reader

func (t ThingFile) Reader() io.Reader

Jump to

Keyboard shortcuts

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