cmd

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportChannelName  = "support-tickets"
	SupportChannelTopic = "Support tickets & suggestions"
)

Support channel constants

Functions

func ConfigureSupportChannel

func ConfigureSupportChannel(ctx context.Context, b *Bot, guilds ...snowflake.ID) error

func GetSupportChannel

func GetSupportChannel(b *Bot, guildID *snowflake.ID) (snowflake.ID, error)

GetSupportChannel retrieves the ID of the support channel with the specified name in the given guild. Returns the channel ID if found, otherwise returns 0 and an error if an issue occurs or the channel does not exist.

func PostHelpMessage

func PostHelpMessage(b *Bot, c *snowflake.ID, data templates.HelpData, e *handler.CommandEvent) error

PostHelpMessage sends a message with the given content to a specified Discord channel using the provided bot instance.

Types

type Bot

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

func New

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

func (*Bot) OnJoin

func (b *Bot) OnJoin(e *events.GuildJoin)

func (*Bot) OnReady

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

func (*Bot) SetupBot

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

type BotConfig

type BotConfig struct {
	DevGuilds []snowflake.ID `toml:"dev_guilds"`
	Token     string         `toml:"token"`
	Name      string         `toml:"name"`
}

type Config

type Config struct {
	Log LogConfig `toml:"log"`
	Bot BotConfig `toml:"bot"`
}

func LoadConfig

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

type LogConfig

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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