Removed cmd source generator. Commands are no longer partial methods. Compilations should be slightly faster now. Updated packages and adapted drawing code to the new apis. There may be some bugs.

This commit is contained in:
Kwoth
2022-07-18 04:33:50 +02:00
parent 3db194c186
commit 99c60459f8
98 changed files with 747 additions and 788 deletions

View File

@@ -44,13 +44,13 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
[Priority(1)]
public partial Task ListQuotes(OrderType order = OrderType.Keyword)
public Task ListQuotes(OrderType order = OrderType.Keyword)
=> ListQuotes(1, order);
[Cmd]
[RequireContext(ContextType.Guild)]
[Priority(0)]
public async partial Task ListQuotes(int page = 1, OrderType order = OrderType.Keyword)
public async Task ListQuotes(int page = 1, OrderType order = OrderType.Keyword)
{
page -= 1;
if (page < 0)
@@ -75,7 +75,7 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task QuotePrint([Leftover] string keyword)
public async Task QuotePrint([Leftover] string keyword)
{
if (string.IsNullOrWhiteSpace(keyword))
return;
@@ -106,7 +106,7 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task QuoteShow(int id)
public async Task QuoteShow(int id)
{
Quote quote;
await using (var uow = _db.GetDbContext())
@@ -160,18 +160,18 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
[Priority(0)]
public partial Task QuoteSearch(string textOrAuthor)
public Task QuoteSearch(string textOrAuthor)
=> QuoteSearchinternalAsync(null, textOrAuthor);
[Cmd]
[RequireContext(ContextType.Guild)]
[Priority(1)]
public partial Task QuoteSearch(string keyword, [Leftover] string textOrAuthor)
public Task QuoteSearch(string keyword, [Leftover] string textOrAuthor)
=> QuoteSearchinternalAsync(keyword, textOrAuthor);
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task QuoteId(int id)
public async Task QuoteId(int id)
{
if (id < 0)
return;
@@ -203,7 +203,7 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task QuoteAdd(string keyword, [Leftover] string text)
public async Task QuoteAdd(string keyword, [Leftover] string text)
{
if (string.IsNullOrWhiteSpace(keyword) || string.IsNullOrWhiteSpace(text))
return;
@@ -229,7 +229,7 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task QuoteDelete(int id)
public async Task QuoteDelete(int id)
{
var hasManageMessages = ((IGuildUser)ctx.Message.Author).GuildPermissions.ManageMessages;
@@ -259,7 +259,7 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.ManageMessages)]
public async partial Task DelAllQuotes([Leftover] string keyword)
public async Task DelAllQuotes([Leftover] string keyword)
{
if (string.IsNullOrWhiteSpace(keyword))
return;
@@ -279,7 +279,7 @@ public partial class Utility
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.Administrator)]
public async partial Task QuotesExport()
public async Task QuotesExport()
{
IEnumerable<Quote> quotes;
await using (var uow = _db.GetDbContext())
@@ -303,7 +303,7 @@ public partial class Utility
#if GLOBAL_NADEKO
[OwnerOnly]
#endif
public async partial Task QuotesImport([Leftover] string input = null)
public async Task QuotesImport([Leftover] string input = null)
{
input = input?.Trim();