Skip to content

Commit

Permalink
feat: helper method for whether message mentions user
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Nov 28, 2023
1 parent 290fb97 commit 53dbec7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/classes/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ export class Message {
return this.#collection.getUnderlyingObject(this.id).mentionIds;
}

/**
* Whether this message mentions us
*/
get mentioned() {
return this.mentionIds?.includes(this.#collection.client.user!.id);
}

/**
* IDs of messages this message replies to
*/
Expand Down

0 comments on commit 53dbec7

Please sign in to comment.