Beispiel #1
0
            public static void Construct(SocketCommandContext context, KnockOutHandler knockoutData)
            {
                var userId = knockoutData.KnockoutCreatorUlong;

                Title = knockoutData.KnockoutTitle;
                AllLivingContenders = knockoutData.AllLivingContendersByScoreOrderList();
                AllFallenContenders = knockoutData.AllFallenContendersByScoreOrderListWithEpitaph();
                Username            = context.Client.GetUser(userId).Username;
                UserAvatar          = context.Client.GetUser(userId).GetAvatarUrl();

                PlayersReadyString = "";

                foreach (var playerId in knockoutData.AllPlayerIds)
                {
                    // The AlwaysDownloadUsers setting should make this check redundant, but keeping it for safety
                    if (context.Guild.GetUser(playerId) == null)
                    {
                        continue;
                    }

                    var username = context.Guild.GetUser(playerId).Username;

                    if (knockoutData.PlayerWentLastTime(playerId) || knockoutData.TurnsLeftForPlayer(playerId) == 0)
                    {
                        PlayersReadyString += $"~~{username}~~, ";
                    }
                    else
                    {
                        PlayersReadyString += $"{context.Guild.GetUser(playerId).Username}, ";
                    }
                }
            }