fix: incorrect pk;config private <target> command parsing
This commit is contained in:
parent
ad6addc2fd
commit
cb1d4c98c7
@ -476,16 +476,9 @@ 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.Match("private"))
|
if (ctx.MatchMultiple(new[] { "private" }, new[] { "member" }) || ctx.Match("mp"))
|
||||||
{
|
|
||||||
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.Match("gp"))
|
if (ctx.MatchMultiple(new[] { "private" }, new[] { "group" }) || ctx.Match("gp"))
|
||||||
return ctx.Execute<Config>(null, m => m.GroupDefaultPrivacy(ctx));
|
return ctx.Execute<Config>(null, m => m.GroupDefaultPrivacy(ctx));
|
||||||
if (ctx.MatchMultiple(new[] { "show" }, new[] { "private" }) || ctx.Match("sp"))
|
if (ctx.MatchMultiple(new[] { "show" }, new[] { "private" }) || ctx.Match("sp"))
|
||||||
return ctx.Execute<Config>(null, m => m.ShowPrivateInfo(ctx));
|
return ctx.Execute<Config>(null, m => m.ShowPrivateInfo(ctx));
|
||||||
|
@ -320,10 +320,10 @@ public class Config
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo: this command parsing is really messy
|
||||||
|
|
||||||
public async Task MemberDefaultPrivacy(Context ctx)
|
public async Task MemberDefaultPrivacy(Context ctx)
|
||||||
{
|
{
|
||||||
ctx.CheckSystem();
|
|
||||||
|
|
||||||
if (!ctx.HasNext())
|
if (!ctx.HasNext())
|
||||||
{
|
{
|
||||||
if (ctx.Config.MemberDefaultPrivate) { await ctx.Reply("Newly created members will currently have their privacy settings set to private. To change this, type `pk;config private member off`"); }
|
if (ctx.Config.MemberDefaultPrivate) { await ctx.Reply("Newly created members will currently have their privacy settings set to private. To change this, type `pk;config private member off`"); }
|
||||||
@ -348,8 +348,6 @@ public class Config
|
|||||||
|
|
||||||
public async Task GroupDefaultPrivacy(Context ctx)
|
public async Task GroupDefaultPrivacy(Context ctx)
|
||||||
{
|
{
|
||||||
ctx.CheckSystem();
|
|
||||||
|
|
||||||
if (!ctx.HasNext())
|
if (!ctx.HasNext())
|
||||||
{
|
{
|
||||||
if (ctx.Config.GroupDefaultPrivate) { await ctx.Reply("Newly created groups will currently have their privacy settings set to private. To change this, type `pk;config private group off`"); }
|
if (ctx.Config.GroupDefaultPrivate) { await ctx.Reply("Newly created groups will currently have their privacy settings set to private. To change this, type `pk;config private group off`"); }
|
||||||
@ -374,8 +372,6 @@ public class Config
|
|||||||
|
|
||||||
public async Task ShowPrivateInfo(Context ctx)
|
public async Task ShowPrivateInfo(Context ctx)
|
||||||
{
|
{
|
||||||
ctx.CheckSystem();
|
|
||||||
|
|
||||||
if (!ctx.HasNext())
|
if (!ctx.HasNext())
|
||||||
{
|
{
|
||||||
if (ctx.Config.ShowPrivateInfo) await ctx.Reply("Private information is currently **shown** when looking up your own info. Use the `-public` flag to hide it.");
|
if (ctx.Config.ShowPrivateInfo) await ctx.Reply("Private information is currently **shown** when looking up your own info. Use the `-public` flag to hide it.");
|
||||||
|
Loading…
Reference in New Issue
Block a user