diff --git a/src/EllieBot/Modules/Utility/Utility.cs b/src/EllieBot/Modules/Utility/Utility.cs index 777caae..54c941e 100644 --- a/src/EllieBot/Modules/Utility/Utility.cs +++ b/src/EllieBot/Modules/Utility/Utility.cs @@ -112,12 +112,13 @@ public partial class Utility : EllieModule return; } - var userNames = new List<IUser>(socketGuild.Users.Count / 100); foreach (var user in socketGuild.Users) { - if (user.Activities.Any(x => x.Name is not null && x.Name.ToUpperInvariant() == game)) + var activity = user.Activities.FirstOrDefault(x => x.Name is not null && x.Name.ToUpperInvariant() == game); + if (activity is not null) { + game = activity.Name; userNames.Add(user); } } @@ -129,6 +130,9 @@ public partial class Utility : EllieModule .PageSize(20) .Page((names, _) => { + var eb = CreateEmbed() + .WithTitle(GetText(strs.whos_playing_game(userNames.Count, game))); + if (names.Count == 0) { return CreateEmbed() @@ -136,8 +140,7 @@ public partial class Utility : EllieModule .WithDescription(GetText(strs.nobody_playing_game)); } - var eb = CreateEmbed() - .WithOkColor(); + eb = eb.WithOkColor(); var users = names.Join('\n'); diff --git a/src/EllieBot/strings/responses/responses.en-US.json b/src/EllieBot/strings/responses/responses.en-US.json index 780b6a9..2a83a9d 100644 --- a/src/EllieBot/strings/responses/responses.en-US.json +++ b/src/EllieBot/strings/responses/responses.en-US.json @@ -1203,5 +1203,6 @@ "userrole_icon_fail": "Failed to set the role icon.", "userrole_icon_invalid": "The role icon cannot be empty.", "userrole_hierarchy_error": "You can't assign or modify roles that are higher than or equal to your, or bots highest role.", - "userrole_role_not_exists": "That role doesn't exist." + "userrole_role_not_exists": "That role doesn't exist.", + "whos_playing_game": "{0} users are playing {1}" }