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

@@ -3,11 +3,16 @@ using System.Runtime.CompilerServices;
namespace NadekoBot.Common.Attributes;
[AttributeUsage(AttributeTargets.Method)]
public sealed class NadekoCommandAttribute : CommandAttribute
public sealed class CmdAttribute : CommandAttribute
{
public string MethodName { get; }
public NadekoCommandAttribute([CallerMemberName] string memberName = "")
public CmdAttribute([CallerMemberName] string memberName = "")
: base(CommandNameLoadHelper.GetCommandNameFor(memberName))
=> MethodName = memberName.ToLowerInvariant();
{
MethodName = memberName.ToLowerInvariant();
Aliases = CommandNameLoadHelper.GetAliasesFor(memberName);
Remarks = memberName.ToLowerInvariant();
// Summary = memberName.ToLowerInvariant();
}
}

View File

@@ -1,30 +1,32 @@
using System.Runtime.CompilerServices;
// using System.Runtime.CompilerServices;
//
// namespace NadekoBot.Common.Attributes;
//
// [AttributeUsage(AttributeTargets.Class)]
// internal sealed class NadekoModuleAttribute : GroupAttribute
// {
// public NadekoModuleAttribute(string moduleName)
// : base(moduleName)
// {
// }
// }
//
// [AttributeUsage(AttributeTargets.Method)]
// internal sealed class NadekoDescriptionAttribute : SummaryAttribute
// {
// public NadekoDescriptionAttribute([CallerMemberName] string name = "")
// : base(name.ToLowerInvariant())
// {
// }
// }
//
// [AttributeUsage(AttributeTargets.Method)]
// internal sealed class NadekoUsageAttribute : RemarksAttribute
// {
// public NadekoUsageAttribute([CallerMemberName] string name = "")
// : base(name.ToLowerInvariant())
// {
// }
// }
namespace NadekoBot.Common.Attributes;
[AttributeUsage(AttributeTargets.Class)]
internal sealed class NadekoModuleAttribute : GroupAttribute
{
public NadekoModuleAttribute(string moduleName)
: base(moduleName)
{
}
}
[AttributeUsage(AttributeTargets.Method)]
internal sealed class NadekoDescriptionAttribute : SummaryAttribute
{
public NadekoDescriptionAttribute([CallerMemberName] string name = "")
: base(name.ToLowerInvariant())
{
}
}
[AttributeUsage(AttributeTargets.Method)]
internal sealed class NadekoUsageAttribute : RemarksAttribute
{
public NadekoUsageAttribute([CallerMemberName] string name = "")
: base(name.ToLowerInvariant())
{
}
}
// todo remove these