Skip to content

Commit

Permalink
Merge pull request #66 from niwaniwa/bugfix/nsfw-button
Browse files Browse the repository at this point in the history
fix: nsfw button
  • Loading branch information
niwaniwa authored Jul 22, 2023
2 parents 72083e5 + 159b55e commit 9d1cfec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions component.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ func nsfwComponent() {
},
})
emoji.IsSensitive = true
ProcessRequest(emoji, s, i.ChannelID)
emoji.RequestState = "Nsfw"
emoji.ResponseState = "Nsfw"
ProcessNextRequest(emoji, s, i.ChannelID)

},
)
Expand All @@ -187,7 +189,6 @@ func nsfwComponent() {
"name": emoji.Name,
}).Error(err)
return

}

if emoji.IsRequested {
Expand All @@ -210,7 +211,9 @@ func nsfwComponent() {
})

emoji.IsSensitive = false
ProcessRequest(emoji, s, i.ChannelID)
emoji.RequestState = "Nsfw"
emoji.ResponseState = "Nsfw"
ProcessNextRequest(emoji, s, i.ChannelID)

},
)
Expand Down
2 changes: 1 addition & 1 deletion request-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func init() {
}
}

func ProcessRequest(emoji *Emoji, s *discordgo.Session, id string) bool {
func ProcessNextRequest(emoji *Emoji, s *discordgo.Session, id string) bool {
requestIndex := reverseWorkflowMap[emoji.RequestState]
logger.WithFields(logrus.Fields{
"emoji id": emoji.ID,
Expand Down

0 comments on commit 9d1cfec

Please sign in to comment.