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 aNewsChannelis updated in a guild.The
NewsChannelmay 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 GuildMessageChannelgetCurrent()Gets the current, new version of theNewsChannelthat was updated in this event.Optional<NewsChannel>getNewsChannel()Gets the current, new version of theNewsChannelthat was updated in this event as an optional value of aNewsChannel.Optional<NewsChannel>getOld()Gets the old version of theNewsChannelthat was updated in this event, if present.Optional<TextChannel>getTextChannel()Gets the current, new version of theNewsChannelthat was updated in this event as an optional value of aTextChannel.StringtoString()-
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 theNewsChannelthat was updated in this event. TheNewsChannelmay have been turned into aTextChannel.- Returns:
- The current version of the updated
NewsChannel.
-
getNewsChannel
public Optional<NewsChannel> getNewsChannel()
Gets the current, new version of theNewsChannelthat 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 theNewsChannelthat 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 theNewsChannelthat was updated in this event, if present. This may not be available ifNewsChannelsare not stored.- Returns:
- The old version of the updated
NewsChannel, if present.
-
-