]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/util/ErrorUtils.java
Add submitRateLimitChallenge command
[signal-cli] / src / main / java / org / asamk / signal / util / ErrorUtils.java
index 39e32198a06dfa3b93c005cfec6d4ed2eb30173f..e245492588f751ef82d2b967f44c6b5bb955f0cc 100644 (file)
@@ -67,7 +67,17 @@ public class ErrorUtils {
         } else if (result.getProofRequiredFailure() != null) {
             final var failure = result.getProofRequiredFailure();
             return String.format(
-                    "CAPTCHA proof required for sending to \"%s\", available options \"%s\" with token \"%s\", or wait \"%d\" seconds",
+                    "CAPTCHA proof required for sending to \"%s\", available options \"%s\" with challenge token \"%s\", or wait \"%d\" seconds.\n"
+                            + (
+                            failure.getOptions().contains(ProofRequiredException.Option.RECAPTCHA)
+                                    ?
+                                    "To get the captcha token, go to https://signalcaptchas.org/registration/generate.html\n"
+                                            + "Check the developer tools (F12) console for a failed redirect to signalcaptcha://\n"
+                                            + "Everything after signalcaptcha:// is the captcha token.\n"
+                                            + "Use the following command to submit the captcha token:\n"
+                                            + "signal-cli submitRateLimitChallenge --challenge CHALLENGE_TOKEN --captcha CAPTCHA_TOKEN"
+                                    : ""
+                    ),
                     identifier,
                     failure.getOptions()
                             .stream()