fix compiler

This commit is contained in:
Lala Sabathil 2025-02-11 10:47:38 +01:00
parent 11dd71537d
commit cc22de02c9
No known key found for this signature in database

View file

@ -137,11 +137,11 @@ internal static class CommandCompiler
case MakotoCommandType.SlashCommand: case MakotoCommandType.SlashCommand:
if (command.IsGroup) if (command.IsGroup)
return $$""" return $$"""
[{{typeof(SlashCommandGroupAttribute).FullName}}("{{command.Name}}", "{{command.Description}}"{{(command.RequiredPermissions is null ? "" : $", {(long)command.RequiredPermissions}")}}, dmPermission: {{command.AllowPrivateUsage.ToString().ToLower()}}, isNsfw: {{command.IsNsfw.ToString().ToLower()}})] [{{typeof(SlashCommandGroupAttribute).FullName}}("{{command.Name}}", "{{command.Description}}"{{(command.RequiredPermissions is null ? "" : $", {(long)command.RequiredPermissions}")}}, {{(command.AllowPrivateUsage ? string.Empty : "allowedContexts: [InteractionContextType.Guild]")}}, isNsfw: {{command.IsNsfw.ToString().ToLower()}})]
"""; """;
else else
return $$""" return $$"""
[{{typeof(SlashCommandAttribute).FullName}}("{{command.Name}}", "{{command.Description}}"{{(command.RequiredPermissions is null ? "" : $", {(long)command.RequiredPermissions}")}}, dmPermission: {{command.AllowPrivateUsage.ToString().ToLower()}}, isNsfw: {{command.IsNsfw.ToString().ToLower()}})] [{{typeof(SlashCommandAttribute).FullName}}("{{command.Name}}", "{{command.Description}}"{{(command.RequiredPermissions is null ? "" : $", {(long)command.RequiredPermissions}")}}, {{(command.AllowPrivateUsage ? string.Empty : "allowedContexts: [InteractionContextType.Guild]")}}, isNsfw: {{command.IsNsfw.ToString().ToLower()}})]
"""; """;
case MakotoCommandType.PrefixCommand: case MakotoCommandType.PrefixCommand:
if (command.IsGroup) if (command.IsGroup)
@ -156,7 +156,7 @@ internal static class CommandCompiler
"""; """;
case MakotoCommandType.ContextMenu: case MakotoCommandType.ContextMenu:
return $$""" return $$"""
[{{typeof(ContextMenuAttribute).FullName}}({{typeof(ApplicationCommandType).FullName}}.{{Enum.GetName(typeof(ApplicationCommandType), command.ContextMenuType)}}, "{{command.Name}}", dmPermission: {{command.AllowPrivateUsage.ToString().ToLower()}}, isNsfw: {{command.IsNsfw.ToString().ToLower()}})] [{{typeof(ContextMenuAttribute).FullName}}({{typeof(ApplicationCommandType).FullName}}.{{Enum.GetName(typeof(ApplicationCommandType), command.ContextMenuType)}}, "{{command.Name}}", {{(command.AllowPrivateUsage ? string.Empty : "allowedContexts: [InteractionContextType.Guild]")}}, isNsfw: {{command.IsNsfw.ToString().ToLower()}})]
"""; """;
default: default: