public async Task PlayerSummaries(string name = null)
        {
            PlayerSummaryModel player = (await _steamUser.GetPlayerSummaryAsync(
                                             (await _steamUser.ResolveVanityUrlAsync(name ?? Context.User.Username).ConfigureAwait(false)).Data).ConfigureAwait(false)
                                         ).Data;

            await ReplyAsync("", embed : new EmbedBuilder()
            {
                Title        = $"Player summary for {player.Nickname}",
                Color        = _settings.GetColor(),
                ThumbnailUrl = player.AvatarMediumUrl,
                Url          = player.ProfileUrl
            }
                             .AddField(f =>
            {
                f.IsInline = true;
                f.Name = "SteamID";
                f.Value = player.SteamId;
            })
                             .AddField(f =>
            {
                f.IsInline = true;
                f.Name = "Nickname";
                f.Value = player.Nickname;
            })
                             .AddField(f =>
            {
                f.IsInline = true;
                f.Name = "Persona state";
                f.Value = (PersonaState)Enum.ToObject(typeof(PersonaState), player.ProfileState);
            })
                             .Build()).ConfigureAwait(false);
        }
        public async Task <PlayerSummaryModel> GetUserBySteamId(ulong steamId)
        {
            var response = await _steamUser.GetPlayerSummaryAsync(steamId);

            return(response.Data);
        }
Example #3
0
        public async Task <PlayerSummaryModel> PlayerInfoId(ulong steamId)
        {
            ISteamWebResponse <PlayerSummaryModel> player = await steamInterface.GetPlayerSummaryAsync(steamId);

            return(player.Data);
        }