Skip to content

Commit

Permalink
Merge pull request #31 from wneessen/fix/30-segfault-intents
Browse files Browse the repository at this point in the history
v0.2.6: Fixes #30
  • Loading branch information
wneessen authored Nov 24, 2022
2 parents 7445f43 + 22e5108 commit 50b4369
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bot/slashcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion bot/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package bot

const Version = "0.2.5"
const Version = "0.2.6"

0 comments on commit 50b4369

Please sign in to comment.