Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic slowmode channel manager to slowmode channel interface #2348

Merged
merged 3 commits into from Dec 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -16,8 +16,13 @@

package net.dv8tion.jda.api.entities.channel.attribute;

import net.dv8tion.jda.api.entities.channel.ChannelField;
import net.dv8tion.jda.api.managers.channel.ChannelManager;
import net.dv8tion.jda.api.managers.channel.attribute.ISlowmodeChannelManager;
import net.dv8tion.jda.api.entities.channel.middleman.GuildChannel;

import javax.annotation.Nonnull;

/**
* Channels which support slowmode.
*/
Expand Down Expand Up @@ -45,4 +50,22 @@ public interface ISlowmodeChannel extends GuildChannel
* @return The slowmode for this channel, between 1 and {@value #MAX_SLOWMODE}, or {@code 0} if no slowmode is set.
*/
int getSlowmode();

/**
* Returns the {@link ISlowmodeChannelManager} for this {@link ISlowmodeChannel slow mode channel}.
* <br>With the provided ChannelManager, you can additionally modify the {@link ChannelField#SLOWMODE}
* compared to a guild channel's {@link ChannelManager}.
* You modify multiple fields in one request by chaining setters before calling {@link net.dv8tion.jda.api.requests.RestAction#queue() RestAction.queue()}.
*
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If the currently logged in account does not have {@link net.dv8tion.jda.api.Permission#MANAGE_CHANNEL Permission.MANAGE_CHANNEL}
*
* @return The {@link ISlowmodeChannelManager} of this {@link ISlowmodeChannel}
*
* @see ChannelManager ChannelManager, for modifying fields each guild channel provides
* @see ChannelField ChannelField, for all possible channel fields
*/
@Nonnull
@Override
ISlowmodeChannelManager<?, ?> getManager();
}