Пример #1
0
        /// <summary>
        /// Méthode de prise en charge de la commande membercount
        /// </summary>
        /// <param name="channel"></param>
        /// <param name="user"></param>
        public async void MembercountAsync(IGuild guild, IUser user)
        {
            var builder = EmbedBuilderHelper.EmbedBuilderInformation(user)
                          .WithTitle("Membercount command")
                          .AddField("Membres", await InformationHelper.GetNbUsers(guild), true)
                          .AddField("En ligne", await InformationHelper.GetNbOnline(guild), true)
                          .AddField("Humains", await InformationHelper.GetNbHumans(guild), true)
                          .AddField("Bots", await InformationHelper.GetNbBots(guild), true);

            Reply("", builder);
        }
Пример #2
0
        /// <summary>
        /// Méthode de prise en charge de la commande serverinfo
        /// </summary>
        /// <param name="guild"></param>
        public async void ServerinfoAsync(IGuild guild)
        {
            string sRoles = "";

            foreach (var role in guild.Roles)
            {
                sRoles += role.Name;
                if (guild.Roles.Count != 1 && !role.Equals(guild.Roles.Last()))
                {
                    sRoles += ", ";
                }
            }

            var builder = new EmbedBuilder()
                          .WithThumbnailUrl(guild.IconUrl)
                          .AddField("Propriétaire", await guild.GetOwnerAsync(), true)
                          .AddField("Région", guild.VoiceRegionId, true)
                          .AddField("Catégories de salon", (await guild.GetCategoriesAsync()).Count, true)
                          .AddField("Salons textuels", (await guild.GetTextChannelsAsync()).Count, true)
                          .AddField("Salons vocaux", (await guild.GetVoiceChannelsAsync()).Count, true)
                          .AddField("Membres", await InformationHelper.GetNbUsers(guild), true)
                          .AddField("En ligne", await InformationHelper.GetNbOnline(guild), true)
                          .AddField("Humains", await InformationHelper.GetNbHumans(guild), true)
                          .AddField("Bots", await InformationHelper.GetNbBots(guild), true)
                          .AddField("Roles", guild.Roles.Count, true)
                          .AddField("Liste des roles", sRoles)
                          .WithTimestamp(guild.CreatedAt)
                          .WithAuthor(author =>
            {
                author
                .WithName(guild.Name)
                .WithIconUrl(guild.IconUrl);
            })
                          .WithFooter(footer =>
            {
                footer
                .WithText($"ID: {guild.Id} | Serveur créé le");
            });

            Reply("", builder);
        }