Ejemplo n.º 1
0
        public async Task Save()
        {
            string configFilename = "config.json";

            Config.Save(configFilename);

            await DiscordUtilities.ReplySuccessAsync(Context.Channel, string.Format("Successfully saved config to **{0}**.", configFilename));
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public async Task ReplySuccessAsync(string message) => await DiscordUtilities.ReplySuccessAsync(Context.Channel, message);