revbot.js
    Preparing search index...

    Class NotesChannel

    Represents a notes channel, which is used for saving personal messages.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Creates a new NotesChannel instance.

      Parameters

      • client: client

        The client instance.

      • data: { _id: string; channel_type: "SavedMessages"; user: string }

        The raw data for the notes channel from the API.

        • _id: string

          Unique Id

        • channel_type: "SavedMessages"
        • user: string

          Id of the user this channel belongs to

      Returns NotesChannel

    Properties

    client: client

    The client instance.

    id: string

    The unique identifier for the object.

    lastMessageId: null | string = null

    The ID of the last message sent in this notes channel, if any.

    messages: MessageManager = ...

    Manages the messages in this notes channel.

    type: NOTES = ChannelTypes.NOTES

    The type of the channel, which is always NOTES for notes channels.

    userId: string

    The ID of the user associated with the notes channel.

    Accessors

    • get createdTimestamp(): number

      Gets the timestamp (in milliseconds) when the channel was created.

      Returns number

      The timestamp of the channel's creation.

    Methods

    • Updates the object with new data and returns a clone of the object.

      Parameters

      • data: PartialObject

        The data to update the object with.

      • Optionalclear: string[]

        Fields to clear in the object.

      Returns this

      A clone of the updated object.

    • Deletes the current channel instance from the client's channel collection.

      This method interacts with the client's channel management system to remove the channel. Once deleted, the channel will no longer be accessible through the client.

      Returns Promise<void>

      A promise that resolves when the channel has been successfully deleted.

      const channel = client.channels.get('1234567890');
      if (channel) {
      await channel.delete();
      console.log('Channel deleted successfully.');
      }