Skip to content

Commit

Permalink
Add link to wiki in discordbot.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Oct 20, 2021
1 parent b91eeaa commit f8503f0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions MCGalaxy/Modules/Relay/Discord/DiscordPlugin.cs
Expand Up @@ -51,20 +51,26 @@ public sealed class DiscordConfig
[ConfigInt("embed-color", null, 9758051)]
public int EmbedColor = 9758051;

const string file = "properties/discordbot.properties";
const string PROPS_PATH = "properties/discordbot.properties";
static ConfigElement[] cfg;

public void Load() {
// create default config file
if (!File.Exists(file)) Save();
if (!File.Exists(PROPS_PATH)) Save();

if (cfg == null) cfg = ConfigElement.GetAll(typeof(DiscordConfig));
ConfigElement.ParseFile(cfg, file, this);
ConfigElement.ParseFile(cfg, PROPS_PATH, this);
}

public void Save() {
if (cfg == null) cfg = ConfigElement.GetAll(typeof(DiscordConfig));
ConfigElement.SerialiseSimple(cfg, file, this);

using (StreamWriter w = new StreamWriter(PROPS_PATH)) {
w.WriteLine("# Discord relay bot configuration file");
w.WriteLine("# See " + Updater.SourceURL + "/wiki/Discord-relay-bot/");
w.WriteLine();
ConfigElement.SerialiseElements(cfg, w, this);
}
}
}

Expand Down

0 comments on commit f8503f0

Please sign in to comment.