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 aTextChannel
is updated in a guild.The
TextChannel
may 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 GuildMessageChannel
getCurrent()
Gets the current, new version of theTextChannel
that was updated in this event.Optional<NewsChannel>
getNewsChannel()
Gets the current, new version of theTextChannel
that was updated in this event as an optional value of aNewsChannel
.Optional<TextChannel>
getOld()
Gets the old version of theTextChannel
that was updated in this event, if present.Optional<TextChannel>
getTextChannel()
Gets the current, new version of theTextChannel
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
-
TextChannelUpdateEvent
public TextChannelUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, GuildMessageChannel current, @Nullable TextChannel old)
-
-
Method Detail
-
getCurrent
public GuildMessageChannel getCurrent()
Gets the current, new version of theTextChannel
that was updated in this event. TheTextChannel
may have been turned into aNewsChannel
.- Returns:
- The current version of the updated
TextChannel
.
-
getNewsChannel
public Optional<NewsChannel> getNewsChannel()
Gets the current, new version of theTextChannel
that 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 theTextChannel
that 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 theTextChannel
that was updated in this event, if present. This may not be available ifTextChannels
are not stored.- Returns:
- The old version of the updated
TextChannel
, if present.
-
-