Class NewsChannel
java.lang.Object
discord4j.core.object.entity.channel.NewsChannel
- All Implemented Interfaces:
DiscordObject
,CategorizableChannel
,Channel
,GuildChannel
,GuildMessageChannel
,MessageChannel
,TopLevelGuildChannel
,TopLevelGuildMessageChannel
,Entity
A Discord news channel.
-
Nested Class Summary
Nested classes/interfaces inherited from interface discord4j.core.object.entity.channel.Channel
Channel.Type
-
Constructor Summary
ConstructorDescriptionNewsChannel
(GatewayDiscordClient gateway, discord4j.discordjson.json.ChannelData data) Constructs anNewsChannel
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptiondiscord4j.core.spec.NewsChannelEditMono
edit()
Requests to edit this news channel.edit
(discord4j.core.spec.NewsChannelEditSpec spec) Requests to edit this news channel.edit
(Consumer<? super LegacyNewsChannelEditSpec> spec) Deprecated.final boolean
Requests to follow this news channel.final GatewayDiscordClient
Returns theGatewayDiscordClient
that created this object.final discord4j.discordjson.json.ChannelData
getData()
Gets the raw data as represented by Discord.getEffectivePermissions
(Snowflake memberId) Gets the permissions for the given member, taking into account permission overwrites in this channel.getEffectivePermissions
(Member member) Gets the permissions for the given member, taking into account permission overwrites in this channel.final RestChannel
Return aRestChannel
handle to execute REST API operations on this entity.final int
hashCode()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface discord4j.core.object.entity.channel.CategorizableChannel
createInvite, createInvite, createInvite, getCategory, getCategory, getCategoryId, getInvites
Methods inherited from interface discord4j.core.object.entity.channel.Channel
delete, delete, getData, getId, getMention, getRestChannel, getType
Methods inherited from interface discord4j.core.object.DiscordObject
getClient
Methods inherited from interface discord4j.core.object.entity.channel.GuildChannel
getEffectivePermissions, getEffectivePermissions, getGuild, getGuild, getGuildId, getName
Methods inherited from interface discord4j.core.object.entity.channel.GuildMessageChannel
bulkDelete, bulkDeleteMessages, getMembers
Methods inherited from interface discord4j.core.object.entity.channel.MessageChannel
createEmbed, createEmbed, createMessage, createMessage, createMessage, createMessage, getLastMessage, getLastMessage, getLastMessageId, getLastPinTimestamp, getMessageById, getMessageById, getMessagesAfter, getMessagesBefore, getPinnedMessages, type, typeUntil
Methods inherited from interface discord4j.core.object.entity.channel.TopLevelGuildChannel
addMemberOverwrite, addMemberOverwrite, addRoleOverwrite, addRoleOverwrite, getOverwriteForMember, getOverwriteForRole, getPermissionOverwrites, getPosition, getRawPosition
Methods inherited from interface discord4j.core.object.entity.channel.TopLevelGuildMessageChannel
createWebhook, createWebhook, createWebhook, getJoinedPrivateArchivedThreads, getPrivateArchivedThreads, getPublicArchivedThreads, getTopic, getWebhooks, startThread
-
Constructor Details
-
NewsChannel
Constructs anNewsChannel
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Details
-
edit
Deprecated.useedit(NewsChannelEditSpec)
oredit()
which offer an immutable approach to build specsRequests to edit this news channel.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyNewsChannelEditSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the editedNewsChannel
. If an error is received, it is emitted through theMono
.
-
edit
public discord4j.core.spec.NewsChannelEditMono edit()Requests to edit this news channel. Properties specifying how to edit this news channel can be set via thewithXxx
methods of the returnedNewsChannelEditMono
.- Returns:
- A
NewsChannelEditMono
where, upon successful completion, emits the editedNewsChannel
. If an error is received, it is emitted through theNewsChannelEditMono
.
-
edit
Requests to edit this news channel.- Parameters:
spec
- an immutable object that specifies how to edit this news channel- Returns:
- A
Mono
where, upon successful completion, emits the editedNewsChannel
. If an error is received, it is emitted through theMono
.
-
follow
Requests to follow this news channel. Following will create a webhook in the channel which ID is specified. Requires 'MANAGE_WEBHOOKS' permission.- Parameters:
targetChannelId
- the ID of the channel where to create the follow webhook- Returns:
- a
FollowedChannel
object containing a reference to this news channel and allowing to retrieve the webhook created.
-
toString
-
getEffectivePermissions
Description copied from interface:GuildChannel
Gets the permissions for the given member, taking into account permission overwrites in this channel.- Specified by:
getEffectivePermissions
in interfaceGuildChannel
- Parameters:
memberId
- The ID of the member to get permissions for.- Returns:
- The permissions for the given member.
-
getEffectivePermissions
Description copied from interface:GuildChannel
Gets the permissions for the given member, taking into account permission overwrites in this channel.- Specified by:
getEffectivePermissions
in interfaceGuildChannel
- Parameters:
member
- The member to get permissions for.- Returns:
- The permissions for the given member.
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getRestChannel
Description copied from interface:Channel
Return aRestChannel
handle to execute REST API operations on this entity.- Specified by:
getRestChannel
in interfaceChannel
-
getData
public final discord4j.discordjson.json.ChannelData getData()Description copied from interface:Channel
Gets the raw data as represented by Discord. -
equals
-
hashCode
public final int hashCode()
-
edit(NewsChannelEditSpec)
oredit()
which offer an immutable approach to build specs