🪲 Fix double sending of discord webhook for listing

Took 6 minutes
This commit is contained in:
Kiran Hart 2023-03-31 15:39:10 -04:00
parent f4f1c942b0
commit 1cb0a8d112
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3

View File

@ -55,27 +55,27 @@ public class AuctionListeners implements Listener {
if (Settings.DISCORD_ENABLED.getBoolean()) {
if (Settings.DISCORD_ALERT_ON_AUCTION_START.getBoolean())
AuctionHouse.newChain().async(() -> {
Settings.DISCORD_WEBHOOKS.getStringList().forEach(hook -> {
AuctionHouse.newChain().async(() -> {
Settings.DISCORD_WEBHOOKS.getStringList().forEach(hook -> {
final boolean isBid = e.getAuctionItem().isBidItem();
if (isBid && Settings.DISCORD_ALERT_ON_AUCTION_START.getBoolean())
DiscordMessageCreator
.of(hook, DiscordMessageCreator.MessageType.NEW_AUCTION_LISTING)
.seller(seller)
.listing(auctionedItem)
.send();
});
}).execute();
if (Settings.DISCORD_ALERT_ON_BIN_START.getBoolean())
AuctionHouse.newChain().async(() -> {
Settings.DISCORD_WEBHOOKS.getStringList().forEach(hook -> {
if (!isBid && Settings.DISCORD_ALERT_ON_BIN_START.getBoolean())
DiscordMessageCreator
.of(hook, DiscordMessageCreator.MessageType.NEW_BIN_LISTING)
.seller(seller)
.listing(auctionedItem)
.send();
});
}).execute();
});
}).execute();
}
}