public async Task Roles() { EmbedBuilder embed = new EmbedBuilder(); Role[] roles_list = await BotUtils.GetRolesFromDb(); embed.WithTitle(string.Format("All roles ({0})", roles_list.Count())); foreach (Role role in roles_list) { long count = 0; using (SQLiteCommand cmd = new SQLiteCommand("SELECT count(*) FROM SpeciesRoles WHERE species_id NOT IN (SELECT species_id FROM Extinctions) AND role_id = $role_id;")) { cmd.Parameters.AddWithValue("$role_id", role.id); count = (await Database.GetRowAsync(cmd)).Field <long>("count(*)"); } string title = string.Format("{0} ({1})", StringUtils.ToTitleCase(role.name), count); embed.AddField(title, role.GetShortDescription()); } await ReplyAsync("", false, embed.Build()); }