-
-
Notifications
You must be signed in to change notification settings - Fork 724
/
Category.java
107 lines (100 loc) · 5.13 KB
/
Category.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package net.dv8tion.jda.core.entities;
import net.dv8tion.jda.core.requests.restaction.ChannelAction;
import javax.annotation.CheckReturnValue;
import java.util.List;
/**
* Represents a channel category in the official Discord API.
* <br>Categories are used to keep order in a Guild by dividing the channels into groups.
*
* @since 3.4.0
*/
public interface Category extends Channel, Comparable<Category>
{
/**
* All {@link net.dv8tion.jda.core.entities.Channel Channels} listed
* for this Category
* <br>This may contain both {@link net.dv8tion.jda.core.entities.VoiceChannel VoiceChannels}
* and {@link net.dv8tion.jda.core.entities.TextChannel TextChannels}!
*
* @return Immutable list of all child channels
*/
List<Channel> getChannels();
/**
* All {@link net.dv8tion.jda.core.entities.TextChannel TextChannels}
* listed for this Category
*
* @return Immutable list of all child TextChannels
*/
List<TextChannel> getTextChannels();
/**
* All {@link net.dv8tion.jda.core.entities.VoiceChannel VoiceChannels}
* listed for this Category
*
* @return Immutable list of all child VoiceChannels
*/
List<VoiceChannel> getVoiceChannels();
/**
* Creates a new {@link net.dv8tion.jda.core.entities.TextChannel TextChannel} with this Category as parent.
* For this to be successful, the logged in account has to have the
* {@link net.dv8tion.jda.core.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permission in the {@link net.dv8tion.jda.core.entities.Guild Guild}.
*
* <p>This will copy all {@link net.dv8tion.jda.core.entities.PermissionOverride PermissionOverrides} of this Category!
*
* <p>Possible {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} caused by
* the returned {@link net.dv8tion.jda.core.requests.RestAction RestAction} include the following:
* <ul>
* <li>{@link net.dv8tion.jda.core.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
* <br>The channel could not be created due to a permission discrepancy</li>
*
* <li>{@link net.dv8tion.jda.core.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
* <br>We were removed from the Guild before finishing the task</li>
* </ul>
*
* @param name
* The name of the TextChannel to create
*
* @throws net.dv8tion.jda.core.exceptions.InsufficientPermissionException
* If the logged in account does not have the {@link net.dv8tion.jda.core.Permission#MANAGE_CHANNEL} permission
* @throws net.dv8tion.jda.core.exceptions.GuildUnavailableException
* If the guild is temporarily not {@link net.dv8tion.jda.core.entities.Guild#isAvailable() available}
* @throws IllegalArgumentException
* If the provided name is {@code null} or less than 2 characters or greater than 100 characters in length
*
* @return A specific {@link net.dv8tion.jda.core.requests.restaction.ChannelAction ChannelAction}
* <br>This action allows to set fields for the new TextChannel before creating it
*/
@CheckReturnValue
ChannelAction createTextChannel(String name);
/**
* Creates a new {@link net.dv8tion.jda.core.entities.VoiceChannel VoiceChannel} with this Category as parent.
* For this to be successful, the logged in account has to have the
* {@link net.dv8tion.jda.core.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permission in the {@link net.dv8tion.jda.core.entities.Guild Guild}.
*
* <p>This will copy all {@link net.dv8tion.jda.core.entities.PermissionOverride PermissionOverrides} of this Category!
*
* <p>Possible {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} caused by
* the returned {@link net.dv8tion.jda.core.requests.RestAction RestAction} include the following:
* <ul>
* <li>{@link net.dv8tion.jda.core.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
* <br>The channel could not be created due to a permission discrepancy</li>
*
* <li>{@link net.dv8tion.jda.core.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
* <br>We were removed from the Guild before finishing the task</li>
* </ul>
*
* @param name
* The name of the VoiceChannel to create
*
* @throws net.dv8tion.jda.core.exceptions.InsufficientPermissionException
* If the logged in account does not have the {@link net.dv8tion.jda.core.Permission#MANAGE_CHANNEL} permission
* @throws net.dv8tion.jda.core.exceptions.GuildUnavailableException
* If the guild is temporarily not {@link net.dv8tion.jda.core.entities.Guild#isAvailable() available}
* @throws IllegalArgumentException
* If the provided name is {@code null} or less than 2 characters or greater than 100 characters in length
*
* @return A specific {@link net.dv8tion.jda.core.requests.restaction.ChannelAction ChannelAction}
* <br>This action allows to set fields for the new VoiceChannel before creating it
*/
@CheckReturnValue
ChannelAction createVoiceChannel(String name);
}