mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 02:08:27 -04:00
Nuked humanizer. Some of the strings might look worse but the output directory will no longer look terrible. Added stats for todo list command
This commit is contained in:
@@ -44,7 +44,26 @@ public partial class Utility
|
||||
return;
|
||||
}
|
||||
|
||||
await ShowTodosAsync(todos);
|
||||
await Response()
|
||||
.Paginated()
|
||||
.Items(todos)
|
||||
.PageSize(9)
|
||||
.AddFooter(false)
|
||||
.Page((items, _) =>
|
||||
{
|
||||
var eb = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.todo_list));
|
||||
|
||||
ShowTodoItem(items, eb);
|
||||
|
||||
eb.WithFooter(GetText(strs.todo_stats(todos.Length,
|
||||
todos.Count(x => x.IsDone),
|
||||
todos.Count(x => !x.IsDone))));
|
||||
|
||||
return eb;
|
||||
})
|
||||
.SendAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,23 +100,6 @@ public partial class Utility
|
||||
}
|
||||
|
||||
|
||||
private Task ShowTodosAsync(TodoModel[] todos)
|
||||
=> Response()
|
||||
.Paginated()
|
||||
.Items(todos)
|
||||
.PageSize(9)
|
||||
.Page((items, _) =>
|
||||
{
|
||||
var eb = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.todo_list));
|
||||
|
||||
ShowTodoItem(items, eb);
|
||||
|
||||
return eb;
|
||||
})
|
||||
.SendAsync();
|
||||
|
||||
private static void ShowTodoItem(IReadOnlyCollection<TodoModel> todos, EmbedBuilder eb)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
@@ -155,8 +157,8 @@ public partial class Utility
|
||||
.Page((items, _) =>
|
||||
{
|
||||
var eb = _sender.CreateEmbed()
|
||||
.WithTitle(GetText(strs.todo_archive_list))
|
||||
.WithOkColor();
|
||||
.WithTitle(GetText(strs.todo_archive_list))
|
||||
.WithOkColor();
|
||||
|
||||
foreach (var archivedList in items)
|
||||
{
|
||||
@@ -182,14 +184,19 @@ public partial class Utility
|
||||
.Paginated()
|
||||
.Items(list.Items)
|
||||
.PageSize(9)
|
||||
.AddFooter(false)
|
||||
.Page((items, _) =>
|
||||
{
|
||||
var eb = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.todo_list));
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.todo_archived_list));
|
||||
|
||||
ShowTodoItem(items, eb);
|
||||
|
||||
eb.WithFooter(GetText(strs.todo_stats(list.Items.Count,
|
||||
list.Items.Count(x => x.IsDone),
|
||||
list.Items.Count(x => !x.IsDone))));
|
||||
|
||||
return eb;
|
||||
})
|
||||
.SendAsync();
|
||||
|
Reference in New Issue
Block a user