Skip to content

Commit

Permalink
pong discord several times
Browse files Browse the repository at this point in the history
Signed-off-by: Maartje Eyskens <[email protected]>
  • Loading branch information
meyskens committed Sep 4, 2021
1 parent 54b180a commit 3594210
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file added edward
Binary file not shown.
11 changes: 11 additions & 0 deletions pkg/commands/members/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ L:
}

func (m *MemberCommands) handleRolePermissionResponse(s *discordgo.Session, i *discordgo.InteractionCreate) {
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponsePong,
})
data := strings.Split(i.MessageComponentData().CustomID, "--")
if len(data) < 4 {
return // not valid ID
Expand Down Expand Up @@ -297,6 +300,10 @@ func (m *MemberCommands) handleRolePermissionResponse(s *discordgo.Session, i *d
return
}

s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponsePong,
})

// remove default role
if conf.RoleManagement.DefaultRole != "" {
s.GuildMemberRoleRemove(i.GuildID, userID, conf.RoleManagement.DefaultRole)
Expand All @@ -319,6 +326,10 @@ func (m *MemberCommands) handleRolePermissionResponse(s *discordgo.Session, i *d
}
}

s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponsePong,
})

err = s.GuildMemberRoleAdd(i.GuildID, userID, roleID)
if err != nil {
err2 := s.InteractionRespond(i.Interaction,
Expand Down

0 comments on commit 3594210

Please sign in to comment.