Skip to content

Commit

Permalink
Add custom embed colors to config (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
versx authored Nov 28, 2020
1 parent 65bf368 commit a865b19
Show file tree
Hide file tree
Showing 9 changed files with 406 additions and 52 deletions.
90 changes: 88 additions & 2 deletions config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,50 @@
"iconStyle": "Default",
"botChannelIds": [],
"status": null,
"dmAlertsFile": "default.json"
"dmAlertsFile": "default.json",
"embedColors": {
"pokemon": {
"iv": [
{ "min": 0, "max": 0, "color": "#ffffff" },
{ "min": 1, "max": 89, "color": "#ffff00" },
{ "min": 90, "max": 99, "color": "#ffa500" },
{ "min": 100, "max": 100, "color": "#00ff00" }
],
"pvp": {
{ "min": 1, "max": 1, "color": "#000080" },
{ "min": 6, "max": 25, "color": "#800080" },
{ "min": 25, "max": 100, "color": "#aa2299" }
}
},
"raids": {
"1": "#ff69b4",
"2": "#ff69b4",
"3": "#ffff00",
"4": "#ffff00",
"5": "#800080",
"6": "#a52a2a",
"ex": "#2c2f33"
}
"pokestops": {
"quests": "#ffa500",
"lures": {
"normal": "#ff69b4",
"glacial": "#6495ed",
"mossy": "#507d2a",
"magnetic": "#808080"
},
"invasions": "#ff0000"
},
"weather": {
"clear": "#ffff00",
"cloudy": "#99aab5",
"fog": "#9a9a9a",
"partlyCloudy": "#808080",
"rain": "#0000ff",
"snow": "#ffffff",
"windy": "#800080"
}
}
},
"000000000000000002": {
"commandPrefix": ".",
Expand Down Expand Up @@ -77,7 +120,50 @@
"iconStyle": "Default",
"botChannelIds": [],
"status": "Test #2",
"dmAlertsFile": "default.json"
"dmAlertsFile": "default.json",
"embedColors": {
"pokemon": {
"iv": [
{ "min": 0, "max": 0, "color": "#ffffff" },
{ "min": 1, "max": 89, "color": "#ffff00" },
{ "min": 90, "max": 99, "color": "#ffa500" },
{ "min": 100, "max": 100, "color": "#00ff00" }
],
"pvp": {
{ "min": 1, "max": 1, "color": "#000080" },
{ "min": 6, "max": 25, "color": "#800080" },
{ "min": 25, "max": 100, "color": "#aa2299" }
}
},
"raids": {
"1": "#ff69b4",
"2": "#ff69b4",
"3": "#ffff00",
"4": "#ffff00",
"5": "#800080",
"6": "#a52a2a",
"ex": "#2c2f33"
}
"pokestops": {
"quests": "#ffa500",
"lures": {
"normal": "#ff69b4",
"glacial": "#6495ed",
"mossy": "#507d2a",
"magnetic": "#808080"
},
"invasions": "#ff0000"
},
"weather": {
"clear": "#ffff00",
"cloudy": "#99aab5",
"fog": "#9a9a9a",
"partlyCloudy": "#808080",
"rain": "#0000ff",
"snow": "#ffffff",
"windy": "#800080"
}
}
}
},
"database": {
Expand Down
207 changes: 207 additions & 0 deletions src/Configuration/DiscordEmbedColorConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
namespace WhMgr.Configuration
{
using System;
using System.Collections.Generic;

using Newtonsoft.Json;

public class DiscordEmbedColorConfig
{
[JsonProperty("pokemon")]
public DiscordEmbedColorPokemon Pokemon { get; set; }

[JsonProperty("raids")]
public DiscordEmbedColorRaids Raids { get; set; }

[JsonProperty("pokestops")]
public DiscordEmbedColorPokestop Pokestops { get; set; }

[JsonProperty("weather")]
public DiscordEmbedColorWeather Weather { get; set; }

public DiscordEmbedColorConfig()
{
Pokemon = new DiscordEmbedColorPokemon
{
IV = new List<DiscordEmbedColorPokemonIV>
{
new DiscordEmbedColorPokemonIV { Minimum = 0, Maximum = 0, Color = "#ffffff" },
new DiscordEmbedColorPokemonIV { Minimum = 1, Maximum = 89, Color = "#ffff00" },
new DiscordEmbedColorPokemonIV { Minimum = 90, Maximum = 99, Color = "#ffa500" },
new DiscordEmbedColorPokemonIV { Minimum = 100, Maximum = 100, Color = "#00ff00" },
},
PvP = new List<DiscordEmbedColorPokemonPvP>
{
new DiscordEmbedColorPokemonPvP { Minimum = 1, Maximum = 3, Color = "#000080" },
new DiscordEmbedColorPokemonPvP { Minimum = 4, Maximum = 25, Color = "#800080" },
new DiscordEmbedColorPokemonPvP { Minimum = 26, Maximum = 100, Color = "#aa2299" },
}
};
}
}

public class DiscordEmbedColorPokemon
{
[JsonProperty("iv")]
public List<DiscordEmbedColorPokemonIV> IV { get; set; }

[JsonProperty("pvp")]
public List<DiscordEmbedColorPokemonPvP> PvP { get; set; }

public DiscordEmbedColorPokemon()
{
IV = new List<DiscordEmbedColorPokemonIV>();
PvP = new List<DiscordEmbedColorPokemonPvP>();
}
}

public class DiscordEmbedColorPokemonIV
{
[JsonProperty("min")]
public int Minimum { get; set; }

[JsonProperty("max")]
public int Maximum { get; set; }

[JsonProperty("color")]
public string Color { get; set; }

public DiscordEmbedColorPokemonIV()
{
Minimum = 0;
Maximum = 100;
Color = "#ffffff";
}
}

public class DiscordEmbedColorPokemonPvP
{
[JsonProperty("min")]
public int Minimum { get; set; }

[JsonProperty("max")]
public int Maximum { get; set; }

[JsonProperty("color")]
public string Color { get; set; }

public DiscordEmbedColorPokemonPvP()
{
Minimum = 0;
Maximum = 100;
Color = "#aa2299";
}
}

public class DiscordEmbedColorRaids
{
[JsonProperty("1")]
public string Level1 { get; set; }

[JsonProperty("2")]
public string Level2 { get; set; }

[JsonProperty("3")]
public string Level3 { get; set; }

[JsonProperty("4")]
public string Level4 { get; set; }

[JsonProperty("5")]
public string Level5 { get; set; }

[JsonProperty("6")]
public string Level6 { get; set; }

[JsonProperty("ex")]
public string Ex { get; set; }

public DiscordEmbedColorRaids()
{
Level1 = "#ff69b4";
Level2 = "#ff69b4";
Level3 = "#ffff00";
Level4 = "#ffff00";
Level5 = "#800080";
Level6 = "#a52a2a";
Ex = "#2c2f33";
}
}

public class DiscordEmbedColorPokestop
{
[JsonProperty("quests")]
public string Quests { get; set; }

[JsonProperty("lures")]
public DiscordEmbedColorPokestopLures Lures { get; set; }

[JsonProperty("invasions")]
public string Invasions { get; set; }

public DiscordEmbedColorPokestop()
{
Quests = "#ffa500";
Lures = new DiscordEmbedColorPokestopLures();
Invasions = "#ff0000";
}
}

public class DiscordEmbedColorPokestopLures
{
[JsonProperty("normal")]
public string Normal { get; set; }

[JsonProperty("glacial")]
public string Glacial { get; set; }

[JsonProperty("mossy")]
public string Mossy { get; set; }

[JsonProperty("magnetic")]
public string Magnetic { get; set; }

public DiscordEmbedColorPokestopLures()
{
Normal = "#ff69b4";
Glacial = "#6495ed";
Mossy = "#507d2a";
Magnetic = "#808080";
}
}

public class DiscordEmbedColorWeather
{
[JsonProperty("clear")]
public string Clear { get; set; }

[JsonProperty("cloudy")]
public string Cloudy { get; set; }

[JsonProperty("fog")]
public string Fog { get; set; }

[JsonProperty("partlyCloudy")]
public string PartlyCloudy { get; set; }

[JsonProperty("rain")]
public string Rain { get; set; }

[JsonProperty("snow")]
public string Snow { get; set; }

[JsonProperty("windy")]
public string Windy { get; set; }

public DiscordEmbedColorWeather()
{
Clear = "#ffff00";
Cloudy = "#99aab5";
Fog = "#9a9a9a";
PartlyCloudy = "#808080";
Rain = "#0000ff";
Snow = "#ffffff";
Windy = "#800080";
}
}
}
4 changes: 4 additions & 0 deletions src/Configuration/DiscordServerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ public class DiscordServerConfig
[JsonProperty("dmAlertsFile")]
public string DmAlertsFile { get; set; }

[JsonProperty("embedColors")]
public DiscordEmbedColorConfig DiscordEmbedColors { get; set; }

[JsonIgnore]
public AlertMessage DmAlerts { get; set; }

Expand All @@ -153,6 +156,7 @@ public DiscordServerConfig()
Subscriptions = new SubscriptionsConfig();
NestsMinimumPerHour = 1;
DmAlertsFile = "default.json";
DiscordEmbedColors = new DiscordEmbedColorConfig();

LoadDmAlerts();
}
Expand Down
Loading

0 comments on commit a865b19

Please sign in to comment.