public class GuildAction extends RestAction<java.lang.Void>
RestAction
extension
specifically designed to allow for the creation of Guilds
.
Modifier and Type | Class | Description |
---|---|---|
static class |
GuildAction.ChannelData |
|
static class |
GuildAction.RoleData |
RestAction.EmptyRestAction<T>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
GuildAction(JDA api,
java.lang.String name) |
Modifier and Type | Method | Description |
---|---|---|
GuildAction |
addChannel(GuildAction.ChannelData channel) |
Adds a
Channel to the resulting
Guild. |
GuildAction.ChannelData |
getChannel(int index) |
Gets the
ChannelData
of the specified index. |
GuildAction.RoleData |
getPublicRole() |
Retrieves the
RoleData for the
public role (Guild.getPublicRole() ) for the resulting Guild. |
GuildAction.RoleData |
getRole(int index) |
Retrieves the
RoleData for the
provided index. |
GuildAction.ChannelData |
newChannel(ChannelType type,
java.lang.String name) |
Creates a new
ChannelData
instance and adds it to this GuildAction. |
GuildAction.RoleData |
newRole() |
Creates and add a new
RoleData object
representing a Role for the resulting Guild. |
GuildAction.ChannelData |
removeChannel(int index) |
Removes the
ChannelData
at the specified index and returns the removed object. |
GuildAction |
removeChannel(GuildAction.ChannelData data) |
Removes the provided
ChannelData
from this GuildAction if present. |
GuildAction |
setExplicitContentLevel(Guild.ExplicitContentLevel level) |
Sets the
ExplicitContentLevel
for the resulting Guild |
GuildAction |
setIcon(Icon icon) |
|
GuildAction |
setName(java.lang.String name) |
Sets the name for the resulting
Guild |
GuildAction |
setNotificationLevel(Guild.NotificationLevel level) |
Sets the
NotificationLevel
for the resulting Guild |
GuildAction |
setRegion(Region region) |
|
GuildAction |
setVerificationLevel(Guild.VerificationLevel level) |
Sets the
VerificationLevel
for the resulting Guild |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, complete, completeAfter, getJDA, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter
public GuildAction(JDA api, java.lang.String name)
@CheckReturnValue public GuildAction setRegion(Region region)
region
- The Region
to usejava.lang.IllegalArgumentException
- If the provided region is a VIP region as per Region.isVip()
@CheckReturnValue public GuildAction setIcon(Icon icon)
icon
- The Icon
to use@CheckReturnValue public GuildAction setName(java.lang.String name)
Guild
name
- The name to usejava.lang.IllegalArgumentException
- If the provided name is null
, blank or not between 2-100 characters long@CheckReturnValue public GuildAction setVerificationLevel(Guild.VerificationLevel level)
VerificationLevel
for the resulting Guild
level
- The VerificationLevel
to use@CheckReturnValue public GuildAction setNotificationLevel(Guild.NotificationLevel level)
NotificationLevel
for the resulting Guild
level
- The NotificationLevel
to use@CheckReturnValue public GuildAction setExplicitContentLevel(Guild.ExplicitContentLevel level)
ExplicitContentLevel
for the resulting Guild
level
- The ExplicitContentLevel
to use@CheckReturnValue public GuildAction addChannel(GuildAction.ChannelData channel)
channel
- The ChannelData
to use for the construction of the Channeljava.lang.IllegalArgumentException
- If the provided channel is null
!@CheckReturnValue public GuildAction.ChannelData getChannel(int index)
ChannelData
of the specified index. The index is 0 based on insertion order of addChannel(GuildAction.ChannelData)
!index
- The 0 based index of the channeljava.lang.IndexOutOfBoundsException
- If the provided index is not in bounds@CheckReturnValue public GuildAction.ChannelData removeChannel(int index)
ChannelData
at the specified index and returns the removed object.index
- The index of the channeljava.lang.IndexOutOfBoundsException
- If the index is out of bounds@CheckReturnValue public GuildAction removeChannel(GuildAction.ChannelData data)
ChannelData
from this GuildAction if present.data
- The ChannelData to remove@CheckReturnValue public GuildAction.ChannelData newChannel(ChannelType type, java.lang.String name)
ChannelData
instance and adds it to this GuildAction.type
- The ChannelType
of the resulting Channel
TEXT
or VOICE
!name
- The name of the channel. This must be alphanumeric with underscores for type TEXTjava.lang.IllegalArgumentException
- null
or blank@CheckReturnValue public GuildAction.RoleData getPublicRole()
RoleData
for the
public role (Guild.getPublicRole()
) for the resulting Guild.
@everyone
role.
You can only change the permissions of the public role!
@CheckReturnValue public GuildAction.RoleData getRole(int index)
RoleData
for the
provided index.
index
- The index of the rolejava.lang.IndexOutOfBoundsException
- If the provided index is out of bounds@CheckReturnValue public GuildAction.RoleData newRole()
RoleData
object
representing a Role for the resulting Guild.
This can be used in ChannelData.addPermissionOverride(...)
.
You may change any properties of this RoleData
instance!