mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-01-08 12:57:35 +01:00
add options for sale,bid,listing colours for discord webhook
Took 3 minutes
This commit is contained in:
parent
12cad78f9b
commit
3288cf4d56
@ -256,7 +256,9 @@ public class AuctionAPI {
|
||||
hook.setUsername(Settings.DISCORD_MSG_USERNAME.getString());
|
||||
hook.setAvatarUrl(Settings.DISCORD_MSG_PFP.getString());
|
||||
|
||||
String[] possibleColours = Settings.DISCORD_MSG_DEFAULT_COLOUR.getString().split("-");
|
||||
String color = isBid ? Settings.DISCORD_MSG_DEFAULT_COLOUR_BID.getString() : isNew ? Settings.DISCORD_MSG_DEFAULT_COLOUR.getString() : Settings.DISCORD_MSG_DEFAULT_COLOUR_SALE.getString();
|
||||
|
||||
String[] possibleColours = color.split("-");
|
||||
Color colour = Settings.DISCORD_MSG_USE_RANDOM_COLOUR.getBoolean()
|
||||
? Color.getHSBColor(ThreadLocalRandom.current().nextFloat() * 360F, ThreadLocalRandom.current().nextFloat() * 101F, ThreadLocalRandom.current().nextFloat() * 101F)
|
||||
: Color.getHSBColor(Float.parseFloat(possibleColours[0]) / 360, Float.parseFloat(possibleColours[1]) / 100, Float.parseFloat(possibleColours[2]) / 100);
|
||||
@ -307,7 +309,7 @@ public class AuctionAPI {
|
||||
hook.setUsername(Settings.DISCORD_MSG_USERNAME.getString());
|
||||
hook.setAvatarUrl(Settings.DISCORD_MSG_PFP.getString());
|
||||
|
||||
String[] possibleColours = Settings.DISCORD_MSG_DEFAULT_COLOUR.getString().split("-");
|
||||
String[] possibleColours = Settings.DISCORD_MSG_DEFAULT_COLOUR_BID.getString().split("-");
|
||||
Color colour = Settings.DISCORD_MSG_USE_RANDOM_COLOUR.getBoolean()
|
||||
? Color.getHSBColor(ThreadLocalRandom.current().nextFloat() * 360F, ThreadLocalRandom.current().nextFloat() * 101F, ThreadLocalRandom.current().nextFloat() * 101F)
|
||||
: Color.getHSBColor(Float.parseFloat(possibleColours[0]) / 360, Float.parseFloat(possibleColours[1]) / 100, Float.parseFloat(possibleColours[2]) / 100);
|
||||
|
@ -250,6 +250,8 @@ public class Settings {
|
||||
public static final ConfigSetting DISCORD_MSG_PFP = new ConfigSetting(config, "discord.user.avatar picture", "https://cdn.kiranhart.com/spigot/auctionhouse/icon.png", "The avatar image of the discord user");
|
||||
public static final ConfigSetting DISCORD_MSG_USE_RANDOM_COLOUR = new ConfigSetting(config, "discord.msg.use random colour", true, "colour of the message bar");
|
||||
public static final ConfigSetting DISCORD_MSG_DEFAULT_COLOUR = new ConfigSetting(config, "discord.msg.default colour", "137-100-100", "The color of the embed, it needs to be in hsb format.", "Separate the numbers with a -");
|
||||
public static final ConfigSetting DISCORD_MSG_DEFAULT_COLOUR_BID = new ConfigSetting(config, "discord.msg.default colour bid", "137-100-100", "The color of the embed during a bid, it needs to be in hsb format.", "Separate the numbers with a -");
|
||||
public static final ConfigSetting DISCORD_MSG_DEFAULT_COLOUR_SALE = new ConfigSetting(config, "discord.msg.default colour sale", "137-100-100", "The color of the embed during a sale, it needs to be in hsb format.", "Separate the numbers with a -");
|
||||
public static final ConfigSetting DISCORD_MSG_START_TITLE = new ConfigSetting(config, "discord.msg.auction start title", "New Auction Available", "The title of the message when a new auction is made");
|
||||
public static final ConfigSetting DISCORD_MSG_FINISH_TITLE = new ConfigSetting(config, "discord.msg.auction finish title", "Auction Finished", "The title of the message when an auction finishes");
|
||||
public static final ConfigSetting DISCORD_MSG_BID_TITLE = new ConfigSetting(config, "discord.msg.auction bid title", "New Bid Placed", "The title of the message when a new bid is placed");
|
||||
|
Loading…
Reference in New Issue
Block a user