fix compiler
This commit is contained in:
parent
11dd71537d
commit
cc22de02c9
1 changed files with 3 additions and 3 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue