feat: config setting to automatically set members/groups to private when creating
This commit is contained in:
@@ -23,6 +23,8 @@ public partial class CommandTree
|
||||
public static Command ConfigPing = new Command("config ping", "config ping <enable|disable>", "Changes your system's ping preferences");
|
||||
public static Command ConfigAutoproxyAccount = new Command("config autoproxy account", "autoproxy account [on|off]", "Toggles autoproxy globally for the current account");
|
||||
public static Command ConfigAutoproxyTimeout = new Command("config autoproxy timeout", "autoproxy timeout [<duration>|off|reset]", "Sets the latch timeout duration for your system");
|
||||
public static Command ConfigMemberDefaultPrivacy = new("config member private", "config member private [on|off]", "Sets whether member privacy is automatically set to private when creating a new member");
|
||||
public static Command ConfigGroupDefaultPrivacy = new("config group private", "config group private [on|off]", "Sets whether group privacy is automatically set to private when creating a new group");
|
||||
public static Command AutoproxySet = new Command("autoproxy", "autoproxy [off|front|latch|member]", "Sets your system's autoproxy mode for the current server");
|
||||
public static Command MemberInfo = new Command("member", "member <member>", "Looks up information about a member");
|
||||
public static Command MemberNew = new Command("member new", "member new <name>", "Creates a new member");
|
||||
@@ -125,7 +127,8 @@ public partial class CommandTree
|
||||
|
||||
public static Command[] ConfigCommands =
|
||||
{
|
||||
ConfigTimezone, ConfigPing, ConfigAutoproxyAccount, ConfigAutoproxyTimeout
|
||||
ConfigTimezone, ConfigPing, ConfigAutoproxyAccount, ConfigAutoproxyTimeout,
|
||||
ConfigMemberDefaultPrivacy, ConfigGroupDefaultPrivacy
|
||||
};
|
||||
|
||||
public static Command[] LogCommands = { LogChannel, LogChannelClear, LogEnable, LogDisable };
|
||||
|
@@ -481,6 +481,10 @@ public partial class CommandTree
|
||||
return ctx.Execute<Config>(null, m => m.SystemTimezone(ctx));
|
||||
if (ctx.Match("ping"))
|
||||
return ctx.Execute<Config>(null, m => m.SystemPing(ctx));
|
||||
if (ctx.MatchMultiple(new[] { "private member" }) || ctx.Match("mp"))
|
||||
return ctx.Execute<Config>(null, m => m.MemberDefaultPrivacy(ctx));
|
||||
if (ctx.MatchMultiple(new[] { "private group" }) || ctx.Match("gp"))
|
||||
return ctx.Execute<Config>(null, m => m.GroupDefaultPrivacy(ctx));
|
||||
|
||||
// todo: maybe add the list of configuration keys here?
|
||||
return ctx.Reply($"{Emojis.Error} Could not find a setting with that name. Please see `pk;commands config` for the list of possible config settings.");
|
||||
@@ -492,7 +496,6 @@ public partial class CommandTree
|
||||
await ctx.Reply(
|
||||
$"{Emojis.Error} Unknown command `pk;{ctx.FullCommand().Truncate(100)}`. Perhaps you meant to use one of the following commands?\n{commandListStr}\n\nFor a full list of possible commands, see <https://pluralkit.me/commands>.");
|
||||
}
|
||||
|
||||
private async Task PrintCommandExpectedError(Context ctx, params Command[] potentialCommands)
|
||||
{
|
||||
var commandListStr = CreatePotentialCommandList(potentialCommands);
|
||||
|
Reference in New Issue
Block a user