26 lines
507 B
Go
26 lines
507 B
Go
package discord
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"github.com/disgoorg/disgo"
|
|
"github.com/disgoorg/disgo/bot"
|
|
"github.com/disgoorg/disgo/cache"
|
|
"github.com/disgoorg/disgo/gateway"
|
|
)
|
|
|
|
func NewClient(token string, logger *slog.Logger) (*bot.Client, error) {
|
|
return disgo.New(token,
|
|
bot.WithLogger(logger),
|
|
bot.WithGatewayConfigOpts(
|
|
gateway.WithIntents(
|
|
gateway.IntentGuilds,
|
|
gateway.IntentGuildVoiceStates,
|
|
),
|
|
),
|
|
bot.WithCacheConfigOpts(
|
|
cache.WithCaches(cache.FlagVoiceStates),
|
|
),
|
|
)
|
|
}
|