Discord Java JDA - Tebex - Request.delete block and does not execute the code that follows the method

22 Views Asked by At

Here's my problem. I'm trying with a discord bot to interact with Tebex's REST API (an online payment provider for games) and the idea is that when my transaction is completed, I delete it so that it no longer appears and the person has received their product.

The problem is that at the end, when I want to delete the pending transactions, I debug to check if it's really the case, except that it isn't. The problem is that when I want to delete the pending transactions, I debug to check if it's really the case. My code after my request is not displayed and my transaction is still pending.


System.out.println("[Private Bot - Shop] Deleting transactions...");
Request.delete(DELETE_COMMANDS_ENDPOINT)
        .responseTimeout(Timeout.ofSeconds(5))
        .userAgent("Core/1.0")
        .addHeader("Accept", "application/json")
        .addHeader("X-Tebex-Secret", this.secret)
        .bodyForm(this.commands.stream()
                .map(id -> new BasicNameValuePair("ids[]", "" + id))
                .collect(Collectors.toList()), StandardCharsets.UTF_8)
        .execute();

System.out.println("[Private Bot - Shop] Deleted !");

I tried to see if it came from tebex, I read the documentation but nothing works.

0

There are 0 best solutions below