Beispiel #1
0
        public async Task ListExcludes(CommandContext ctx)
        {
            if (ctx.Member.GetRole().IsCHOrHigher())
            {
                await ctx.Channel.TriggerTypingAsync();

                // Cancels:

                if (BotSettings.GetExcludedChannelsCount == 0)
                {
                    await ctx.Channel.SendMessageAsync(
                        ChatObjects.GetNeutralMessage(@"There are no excluded channels..."));

                    return;
                }

                // DEB!
                DiscordEmbedBuilder deb = new DiscordEmbedBuilder
                {
                    Title = "Excluded Channels"
                };

                StringBuilder sb = new StringBuilder();

                // Write out every channel being excluded into a cute little list.
                foreach (DiscordChannel chan in await BotSettings.GetExcludedChannels())
                {
                    sb.AppendLine(chan.Mention);
                }

                deb.Description = sb.ToString();
                deb.WithColor(DiscordColor.LightGray);
                deb.WithThumbnailUrl(ChatObjects.URL_SPEECH_BUBBLE);

                await ctx.Channel.SendMessageAsync(embed : deb);
            }
        }