public async Task Status(SocketGuildUser user = null) { // check if user was specified if (user == null) { // if not initialize it with command sender user user = Context.User as SocketGuildUser; } // get server and user account informations Guild guild = Guilds.GetGuild(Context.Guild.Id); UserAccount userAccount = UserAccounts.GetUserAccount(user.Id, guild.UserAccounts, guild.Categories); // create embed EmbedBuilder embed = new EmbedBuilder { ThumbnailUrl = user.GetAvatarUrl(), Title = $"{user.Username}'s status:", Color = new Color(255, 255, 0) }; // create embed fields with points List <EmbedFieldBuilder> fields = new List <EmbedFieldBuilder>() { //global points new EmbedFieldBuilder() { IsInline = false, Name = "Points: ", Value = UserAccounts.CalculateTotalPointsOfUser(userAccount) } }; // foreach category for (int i = 0; i < guild.Categories.Count; i++) { // add category points fields.Add(new EmbedFieldBuilder() { IsInline = false, Name = guild.Categories[i].Name, Value = $"{100*(double)userAccount.CategoryComplition[i]/(double)guild.Categories[i].Questions.Count}%" }); } embed.Fields = fields; // send message to user await Context.Channel.SendMessageAsync("", false, embed.Build()); }