Exemplo n.º 1
0
        public async Task ShowUserInvestments()
        {
            var account = UserAccounts.GetAccount(Context.User);
            List <Investment> investments = InvestmentsManager.GetInvestments(account);

            if (investments.Count == 0)
            {
                await Context.Channel.SendMessageAsync("Nie posiadasz zadnych lokat.");
            }
            else
            {
                var embed = new EmbedBuilder();
                embed.WithTitle($"Lokaty {Context.User.Username}");
                embed.WithColor(Colors.AvalibleColors[(int)account.ActuallyColor].RightColor);

                foreach (var i in investments)
                {
                    embed.AddField($"[{i.ID}] Zalozono: `{i.PaymentDate}`", $"" +
                                   $"Wyplata: `{i.MoneyToWithdraw}` dudow. Koniec: `{i.PaymentDate+i.InvestmentDuration}`");
                }

                await Context.Channel.SendMessageAsync("", false, embed);
            }
        }