Class NewsChannelUpdateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.channel.ChannelEvent
-
- discord4j.core.event.domain.channel.NewsChannelUpdateEvent
-
public class NewsChannelUpdateEvent extends ChannelEvent
Dispatched when aNewsChannel
is updated in a guild.The
NewsChannel
may have been turned into aTextChannel
.The old news channel may not be present if news channels are not stored.
This event is dispatched by Discord.
- See Also:
- Channel Update
-
-
Constructor Summary
Constructors Constructor Description NewsChannelUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, GuildMessageChannel current, NewsChannel old)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GuildMessageChannel
getCurrent()
Gets the current, new version of theNewsChannel
that was updated in this event.Optional<NewsChannel>
getNewsChannel()
Gets the current, new version of theNewsChannel
that was updated in this event as an optional value of aNewsChannel
.Optional<NewsChannel>
getOld()
Gets the old version of theNewsChannel
that was updated in this event, if present.Optional<TextChannel>
getTextChannel()
Gets the current, new version of theNewsChannel
that was updated in this event as an optional value of aTextChannel
.String
toString()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
NewsChannelUpdateEvent
public NewsChannelUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, GuildMessageChannel current, @Nullable NewsChannel old)
-
-
Method Detail
-
getCurrent
public GuildMessageChannel getCurrent()
Gets the current, new version of theNewsChannel
that was updated in this event. TheNewsChannel
may have been turned into aTextChannel
.- Returns:
- The current version of the updated
NewsChannel
.
-
getNewsChannel
public Optional<NewsChannel> getNewsChannel()
Gets the current, new version of theNewsChannel
that was updated in this event as an optional value of aNewsChannel
.- Returns:
- An optional value of a
NewsChannel
. Empty if the channel was changed to aTextChannel
.
-
getTextChannel
public Optional<TextChannel> getTextChannel()
Gets the current, new version of theNewsChannel
that was updated in this event as an optional value of aTextChannel
.- Returns:
- An optional value of a
TextChannel
. Empty if the channel continued to be aNewsChannel
.
-
getOld
public Optional<NewsChannel> getOld()
Gets the old version of theNewsChannel
that was updated in this event, if present. This may not be available ifNewsChannels
are not stored.- Returns:
- The old version of the updated
NewsChannel
, if present.
-
-