Skip to content

Commit

Permalink
feat: メッセージリアクションを取る処理をちょっと変えてみる (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored Nov 4, 2023
1 parent 6e7708f commit 58e8a82
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/features/meeting-vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,16 +559,13 @@ class VoteReaction {
message: Message,
excludeBot = false
): Promise<Collection<string, User>> {
if (message.partial) {
message = await message.fetch()
}
const reactions = message.reactions.cache.find(
(reaction) => reaction.emoji.name === this.unicode
)
if (!reactions) {
message = await message.fetch()

const reaction = message.reactions.resolve(this.unicode)
if (!reaction) {
return new Collection<string, User>()
}
const users = await reactions.users.fetch()
const users = await reaction.users.fetch()
return excludeBot ? users.filter((user: User) => !user.bot) : users
}

Expand Down

0 comments on commit 58e8a82

Please sign in to comment.