Ejemplo n.º 1
0
        public async Task <RuntimeResult> ConfigPrefixAsync(string prefix)
        {
            var record = await CoreRepository.GetOrCreateGuildSettingsAsync(Context.Guild).ConfigureAwait(false);

            record.CommandPrefix = prefix;
            await CoreRepository.SaveRepositoryAsync().ConfigureAwait(false);

            return(CommandRuntimeResult.FromSuccess($"Successfully changed prefix to {Format.Bold(prefix)}."));
        }
Ejemplo n.º 2
0
        public async Task <RuntimeResult> ModeratorPermsSetAsync([Remainder] GuildPermission guildPermission)
        {
            var record = await CoreRepository.GetOrCreateGuildSettingsAsync(Context.Guild).ConfigureAwait(false);

            record.ModeratorPermission = guildPermission;
            await CoreRepository.SaveRepositoryAsync().ConfigureAwait(false);

            return(CommandRuntimeResult.FromSuccess(
                       $"Successfully changed the required moderator permission to {Format.Bold(guildPermission.Humanize(LetterCasing.Title))}."));
        }
Ejemplo n.º 3
0
        public async Task <RuntimeResult> ToggleGfycatAsync(bool?shouldEnable = null)
        {
            var record = await CoreRepository.GetOrCreateGuildSettingsAsync(Context.Guild).ConfigureAwait(false);

            string result;

            switch (shouldEnable ?? !record.IsGfyCatEnabled)
            {
            case true:
                record.IsGfyCatEnabled = true;
                result = "Auto gfycat conversion has been **enabled**.";
                break;

            default:
                record.IsGfyCatEnabled = false;
                result = "Auto gfycat conversion has been **disabled**.";
                break;
            }
            await CoreRepository.SaveRepositoryAsync().ConfigureAwait(false);

            return(CommandRuntimeResult.FromSuccess(result));
        }