mirror of
https://github.com/Xevion/banner.git
synced 2025-12-14 22:11:04 -06:00
docs: add trivial documentation for all types, functions, packages etc.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Package bot provides the core functionality for the Discord bot.
|
||||
package bot
|
||||
|
||||
import (
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// Bot represents the state of the Discord bot.
|
||||
type Bot struct {
|
||||
Session *discordgo.Session
|
||||
API *api.API
|
||||
@@ -17,14 +19,17 @@ type Bot struct {
|
||||
isClosing bool
|
||||
}
|
||||
|
||||
// New creates a new Bot instance.
|
||||
func New(s *discordgo.Session, a *api.API, c *config.Config) *Bot {
|
||||
return &Bot{Session: s, API: a, Config: c}
|
||||
}
|
||||
|
||||
// SetClosing marks the bot as closing, preventing new commands from being processed.
|
||||
func (b *Bot) SetClosing() {
|
||||
b.isClosing = true
|
||||
}
|
||||
|
||||
// GetSession ensures a valid session is available and selects the default term.
|
||||
func (b *Bot) GetSession() (string, error) {
|
||||
sessionID := b.API.EnsureSession()
|
||||
term := api.Default(time.Now()).ToString()
|
||||
|
||||
Reference in New Issue
Block a user