public async Task RankedStats(CommandContext ctx, [Description("Player to get stats for.")] string playerName, [Description("Season to get stats for")] string seasonName) { try { R6SiegeAPI.Models.Player player = await api.GetPlayer(playerName, R6SiegeAPI.Enums.Platform.UPLAY, R6SiegeAPI.Enums.UserSearchType.Name); int seasonID = GetSeasonID(seasonName); if (seasonID == -1) { throw new CommandFailedException($"{Formatter.InlineCode(seasonName)} is not a valid season or we don't currently support it. Try {Formatter.InlineCode("parabellum")}, {Formatter.InlineCode("chimera")}, {Formatter.InlineCode("whitenoise")}, or {Formatter.InlineCode("bloodorchid")}."); } else { R6SiegeAPI.Models.Rank rank = await player.GetRank(R6SiegeAPI.Enums.RankedRegion.NA, seasonID); await ctx.RespondAsync(embed : R6SiegeStatsModule.RankedStatsToDiscordEmbed(rank.MMR, rank.MaxMMR, rank.Wins, rank.Losses, rank.Abandons, rank.RankName, playerName, rank.Season.Name, rank.GetIconUrl)); } } catch (Exception e) { if (e.GetType() == typeof(CommandFailedException)) { throw e; } throw new CommandFailedException($"Player {Formatter.InlineCode(playerName)} does not exist accoring to Ubisoft."); } }
public async Task GeneralStats(CommandContext ctx, [Description("Player to get stats for.")] string playerName) { try { R6SiegeAPI.Models.Player player = await api.GetPlayer(playerName, R6SiegeAPI.Enums.Platform.UPLAY, R6SiegeAPI.Enums.UserSearchType.Name); R6SiegeAPI.Models.General genStats = await player.GetGeneral(); await ctx.RespondAsync(embed : R6SiegeStatsModule.GeneralStatsToDiscordEmbed(genStats.Kills, genStats.Deaths, genStats.KillAssists, genStats.MatchWon, genStats.MatchLost, genStats.MatchPlayed, playerName, player.IconUrl, genStats.BarricadesDeployed, genStats.ReinforcementsDeployed, genStats.DistanceTravelled)); } catch { throw new CommandFailedException($"Player {Formatter.InlineCode(playerName)} does not exist accoring to Ubisoft."); } }