Class PinsUpdateEvent


public class PinsUpdateEvent extends ChannelEvent
Dispatched when a message is pinned or unpinned in a message channel.

This event is dispatched by Discord.

See Also:
  • Constructor Details

  • Method Details

    • getChannelId

      public Snowflake getChannelId()
      Gets the Snowflake ID of the MessageChannel the pinned/unpinned Message is in.
      Returns:
      the ID of the MessageChannel involved.
    • getChannel

      public Mono<MessageChannel> getChannel()
      Requests to retrieve the MessageChannel the pinned/unpinned Message is in.
      Returns:
      A Mono where, upon successful completion, emits the MessageChannel involved. If an error is received, it is emitted through the Mono.
    • getGuildId

      public Optional<Snowflake> getGuildId()
      Gets the Snowflake ID of the Guild the pinned/unpinned Message is in, if this happened in a guild. This may not be available if the Message is in a private channel.
      Returns:
      The ID of the Guild involved, if present.
    • getGuild

      public Mono<Guild> getGuild()
      Requests to retrieve the Guild the pinned/unpinned Message is in, if this happened in a guild. This may not be available if the Message is in a private channel.
      Returns:
      A Mono where, upon successful completion, emits the Guild containing the Message involved, if present. If an error is received, it is emitted through the Mono.
    • getLastPinTimestamp

      public Optional<Instant> getLastPinTimestamp()
      Gets the ISO8601 timestamp of when the last pinned Message w as pinned, if present. This is NOT the timestamp of when the Message was created.
      Returns:
      The timestamp of the when the last pinned Message was pinned, if present.
    • toString

      public String toString()
      Overrides:
      toString in class Object