Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
    • Best Sellers

    • Latest Products

    • Featured

    • Topics

    • Posts

      • Ty I wasnt gonna share the other classes I utilize for the other shit but this ones worthy of sharing.
      • @Hashtag How can we proceed with this? Thanks!!
      • The easiest and only webhook class youll EVER need in your life!   package org.dreambot.utilities; import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.Random; import static org.dreambot.api.utilities.Logger.log; public class Webhooks { private static final String WEBHOOK_URL = "YOUR WEBHOOK HERE, CHANGE THIS"; public static void sendToWebhook(String title, String playerName, String amount, String totalCoin, String imageUrl) { if (playerName == null || playerName.isEmpty()) { log("PlayerName is invalid: " + playerName); return; } if (amount == null || amount.isEmpty()) { log("Amount is invalid: " + amount); return; } if (totalCoin == null || totalCoin.isEmpty()) { log("TotalCoin is invalid: " + totalCoin); return; } if (imageUrl == null || imageUrl.isEmpty()) { log("Image URL is invalid: " + imageUrl); return; } Random random = new Random(); int color = random.nextInt(0xFFFFFF + 1); String jsonPayload = String.format("{\n" + " \"content\": \"_ _\",\n" + " \"embeds\": [\n" + " {\n" + " \"title\": \"%s\",\n" + " \"description\": \"\",\n" + " \"fields\": [\n" + " {\n" + " \"name\": \"Player Name\",\n" + " \"value\": \"%s\"\n" + " },\n" + " {\n" + " \"name\": \"Amount\",\n" + " \"value\": \"%s\"\n" + " },\n" + " {\n" + " \"name\": \"Total Coin\",\n" + " \"value\": \"%s\"\n" + " }\n" + " ],\n" + " \"color\": %d,\n" + " \"image\": {\n" + " \"url\": \"%s\"\n" + " }\n" + " }\n" + " ],\n" + " \"attachments\": []\n" + "}", title, playerName, amount, totalCoin, color, imageUrl); try { int code = getCode(jsonPayload); log("Response code: " + code); } catch (Exception e) { log("Error while sending webhook: " + e.getMessage()); } } private static int getCode(String jsonPayload) throws IOException { URL url = new URL(WEBHOOK_URL); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("User-Agent", "Java-DiscordWebhook-Bot"); connection.setRequestProperty("Content-Type", "application/json; utf-8"); connection.setRequestProperty("Accept", "application/json"); connection.setDoOutput(true); try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonPayload.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } return connection.getResponseCode(); } } With this class, you can utilize the method for webhooking in an extremely simple way Webhook example: sendToWebhook("TITLE GOES HERE", "", "", "", ""); To simplify the webhook image you can make a global variable for this. I personally use TreeBranchFramework so I put the image in my API. https://discordjs.guide/popular-topics/embeds.html#using-the-embed-constructor This is a useful documentation on discords embed system. This is json, NOT embedbuilder. NO you cannot mention inside the embed. You must modify this to do so(I wont do it for you). Just change the names annd values to correspond with your project. Fields name will be bold, value will not be. Hope this helps anyone needing webhooks in their scripts! Here is an example image of what my mule looks like with this. This is a modified version of something @DumbRat691 sent me. 
      • Hello everyone! A new version of DreamBot is now live! Changes: Fixed issue with Script Scheduler Added AccountManager#getAccountTOTPKey Always remember, to be on the latest version of our client you must run DBLauncher.jar! The client does NOT update itself! Thanks, The Dream Team
    • Popular Contributors

    • Feedback Statistics

      • Positive
        11386
      • Neutral
        18
      • Negative
        144
      • Total Positive
        99%
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.