send now, all fixed

This commit is contained in:
NK 2023-02-20 13:08:06 +00:00
parent ac3dd01f06
commit 5d7f53ce68

View file

@ -118,11 +118,12 @@ public class AuctionHouse {
Matcher matcher = pattern.matcher(auction.getString("item_lore")); Matcher matcher = pattern.matcher(auction.getString("item_lore"));
String updated = matcher.replaceAll(""); String updated = matcher.replaceAll("");
System.out.println(updated); System.out.println(updated);
webhook.addEmbed( webhook.addEmbed(
new DiscordWebhook.EmbedObject() new DiscordWebhook.EmbedObject()
.setTitle("Item Is On Low Price") .setTitle("Item Is On Low Price")
.setAuthor("night0721", "https://github.com/night0721", "https://avatars.githubusercontent.com/u/77528305?v=4") .setAuthor("night0721", "https://github.com/night0721", "https://avatars.githubusercontent.com/u/77528305?v=4")
.setDescription(updated) .setDescription(updated.replace("\n", "\\n"))
.addField("Item", auction.getString("item_name"), true) .addField("Item", auction.getString("item_name"), true)
.addField("Price", format.format(auction.getInt("starting_bid")) + " coins", true) .addField("Price", format.format(auction.getInt("starting_bid")) + " coins", true)
.addField("Seller", profile.getJSONObject("player").getString("displayname"), true) .addField("Seller", profile.getJSONObject("player").getString("displayname"), true)
@ -131,7 +132,7 @@ public class AuctionHouse {
.setUrl("https://www.brandonfowler.me/skyblockah/?uuid=" + auction.getString("uuid")) .setUrl("https://www.brandonfowler.me/skyblockah/?uuid=" + auction.getString("uuid"))
.setColor(Color.decode("#003153")) .setColor(Color.decode("#003153"))
); );
webhook.setContent(auction.getString("item_name") + " is sale at " + format.format(auction.getInt("starting_bid")) + "!\n`" + "/viewauction " + auction.getString("uuid") + "`"); webhook.setContent(auction.getString("item_name") + " is sale at " + format.format(auction.getInt("starting_bid")) + "! `" + "/viewauction " + auction.getString("uuid") + "`");
new Thread(() -> { new Thread(() -> {
try { try {
webhook.execute(); webhook.execute();
@ -187,7 +188,7 @@ public class AuctionHouse {
public void toggleAuction() { public void toggleAuction() {
if (open) { if (open) {
Utils.sendMessage("Stopped Auction House"); Utils.sendMessage("Stopped Auction House");
thread.interrupt(); thread = null;
open = false; open = false;
} else { } else {
Utils.sendMessage("Started Auction House"); Utils.sendMessage("Started Auction House");