diff --git a/PluralKit.Bot/CommandMeta/CommandTree.cs b/PluralKit.Bot/CommandMeta/CommandTree.cs index 7cd58c2a..a458e1d4 100644 --- a/PluralKit.Bot/CommandMeta/CommandTree.cs +++ b/PluralKit.Bot/CommandMeta/CommandTree.cs @@ -590,7 +590,7 @@ public partial class CommandTree return ctx.Execute(null, m => m.HidDisplayCaps(ctx)); if (ctx.MatchMultiple(new[] { "pad" }, new[] { "id", "ids" }) || ctx.MatchMultiple(new[] { "id" }, new[] { "pad", "padding" }) || ctx.Match("idpad", "padid", "padids")) return ctx.Execute(null, m => m.HidListPadding(ctx)); - if (ctx.MatchMultiple(new[] { "name" }, new[] { "format" }) || ctx.Match("nf")) + if (ctx.MatchMultiple(new[] { "name" }, new[] { "format" }) || ctx.Match("nameformat", "nf")) return ctx.Execute(null, m => m.NameFormat(ctx)); if (ctx.MatchMultiple(new[] { "member", "group" }, new[] { "limit" }) || ctx.Match("limit")) return ctx.Execute(null, m => m.LimitUpdate(ctx)); diff --git a/PluralKit.Bot/Commands/Config.cs b/PluralKit.Bot/Commands/Config.cs index 49e0fbd0..fd01bb6a 100644 --- a/PluralKit.Bot/Commands/Config.cs +++ b/PluralKit.Bot/Commands/Config.cs @@ -567,13 +567,19 @@ public class Config public async Task NameFormat(Context ctx) { - if (!ctx.HasNext()) + var clearFlag = ctx.MatchClear(); + if (!ctx.HasNext() && !clearFlag) { await ctx.Reply($"Member names are currently formatted as `{ctx.Config.NameFormat ?? ProxyMember.DefaultFormat}`"); return; } - var formatString = ctx.RemainderOrNull(); + string formatString; + if (clearFlag) + formatString = ProxyMember.DefaultFormat; + else + formatString = ctx.RemainderOrNull(); + await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { NameFormat = formatString }); await ctx.Reply($"Member names are now formatted as `{formatString}`"); }