예제 #1
0
        public async Task SetupAsync(CommandContext ctx,
                                     [Description("desc-setup-chn")] DiscordChannel?channel = null)
        {
            channel ??= ctx.Channel;

            var gcfg = new GuildConfig();
            await channel.LocalizedEmbedAsync(this.Localization, "str-setup");

            await Task.Delay(TimeSpan.FromSeconds(10));

            await this.SetupPrefixAsync(gcfg, ctx, channel);

            await this.SetupLoggingAsync(gcfg, ctx, channel);

            await this.SetupBackupAsync(gcfg, ctx, channel);

            gcfg.ReactionResponse = await ctx.WaitForBoolReplyAsync("q-setup-verbose", channel, false);

            gcfg.SuggestionsEnabled = await ctx.WaitForBoolReplyAsync("q-setup-suggestions", channel, false);

            await this.SetupMemberUpdateMessagesAsync(gcfg, ctx, channel);

            await this.SetupMuteRoleAsync(gcfg, ctx, channel);

            await this.SetupLinkfilterAsync(gcfg, ctx, channel);

            await this.SetupAntispamAsync(gcfg, ctx, channel);

            await this.SetupAntiMentionAsync(gcfg, ctx, channel);

            await this.SetupRatelimitAsync(gcfg, ctx, channel);

            await this.SetupAntifloodAsync(gcfg, ctx, channel);

            await this.SetupAntiInstantLeaveAsync(gcfg, ctx, channel);

            await this.SetupCurrencyAsync(gcfg, ctx, channel);

            await channel.SendMessageAsync(embed : gcfg.ToDiscordEmbed(ctx.Guild, this.Localization));

            if (await ctx.WaitForBoolReplyAsync("q-setup-review", channel: channel))
            {
                await this.ApplySettingsAsync(ctx, gcfg);

                await channel.EmbedAsync(this.Localization.GetString(ctx.Guild.Id, "str-done"), Emojis.CheckMarkSuccess);
            }
            else
            {
                await channel.InformFailureAsync(this.Localization.GetString(ctx.Guild.Id, "str-aborting"));
            }
        }
예제 #2
0
        public async Task ExecuteGroupAsync(CommandContext ctx)
        {
            GuildConfig gcfg = await this.Service.GetConfigAsync(ctx.Guild.Id);

            await ctx.RespondAsync(embed : gcfg.ToDiscordEmbed(ctx.Guild, this.Localization));
        }