fix: parse default privacy config commands correctly

This commit is contained in:
spiral 2021-12-01 17:18:38 -05:00
parent 4064078309
commit 59f0a5ec3e
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -481,9 +481,16 @@ public partial class CommandTree
return ctx.Execute<Config>(null, m => m.SystemTimezone(ctx)); return ctx.Execute<Config>(null, m => m.SystemTimezone(ctx));
if (ctx.Match("ping")) if (ctx.Match("ping"))
return ctx.Execute<Config>(null, m => m.SystemPing(ctx)); return ctx.Execute<Config>(null, m => m.SystemPing(ctx));
if (ctx.MatchMultiple(new[] { "private member" }) || ctx.Match("mp")) if (ctx.Match("private"))
{
if (ctx.Match("member"))
return ctx.Execute<Config>(null, m => m.MemberDefaultPrivacy(ctx));
if (ctx.Match("group"))
return ctx.Execute<Config>(null, m => m.GroupDefaultPrivacy(ctx));
}
if (ctx.Match("mp"))
return ctx.Execute<Config>(null, m => m.MemberDefaultPrivacy(ctx)); return ctx.Execute<Config>(null, m => m.MemberDefaultPrivacy(ctx));
if (ctx.MatchMultiple(new[] { "private group" }) || ctx.Match("gp")) if (ctx.Match("gp"))
return ctx.Execute<Config>(null, m => m.GroupDefaultPrivacy(ctx)); return ctx.Execute<Config>(null, m => m.GroupDefaultPrivacy(ctx));
// todo: maybe add the list of configuration keys here? // todo: maybe add the list of configuration keys here?