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

@@ -18,7 +18,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
[NadekoOptions(typeof(AcrophobiaGame.Options))]
public async partial Task Acrophobia(params string[] args)
public async Task Acrophobia(params string[] args)
{
var (options, _) = OptionsParser.ParseFrom(new AcrophobiaGame.Options(), args);
var channel = (ITextChannel)ctx.Channel;

View File

@@ -17,7 +17,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.ManageMessages)]
public async partial Task Cleverbot()
public async Task Cleverbot()
{
var channel = (ITextChannel)ctx.Channel;

View File

@@ -21,7 +21,7 @@ public partial class Games : NadekoModule<GamesService>
}
[Cmd]
public async partial Task Choose([Leftover] string list = null)
public async Task Choose([Leftover] string list = null)
{
if (string.IsNullOrWhiteSpace(list))
return;
@@ -33,7 +33,7 @@ public partial class Games : NadekoModule<GamesService>
}
[Cmd]
public async partial Task EightBall([Leftover] string question = null)
public async Task EightBall([Leftover] string question = null)
{
if (string.IsNullOrWhiteSpace(question))
return;
@@ -48,7 +48,7 @@ public partial class Games : NadekoModule<GamesService>
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task RateGirl([Leftover] IGuildUser usr)
public async Task RateGirl([Leftover] IGuildUser usr)
{
var gr = _service.GirlRatings.GetOrAdd(usr.Id, GetGirl);
var originalStream = await gr.Stream;
@@ -140,7 +140,7 @@ public partial class Games : NadekoModule<GamesService>
}
[Cmd]
public async partial Task Linux(string guhnoo, string loonix)
public async Task Linux(string guhnoo, string loonix)
=> await SendConfirmAsync(
$@"I'd just like to interject for moment. What you're refering to as {loonix}, is in fact, {guhnoo}/{loonix}, or as I've recently taken to calling it, {guhnoo} plus {loonix}. {loonix} is not an operating system unto itself, but rather another free component of a fully functioning {guhnoo} system made useful by the {guhnoo} corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

View File

@@ -10,7 +10,7 @@ public partial class Games
{
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task Hangmanlist()
public async Task Hangmanlist()
=> await SendConfirmAsync(GetText(strs.hangman_types(prefix)), _service.GetHangmanTypes().Join('\n'));
private static string Draw(HangmanGame.State state)
@@ -51,7 +51,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task Hangman([Leftover] string? type = null)
public async Task Hangman([Leftover] string? type = null)
{
if (!_service.StartHangman(ctx.Channel.Id, type, out var hangman))
{
@@ -66,7 +66,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task HangmanStop()
public async Task HangmanStop()
{
if (await _service.StopHangman(ctx.Channel.Id))
await ReplyConfirmLocalizedAsync(strs.hangman_stopped);

View File

@@ -16,7 +16,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task Nunchi()
public async Task Nunchi()
{
var newNunchi = new NunchiGame(ctx.User.Id, ctx.User.ToString());
NunchiGame nunchi;

View File

@@ -18,7 +18,7 @@ public partial class Games
[Cmd]
[UserPerm(GuildPerm.ManageMessages)]
[RequireContext(ContextType.Guild)]
public async partial Task Poll([Leftover] string arg)
public async Task Poll([Leftover] string arg)
{
if (string.IsNullOrWhiteSpace(arg))
return;
@@ -48,7 +48,7 @@ public partial class Games
[Cmd]
[UserPerm(GuildPerm.ManageMessages)]
[RequireContext(ContextType.Guild)]
public async partial Task PollStats()
public async Task PollStats()
{
if (!_service.ActivePolls.TryGetValue(ctx.Guild.Id, out var pr))
return;
@@ -59,7 +59,7 @@ public partial class Games
[Cmd]
[UserPerm(GuildPerm.ManageMessages)]
[RequireContext(ContextType.Guild)]
public async partial Task Pollend()
public async Task Pollend()
{
Poll p;
if ((p = _service.StopPoll(ctx.Guild.Id)) is null)

View File

@@ -21,7 +21,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
[NadekoOptionsAttribute(typeof(TypingGame.Options))]
public async partial Task TypeStart(params string[] args)
public async Task TypeStart(params string[] args)
{
var (options, _) = OptionsParser.ParseFrom(new TypingGame.Options(), args);
var channel = (ITextChannel)ctx.Channel;
@@ -37,7 +37,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task TypeStop()
public async Task TypeStop()
{
if (_service.RunningContests.TryRemove(ctx.Guild.Id, out var game))
{
@@ -52,7 +52,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
[OwnerOnly]
public async partial Task Typeadd([Leftover] string text)
public async Task Typeadd([Leftover] string text)
{
if (string.IsNullOrWhiteSpace(text))
return;
@@ -64,7 +64,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task Typelist(int page = 1)
public async Task Typelist(int page = 1)
{
if (page < 1)
return;
@@ -85,7 +85,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
[OwnerOnly]
public async partial Task Typedel(int index)
public async Task Typedel(int index)
{
var removed = _service.RemoveTypingArticle(--index);

View File

@@ -18,7 +18,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
[NadekoOptions(typeof(TicTacToe.Options))]
public async partial Task TicTacToe(params string[] args)
public async Task TicTacToe(params string[] args)
{
var (options, _) = OptionsParser.ParseFrom(new TicTacToe.Options(), args);
var channel = (ITextChannel)ctx.Channel;

View File

@@ -31,7 +31,7 @@ public partial class Games
[RequireContext(ContextType.Guild)]
[Priority(0)]
[NadekoOptions(typeof(TriviaOptions))]
public async partial Task Trivia(params string[] args)
public async Task Trivia(params string[] args)
{
var (opts, _) = OptionsParser.ParseFrom(new TriviaOptions(), args);
@@ -56,7 +56,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task Tl()
public async Task Tl()
{
if (_service.RunningTrivias.TryGetValue(ctx.Guild.Id, out var trivia))
{
@@ -69,7 +69,7 @@ public partial class Games
[Cmd]
[RequireContext(ContextType.Guild)]
public async partial Task Tq()
public async Task Tq()
{
var channel = (ITextChannel)ctx.Channel;