public class MemberAction extends RestAction<java.lang.Void>
RestAction extension
specifically designed to allow bots to add Users to Guilds.
guilds.join to work!RestAction.EmptyRestAction<T>DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG| Constructor | Description |
|---|---|
MemberAction(JDA api,
Guild guild,
java.lang.String userId,
java.lang.String accessToken) |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getAccessToken() |
The access token
|
Guild |
getGuild() |
The
Guild to which the
user will be added. |
User |
getUser() |
The user associated with the id
|
java.lang.String |
getUserId() |
The id of the user who will be added by this task
|
MemberAction |
setDeafen(boolean deaf) |
Whether the user should be voice deafened in the guild.
|
MemberAction |
setMute(boolean mute) |
Whether the user should be voice muted in the guild.
|
MemberAction |
setNickname(java.lang.String nick) |
Sets the nickname of the user for the guild.
|
MemberAction |
setRoles(java.util.Collection<Role> roles) |
Sets the roles of the user for the guild.
|
MemberAction |
setRoles(Role... roles) |
Sets the roles of the user for the guild.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomplete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setCheck, setPassContext, submit, submit, submitAfter, submitAfter@Nonnull public java.lang.String getAccessToken()
@Nonnull public java.lang.String getUserId()
@Nullable public User getUser()
@Nonnull public Guild getGuild()
Guild to which the
user will be added.@CheckReturnValue public MemberAction setNickname(java.lang.String nick)
Member.getNickname().nick - The nickname, or nulljava.lang.IllegalArgumentException - If the provided nickname is longer than 32 characters@CheckReturnValue public MemberAction setRoles(java.util.Collection<Role> roles)
Member.getRoles().roles - The roles, or nulljava.lang.IllegalArgumentException - If one of the provided roles is null or not from the same guild@CheckReturnValue public MemberAction setRoles(Role... roles)
Member.getRoles().roles - The roles, or nulljava.lang.IllegalArgumentException - If one of the provided roles is null or not from the same guild@CheckReturnValue public MemberAction setMute(boolean mute)
falsemute - Whether the user should be voice muted in the guild.@CheckReturnValue public MemberAction setDeafen(boolean deaf)
falsedeaf - Whether the user should be voice deafened in the guild.