public async Task Save() { string configFilename = "config.json"; Config.Save(configFilename); await DiscordUtilities.ReplySuccessAsync(Context.Channel, string.Format("Successfully saved config to **{0}**.", configFilename)); }
public virtual async Task RestartAsync(IMessageChannel channel = null) { restartChannel = channel; if (restartChannel != null) { restartMessage = await DiscordUtilities.ReplySuccessAsync(restartChannel, $"Restarting {Name.ToBold()}..."); } await StopAsync(); await StartAsync(); }
public async Task Set(string key, string value) { if (Config.SetProperty(key, value)) { await DiscordUtilities.ReplySuccessAsync(Context.Channel, string.Format("Successfully set **{0}** to **{1}**.", key, value)); } else { await DiscordUtilities.ReplyErrorAsync(Context.Channel, string.Format("No setting with the name **{0}** exists.", key)); } // Reload commands (the commands available are dependent on configuration settings). await CommandService.InstallCommandsAsync(); // Update the bot's "Playing" status. await DiscordClient.SetGameAsync(Config.Playing); }
public async Task ReplySuccessAsync(string message) => await DiscordUtilities.ReplySuccessAsync(Context.Channel, message);