tweaks
This commit is contained in:
22
internal/discord/bot.go
Normal file
22
internal/discord/bot.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package discord
|
||||
|
||||
import (
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type BotSession struct {
|
||||
*discordgo.Session
|
||||
}
|
||||
|
||||
func newBotSession(cfg *Config) (*BotSession, error) {
|
||||
session, err := discordgo.New("Bot " + cfg.BotToken)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "discordgo.New")
|
||||
}
|
||||
return &BotSession{Session: session}, nil
|
||||
}
|
||||
|
||||
func (api *APIClient) Bot() *BotSession {
|
||||
return api.bot
|
||||
}
|
||||
Reference in New Issue
Block a user