Class TextChannelUpdateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.channel.ChannelEvent
-
- discord4j.core.event.domain.channel.TextChannelUpdateEvent
-
public class TextChannelUpdateEvent extends ChannelEvent
Dispatched when aTextChannelis updated in a guild.The
TextChannelmay have been turned into aNewsChannel.The old text channel may not be present if channels are not stored.
This event is dispatched by Discord.
- See Also:
- Channel Update
-
-
Constructor Summary
Constructors Constructor Description TextChannelUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, GuildMessageChannel current, TextChannel old)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GuildMessageChannelgetCurrent()Gets the current, new version of theTextChannelthat was updated in this event.Optional<NewsChannel>getNewsChannel()Gets the current, new version of theTextChannelthat was updated in this event as an optional value of aNewsChannel.Optional<TextChannel>getOld()Gets the old version of theTextChannelthat was updated in this event, if present.Optional<TextChannel>getTextChannel()Gets the current, new version of theTextChannelthat 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
-
TextChannelUpdateEvent
public TextChannelUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, GuildMessageChannel current, @Nullable TextChannel old)
-
-
Method Detail
-
getCurrent
public GuildMessageChannel getCurrent()
Gets the current, new version of theTextChannelthat was updated in this event. TheTextChannelmay have been turned into aNewsChannel.- Returns:
- The current version of the updated
TextChannel.
-
getNewsChannel
public Optional<NewsChannel> getNewsChannel()
Gets the current, new version of theTextChannelthat was updated in this event as an optional value of aNewsChannel.- Returns:
- An optional value of a
NewsChannel. Empty if the channel continued to be aTextChannel.
-
getTextChannel
public Optional<TextChannel> getTextChannel()
Gets the current, new version of theTextChannelthat was updated in this event as an optional value of aTextChannel.- Returns:
- An optional value of a
TextChannel. Empty if the channel was changed to aNewsChannel.
-
getOld
public Optional<TextChannel> getOld()
Gets the old version of theTextChannelthat was updated in this event, if present. This may not be available ifTextChannelsare not stored.- Returns:
- The old version of the updated
TextChannel, if present.
-
-