Skip to content

Commit

Permalink
Improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
freya022 committed Jun 29, 2024
1 parent 37d089a commit f0e296a
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ private Throwable handleUnknownInteraction(Response response, Request<?> request
// That's why we also have a similar exception at the end of this method.
if (exception.getErrorResponse() == ErrorResponse.INTERACTION_ALREADY_ACKNOWLEDGED)
return ErrorResponseException.create(
"This interaction was acknowledged by another bot instance\n" +
"Make sure that:\n" +
"\t- Only one bot using the current token is logged on\n" +
"\t- If you can't find an existing instance, try to reset your token at https://discord.com/developers/applications/" + getJDA().getSelfUser().getApplicationId() + "/bot",
"This interaction was acknowledged by another process running for the same bot.\n" +
"To resolve this, try stopping all current processes for the bot that could be responsible, or resetting your bot token.\n" +
"You can reset your token at https://discord.com/developers/applications/" + getJDA().getSelfUser().getApplicationId() + "/bot\n" +
"You can also find processes by using 'jps -l' in your terminal, find the one which matches your main class/jar, then kill the process using the PID on the left:\n" +
"\t- Windows: taskkill /F /PID <pid>\n" +
"\t- Linux/Mac: kill -9 <pid>",
exception
);

Expand All @@ -59,10 +61,13 @@ private Throwable handleUnknownInteraction(Response response, Request<?> request
return ErrorResponseException.create(
"Failed to acknowledge this interaction, this can be due to 2 reasons:\n" +
"1. This interaction took longer than 3 seconds to be acknowledged, see https://jda.wiki/using-jda/troubleshooting/#the-interaction-took-longer-than-3-seconds-to-be-acknowledged\n" +
"2. This interaction could have been acknowledged by another bot instance\n" +
"If your bot replied, or the three dots in a button disappeared without saying 'This interaction failed', or you see '[Bot] is thinking...' for more than 3 seconds, make sure that:\n" +
"\t- Only one bot using the current token is logged on\n" +
"\t- If you can't find an existing instance, try to reset your token at https://discord.com/developers/applications/" + getJDA().getSelfUser().getApplicationId() + "/bot",
"2. This interaction could have been acknowledged by another process running for the same bot\n" +
"You can confirm this by checking if your bot replied, or the three dots in a button disappeared without saying 'This interaction failed', or you see '[Bot] is thinking...' for more than 3 seconds.\n" +
"To resolve this, try stopping all current processes for the bot that could be responsible, or resetting your bot token.\n" +
"You can reset your token at https://discord.com/developers/applications/" + getJDA().getSelfUser().getApplicationId() + "/bot\n" +
"You can also find processes by using 'jps -l' in your terminal, find the one which matches your main class/jar, then kill the process using the PID on the left:\n" +
"\t- Windows: taskkill /F /PID <pid>\n" +
"\t- Linux/Mac: kill -9 <pid>",
exception
);

Expand Down

0 comments on commit f0e296a

Please sign in to comment.