public GlobalConfiguration(string discordToken, string tasteToken, JsonConfiguration jsonConfig) { if (string.IsNullOrWhiteSpace(discordToken)) { throw new ArgumentNullException(nameof(discordToken)); } if (string.IsNullOrWhiteSpace(tasteToken)) { throw new ArgumentNullException(nameof(tasteToken)); } Coins = jsonConfig.Coins; CommandPrefix = jsonConfig.CommandPrefix; DiscordToken = discordToken; PayPalUrl = jsonConfig.PayPal; TasteToken = tasteToken; TestCommandPrefix = jsonConfig.TestCommandPrefix; AwardsChannelID = jsonConfig.AwardsChannelID; AwardCoinAmount = jsonConfig.AwardCoinAmount; PinCoinAmount = jsonConfig.PinCoinAmount; }
public Startup(string discordToken, string tasteToken) { JsonConfiguration jsonConfig = JsonConvert.DeserializeObject <JsonConfiguration>(File.ReadAllText("config.json")); Configuration = new GlobalConfiguration(discordToken, tasteToken, jsonConfig); }