Class PinsUpdateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.channel.ChannelEvent
-
- discord4j.core.event.domain.channel.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:
- Channel Pins Update
-
-
Constructor Summary
Constructors Constructor Description PinsUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long channelId, Long guildId, Instant lastPinTimestamp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<MessageChannel>
getChannel()
Requests to retrieve theMessageChannel
the pinned/unpinnedMessage
is in.Snowflake
getChannelId()
Mono<Guild>
getGuild()
Optional<Snowflake>
getGuildId()
Optional<Instant>
getLastPinTimestamp()
Gets the ISO8601 timestamp of when the last pinnedMessage
w as pinned, if present.String
toString()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Method Detail
-
getChannelId
public Snowflake getChannelId()
- Returns:
- the ID of the
MessageChannel
involved.
-
getChannel
public Mono<MessageChannel> getChannel()
Requests to retrieve theMessageChannel
the pinned/unpinnedMessage
is in.- Returns:
- A
Mono
where, upon successful completion, emits theMessageChannel
involved. If an error is received, it is emitted through theMono
.
-
getGuildId
public Optional<Snowflake> getGuildId()
Gets theSnowflake
ID of theGuild
the pinned/unpinnedMessage
is in, if this happened in a guild. This may not be available if theMessage
is in a private channel.- Returns:
- The ID of the
Guild
involved, if present.
-
getLastPinTimestamp
public Optional<Instant> getLastPinTimestamp()
Gets the ISO8601 timestamp of when the last pinnedMessage
w as pinned, if present. This is NOT the timestamp of when theMessage
was created.- Returns:
- The timestamp of the when the last pinned
Message
was pinned, if present.
-
-