Skip to content

Commit 9e9dfb4

Browse files
authored
Merge branch 'discord-jda:master' into master
2 parents 8efc87d + c61887b commit 9e9dfb4

84 files changed

Lines changed: 1966 additions & 574 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ plugins {
4242

4343

4444
val javaVersion = JavaVersion.current()
45-
val versionObj = Version(major = "5", minor = "4", revision = "0", classifier = null)
45+
val versionObj = Version(major = "5", minor = "5", revision = "1", classifier = null)
4646
val isGithubAction = System.getProperty("GITHUB_ACTION") != null || System.getenv("GITHUB_ACTION") != null
4747
val isCI = System.getProperty("BUILD_NUMBER") != null // jenkins
4848
|| System.getenv("BUILD_NUMBER") != null
@@ -359,9 +359,15 @@ val build by tasks.getting(Task::class) {
359359

360360
val test by tasks.getting(Test::class) {
361361
useJUnitPlatform()
362-
failFast = true
362+
failFast = false
363363
}
364364

365+
val updateTestSnapshots by tasks.registering(Test::class) {
366+
useJUnitPlatform()
367+
failFast = false
368+
369+
systemProperty("updateSnapshots", "true")
370+
}
365371

366372
////////////////////////////////////
367373
// //

src/main/java/net/dv8tion/jda/api/JDA.java

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package net.dv8tion.jda.api;
1818

1919
import net.dv8tion.jda.annotations.Incubating;
20+
import net.dv8tion.jda.annotations.ReplaceWith;
2021
import net.dv8tion.jda.api.entities.*;
2122
import net.dv8tion.jda.api.entities.channel.Channel;
2223
import net.dv8tion.jda.api.entities.channel.attribute.IGuildChannelContainer;
@@ -820,10 +821,17 @@ default CommandCreateAction upsertCommand(@Nonnull String name, @Nonnull String
820821
* If the provided id is not a valid snowflake
821822
*
822823
* @return {@link CommandEditAction} used to edit the command
824+
*
825+
* @deprecated Use {@link #editCommandById(Command.Type, String)} instead
823826
*/
824827
@Nonnull
825828
@CheckReturnValue
826-
CommandEditAction editCommandById(@Nonnull String id);
829+
@Deprecated
830+
@ReplaceWith("editCommandById(Command.Type, id)")
831+
default CommandEditAction editCommandById(@Nonnull String id)
832+
{
833+
return editCommandById(Command.Type.SLASH, id);
834+
}
827835

828836
/**
829837
* Edit an existing global command by id.
@@ -835,14 +843,61 @@ default CommandCreateAction upsertCommand(@Nonnull String name, @Nonnull String
835843
* The id of the command to edit
836844
*
837845
* @return {@link CommandEditAction} used to edit the command
846+
*
847+
* @deprecated Use {@link #editCommandById(Command.Type, long)} instead
838848
*/
839849
@Nonnull
840850
@CheckReturnValue
851+
@Deprecated
852+
@ReplaceWith("editCommandById(Command.Type, id)")
841853
default CommandEditAction editCommandById(long id)
842854
{
843855
return editCommandById(Long.toUnsignedString(id));
844856
}
845857

858+
/**
859+
* Edit an existing global command by id.
860+
*
861+
* <p>If there is no command with the provided ID,
862+
* this RestAction fails with {@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_COMMAND ErrorResponse.UNKNOWN_COMMAND}
863+
*
864+
* @param type
865+
* The command type
866+
* @param id
867+
* The id of the command to edit
868+
*
869+
* @throws IllegalArgumentException
870+
* If the provided id is not a valid snowflake or the type is {@link Command.Type#UNKNOWN}
871+
*
872+
* @return {@link CommandEditAction} used to edit the command
873+
*/
874+
@Nonnull
875+
@CheckReturnValue
876+
CommandEditAction editCommandById(@Nonnull Command.Type type, @Nonnull String id);
877+
878+
/**
879+
* Edit an existing global command by id.
880+
*
881+
* <p>If there is no command with the provided ID,
882+
* this RestAction fails with {@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_COMMAND ErrorResponse.UNKNOWN_COMMAND}
883+
*
884+
* @param type
885+
* The command type
886+
* @param id
887+
* The id of the command to edit
888+
*
889+
* @throws IllegalArgumentException
890+
* If the type is {@link Command.Type#UNKNOWN}
891+
*
892+
* @return {@link CommandEditAction} used to edit the command
893+
*/
894+
@Nonnull
895+
@CheckReturnValue
896+
default CommandEditAction editCommandById(@Nonnull Command.Type type, long id)
897+
{
898+
return editCommandById(type, Long.toUnsignedString(id));
899+
}
900+
846901
/**
847902
* Delete the global command for this id.
848903
*

0 commit comments

Comments
 (0)