ttsbot

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Cfg       Config
	Client    bot.Client
	Paginator *paginator.Manager
	Version   string
	Commit    string
}

func New

func New(cfg Config, version string, commit string) *Bot

func (*Bot) OnReady

func (b *Bot) OnReady(_ *events.Ready)

func (*Bot) SetupBot

func (b *Bot) SetupBot(listeners ...bot.EventListener) error

type BotConfig

type BotConfig struct {
	DevGuilds        []snowflake.ID `mapstructure:"dev_guilds"`
	Token            string         `mapstructure:"token"`
	Language         string         `mapstructure:"default_lang"`
	FallbackPresetID string         `mapstructure:"fallback_preset_id"`
}

type Config

type Config struct {
	Log      LogConfig               `mapstructure:"log"`
	Bot      BotConfig               `mapstructure:"bot"`
	Presets  map[string]PresetConfig `mapstructure:"presets"`
	Database DatabaseConfig          `mapstructure:"database"`
	Redis    RedisConfig             `mapstructure:"redis"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Driver string `mapstructure:"driver"`
	Dsn    string `mapstructure:"dsn"`
}

type LogConfig

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

type PresetConfig

type PresetConfig struct {
	Engine       string  `mapstructure:"engine"`
	Language     string  `mapstructure:"language"`
	VoiceName    string  `mapstructure:"voice_name"`
	SpeakingRate float64 `mapstructure:"speaking_rate"`
}

type RedisConfig

type RedisConfig struct {
	Enabled bool          `mapstructure:"enable"` // Note: changed from 'enabled' to 'enable' to match config.example.toml
	Url     string        `mapstructure:"url"`
	TTL     time.Duration `mapstructure:"ttl"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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