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:
Kwoth
2024-05-02 22:14:25 +00:00
parent fc4858830c
commit 3ef05f8aa7
19 changed files with 104 additions and 66 deletions

View File

@@ -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();