public MiunieCommandContext(DiscordSocketClient client, SocketUserMessage msg, GlobalUserAccounts globalUserAccounts) : base(client, msg)
        {
            this._globalUserAccounts = globalUserAccounts;

            if (User is null)
            {
                return;
            }

            UserAccount = globalUserAccounts.GetFromDiscordUser(User);
        }
Пример #2
0
        public async Task AccountInformation(SocketGuildUser user = null)
        {
            user = user ?? (SocketGuildUser)Context.User;

            var userAccount = _globalUserAccounts.GetFromDiscordUser(user);

            var embed = new EmbedBuilder()
                        .WithAuthor($"{user.Username}'s account information", user.GetAvatarUrl())
                        .AddField("Joined at: ", user.JoinedAt.Value.DateTime.ToString())
                        .AddField("**Last message**", userAccount.LastMessage.ToString(), true)
                        .AddField("**Number of reminders**: ", userAccount.Reminders.Count, true)
                        .WithColor(Color.Blue)
                        .WithCurrentTimestamp()
                        .WithFooter($"Requested by {Context.User.Username}")
                        .WithThumbnailUrl(user.GetAvatarUrl())
                        .Build();

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