revbot.js
    Preparing search index...

    Class Mentions

    Represents the mentions in a message, including users and server members.

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    client: client

    The client instance.

    message: Message

    The message associated with the mentions.

    Accessors

    • get members(): null | Map<string, ServerMember>

      Retrieves the server members mentioned in the message.

      Returns null | Map<string, ServerMember>

      A map of user IDs to ServerMember instances, or null if the message is not in a server.

      const members = mentions.members;
      if (members) {
      members.forEach(member => console.log(member.displayName));
      }

    Methods

    • Checks if a specific user is mentioned in the message.

      Parameters

      Returns boolean

      true if the user is mentioned, otherwise false.

      Throws an error if the user cannot be resolved.

      if (mentions.has(someUser)) {
      console.log("User is mentioned!");
      }