.whosplaying is now properly paginated
This commit is contained in:
parent
da48250ad4
commit
51bfe8d206
1 changed files with 20 additions and 14 deletions
|
@ -122,21 +122,27 @@ public partial class Utility : EllieModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
userNames.Shuffle();
|
await Response()
|
||||||
|
.Sanitize()
|
||||||
var i = 0;
|
.Paginated()
|
||||||
if (userNames.Count == 0)
|
.Items(userNames)
|
||||||
|
.PageSize(20)
|
||||||
|
.Page((names, _) =>
|
||||||
{
|
{
|
||||||
await Response().Error(strs.nobody_playing_game).SendAsync();
|
if (names.Count == 0)
|
||||||
return;
|
{
|
||||||
|
return _sender.CreateEmbed()
|
||||||
|
.WithErrorColor()
|
||||||
|
.WithDescription(GetText(strs.nobody_playing_game));
|
||||||
}
|
}
|
||||||
|
|
||||||
var users = userNames.GroupBy(_ => i++ / 2)
|
var eb = _sender.CreateEmbed()
|
||||||
.Select(ig => string.Concat(ig.Select(el => $"• {el,-27}")))
|
.WithOkColor();
|
||||||
.Join('\n');
|
|
||||||
|
|
||||||
await Response()
|
var users = names.Join('\n');
|
||||||
.Confirm(Format.Code(users))
|
|
||||||
|
return eb.WithDescription(users);
|
||||||
|
})
|
||||||
.SendAsync();
|
.SendAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue