diff --git a/bot/slashcmd.go b/bot/slashcmd.go index a0fb312..fb2a14e 100644 --- a/bot/slashcmd.go +++ b/bot/slashcmd.go @@ -230,6 +230,11 @@ func (b *Bot) getSlashCommands() []*discordgo.ApplicationCommand { func (b *Bot) RegisterSlashCommands() error { ll := b.Log.With().Str("context", "bot.RegisterSlashCommands").Logger() + // We need a valid state and user + if b.Session.State == nil || b.Session.State.User == nil { + return fmt.Errorf("no valid session state or user. Required itents might be missing from discord token") + } + // Get a list of currently registered slash commands rcl, err := b.Session.ApplicationCommands(b.Session.State.User.ID, "") if err != nil { diff --git a/bot/version.go b/bot/version.go index 0a67788..56ee7c1 100644 --- a/bot/version.go +++ b/bot/version.go @@ -1,3 +1,3 @@ package bot -const Version = "0.2.5" +const Version = "0.2.6"