Skip to content

Commit

Permalink
try id after name for reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
lfayoux committed Jan 2, 2021
1 parent 56c8c1c commit cc44d9e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,18 @@ func (w *Widget) Spawn() error {
continue
}

if v, ok := w.Handlers[reaction.Emoji.Name]; ok {
v, ok := w.Handlers[reaction.Emoji.Name]
if ok {
if w.isUserAllowed(reaction.UserID) {
go v(w, reaction)
}
} else { //try reaction ID
v, ok = w.Handlers[reaction.Emoji.ID]
if ok {
if w.isUserAllowed(reaction.UserID) {
go v(w, reaction)
}
}
}

if w.DeleteReactions {
Expand Down

0 comments on commit cc44d9e

Please sign in to comment.