Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MinnDevelopment committed Jun 28, 2022
1 parent 4fc8c35 commit 70bbed5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/examples/java/SlashBotExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void main(String[] args) throws LoginException
.addEventListeners(new SlashBotExample())
.build();

// These commands take up to an hour to be activated after creation/update/delete
// These commands might take a few minutes to be active after creation/update/delete
CommandListUpdateAction commands = jda.updateCommands();

// Moderation commands with required options
Expand Down
31 changes: 8 additions & 23 deletions src/main/java/net/dv8tion/jda/api/JDA.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,6 @@ default RestAction<Command> retrieveCommandById(long id)
*
* <p>You need the OAuth2 scope {@code "applications.commands"} in order to add commands to a guild.
*
* <p><b>Global commands can take up to <u>1 hour</u> to propagate to the clients.</b>
* For testing, it is recommended to use a test guild with guild commands.
*
* @param command
* The {@link CommandData} for the command
*
Expand Down Expand Up @@ -580,9 +577,6 @@ default RestAction<Command> retrieveCommandById(long id)
*
* <p>You need the OAuth2 scope {@code "applications.commands"} in order to add commands to a guild.
*
* <p><b>Global commands can take up to <u>1 hour</u> to propagate to the clients.</b>
* For testing, it is recommended to use a test guild with guild commands.
*
* @param name
* The lowercase alphanumeric (with dash) name, 1-32 characters
* @param description
Expand Down Expand Up @@ -611,18 +605,21 @@ default CommandCreateAction upsertCommand(@Nonnull String name, @Nonnull String
*
* <p>You need the OAuth2 scope {@code "applications.commands"} in order to add commands to a guild.
*
* <p><b>Global commands can take up to <u>1 hour</u> to propagate to the clients.</b>
* For testing, it is recommended to use a test guild with guild commands.
* <p><b>Examples</b>
*
* <h4>Examples</h4>
* <p>Set list to 2 commands:
* <pre>{@code
* // Set list to 2 commands
* jda.updateCommands()
* .addCommands(Commands.slash("ping", "Gives the current ping"))
* .addCommands(Commands.slash("ban", "Ban the target user")
* .setGuildOnly(true)
* .setDefaultPermissions(DefaultMemberPermissions.enabledFor(Permission.BAN_MEMBERS))
* .addOption(OptionType.USER, "user", "The user to ban", true))
* .queue();
* // Delete all commands
* }</pre>
*
* <p>Delete all commands:
* <pre>{@code
* jda.updateCommands().queue();
* }</pre>
*
Expand All @@ -640,9 +637,6 @@ default CommandCreateAction upsertCommand(@Nonnull String name, @Nonnull String
* <p>If there is no command with the provided ID,
* this RestAction fails with {@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_COMMAND ErrorResponse.UNKNOWN_COMMAND}
*
* <p><b>Global commands can take up to <u>1 hour</u> to propagate to the clients.</b>
* For testing, it is recommended to use a test guild with guild commands.
*
* @param id
* The id of the command to edit
*
Expand All @@ -661,9 +655,6 @@ default CommandCreateAction upsertCommand(@Nonnull String name, @Nonnull String
* <p>If there is no command with the provided ID,
* this RestAction fails with {@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_COMMAND ErrorResponse.UNKNOWN_COMMAND}
*
* <p><b>Global commands can take up to <u>1 hour</u> to propagate to the clients.</b>
* For testing, it is recommended to use a test guild with guild commands.
*
* @param id
* The id of the command to edit
*
Expand All @@ -682,9 +673,6 @@ default CommandEditAction editCommandById(long id)
* <p>If there is no command with the provided ID,
* this RestAction fails with {@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_COMMAND ErrorResponse.UNKNOWN_COMMAND}
*
* <p><b>Global commands can take up to <u>1 hour</u> to propagate to the clients.</b>
* For testing, it is recommended to use a test guild with guild commands.
*
* @param commandId
* The id of the command that should be deleted
*
Expand All @@ -703,9 +691,6 @@ default CommandEditAction editCommandById(long id)
* <p>If there is no command with the provided ID,
* this RestAction fails with {@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_COMMAND ErrorResponse.UNKNOWN_COMMAND}
*
* <p><b>Global commands can take up to <u>1 hour</u> to propagate to the clients.</b>
* For testing, it is recommended to use a test guild with guild commands.
*
* @param commandId
* The id of the command that should be deleted
*
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/net/dv8tion/jda/api/entities/Guild.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,20 @@ default CommandCreateAction upsertCommand(@Nonnull String name, @Nonnull String
*
* <p>You need the OAuth2 scope {@code "applications.commands"} in order to add commands to a guild.
*
* <h4>Examples</h4>
* <p><b>Examples</b>
*
* <p>Set list to 2 commands:
* <pre>{@code
* // Set list to 2 commands
* guild.updateCommands()
* .addCommands(Commands.slash("ping", "Gives the current ping"))
* .addCommands(Commands.slash("ban", "Ban the target user")
* .addOption(OptionType.USER, "user", "The user to ban", true))
* .setDefaultPermissions(DefaultMemberPermissions.enabledFor(Permission.BAN_MEMBERS))
* .queue();
* // Delete all commands
* }</pre>
*
* <p>Delete all commands:
* <pre>{@code
* guild.updateCommands().queue();
* }</pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public interface Command extends ISnowflake
{
/**
* Delete this command.
* <br>If this is a global command it may take up to 1 hour to vanish from all clients.
*
* @throws IllegalStateException
* If this command is not owned by this bot
Expand Down

0 comments on commit 70bbed5

Please sign in to comment.