Пример #1
0
        public async Task About()
        {
            var embed = await help.BuildAboutEmbedAsync(Context, AddAboutFields).ConfigureAwait(false);

            await ReplyAsync(embed : embed).ConfigureAwait(false);

            /*var embed = new EmbedBuilder {
             *      Color = ColorUtils.Parse(Config["embed_color"]),
             *      Title = Config["about_title"] ?? $"{Client.CurrentUser.Username}: About",
             * };
             * embed.WithThumbnailUrl(Client.CurrentUser.GetAvatarUrl());
             * StringBuilder str = new StringBuilder();
             * var links = Config.GetSection("about_links");
             * List<string> linkList = new List<string>();
             * if (links != null) {
             *      foreach (var child in links.GetChildren()) {
             *              string name = child["name"];
             *              string url = child["url"];
             *              if (!string.IsNullOrWhiteSpace(name) && !string.IsNullOrWhiteSpace(url)) {
             *                      linkList.Add($"[{name}]({url})");
             *              }
             *      }
             * }
             * if (linkList.Count != 0)
             *      embed.Description = string.Join(" | ", linkList);
             * if (Config["about_description"] != null)
             *      embed.AddField("About", Config["about_description"]);
             *
             * string prefix = await Contexting.GetPrefixAsync(Context).ConfigureAwait(false);
             * embed.AddField("Prefix", $"The command prefix is `{prefix}`");// is present on **{Client.Guilds.Count}** servers!");
             *
             * TimeSpan uptime = DiscordBot.Uptime;
             * int d = (int) uptime.TotalDays;
             * int h = uptime.Hours;
             * int m = uptime.Minutes;
             * int s = uptime.Seconds;
             * uptime = DiscordBot.TotalUptime;
             * int d2 = (int) uptime.TotalDays;
             * int h2 = uptime.Hours;
             * int m2 = uptime.Minutes;
             * int s2 = uptime.Seconds;
             * int guilds = Client.Guilds.Count;
             * long spoilers = await this.spoilers.GetSpoilerCountAsync().ConfigureAwait(false);
             * long spoiledUsers = await this.spoilers.GetSpoiledUserCountAsync().ConfigureAwait(false);
             * long members = Client.Guilds.Sum(g => g.Users.Count);
             *
             * embed.AddField("Stats", $"**{spoilers}** spoiler{Plural(spoilers)} have been revealed " +
             *                                              $"**{spoiledUsers}** time{Plural(spoiledUsers)}");
             * embed.AddField("Uptime", $"`Current:` " +
             *                                               $"**{d}** day{Plural(d)}, " +
             *                                               $"**{h}** hour{Plural(h)}, " +
             *                                               $"**{m}** minute{Plural(m)}, and " +
             *                                               $"**{s}** second{Plural(s)}\n" +
             *                                               $"`Total:` " +
             *                                               $"**{d2}** day{Plural(d)}, " +
             *                                               $"**{h2}** hour{Plural(h)}, " +
             *                                               $"**{m2}** minute{Plural(m)}, and " +
             *                                               $"**{s2}** second{Plural(s)}");
             * embed.AddField("Servers", $"Active on **{guilds}** server{Plural(guilds)} with " +
             *                                                $"**{members}** member{Plural(members)}");
             *
             * await ReplyAsync(embed: embed.Build()).ConfigureAwait(false);*/
        }