diff --git a/PluralKit.Bot/Commands/CommandTree.cs b/PluralKit.Bot/Commands/CommandTree.cs index f0c825b9..ff220c56 100644 --- a/PluralKit.Bot/Commands/CommandTree.cs +++ b/PluralKit.Bot/Commands/CommandTree.cs @@ -71,6 +71,7 @@ namespace PluralKit.Bot public static Command Explain = new Command("explain", "explain", "Explains the basics of systems and proxying"); public static Command Message = new Command("message", "message ", "Looks up a proxied message"); public static Command LogChannel = new Command("log channel", "log channel ", "Designates a channel to post proxied messages to"); + public static Command LogChannelClear = new Command("log channel", "log channel -clear", "Clears the currently set log channel"); public static Command LogEnable = new Command("log enable", "log enable all| [channel 2] [channel 3...]", "Enables message logging in certain channels"); public static Command LogDisable = new Command("log disable", "log disable all| [channel 2] [channel 3...]", "Disables message logging in certain channels"); public static Command LogClean = new Command("logclean", "logclean [on|off]", "Toggles whether to clean up other bots' log channels"); @@ -105,7 +106,7 @@ namespace PluralKit.Bot public static Command[] SwitchCommands = {Switch, SwitchOut, SwitchMove, SwitchDelete}; - public static Command[] LogCommands = {LogChannel, LogEnable, LogDisable}; + public static Command[] LogCommands = {LogChannel, LogChannelClear, LogEnable, LogDisable}; private DiscordShardedClient _client; @@ -127,10 +128,8 @@ namespace PluralKit.Bot return HandleSwitchCommand(ctx); if (ctx.Match("ap", "autoproxy", "auto")) return ctx.Execute(Autoproxy, m => m.AutoproxyRoot(ctx)); - if (ctx.Match("list", "l", "members")) + if (ctx.Match("list", "find", "members", "search", "query", "l", "f", "fd")) return ctx.Execute(SystemList, m => m.MemberList(ctx, ctx.System)); - if (ctx.Match("f", "find", "search", "query", "fd")) - return ctx.Execute(SystemFind, m => m.MemberList(ctx, ctx.System)); if (ctx.Match("link")) return ctx.Execute(Link, m => m.LinkSystem(ctx)); if (ctx.Match("unlink")) @@ -163,6 +162,8 @@ namespace PluralKit.Bot return ctx.Execute(LogEnable, m => m.SetLogEnabled(ctx, true)); else if (ctx.Match("disable", "off")) return ctx.Execute(LogDisable, m => m.SetLogEnabled(ctx, false)); + else if (ctx.Match("commands")) + return PrintCommandList(ctx, "message logging", LogCommands); else return PrintCommandExpectedError(ctx, LogCommands); if (ctx.Match("logclean")) return ctx.Execute(LogClean, m => m.SetLogCleanup(ctx)); diff --git a/docs/content/command-list.md b/docs/content/command-list.md index 782af0dd..7cc6fc8c 100644 --- a/docs/content/command-list.md +++ b/docs/content/command-list.md @@ -81,6 +81,7 @@ Words in **\** or **[square brackets]** mean fill-in-the-blank. ## Server owner commands *(all commands here require Manage Server permission)* - `pk;log channel ` - Sets the given channel to log all proxied messages. +- `pk;log channel -clear` - Clears the currently set log channel. - `pk;log disable <#channel> [#channel...]` - Disables logging messages posted in the given channel(s) (useful for staff channels and such). - `pk;log enable <#channel> [#channel...]` - Re-enables logging messages posted in the given channel(s). - `pk;logclean ` - Enables or disables [log cleanup](./staff/compatibility.md#log-cleanup). diff --git a/docs/content/staff/logging.md b/docs/content/staff/logging.md index 673f5766..ea39c64a 100644 --- a/docs/content/staff/logging.md +++ b/docs/content/staff/logging.md @@ -1,9 +1,9 @@ # Proxy logging -If you want to log every proxied message to a separate channel for moderation purposes, you can use the `pk;log` command with the channel name.For example: +If you want to log every proxied message to a separate channel for moderation purposes, you can use the `pk;log channel` command with the channel name.For example: - pk;log #proxy-log + pk;log channel #proxy-log -This requires you to have the *Manage Server* permission on the server. To disable logging, use the `pk;log` command with no channel name. +This requires you to have the *Manage Server* permission on the server. To disable logging, use the `pk;log channel` command with the `-clear` flag as the channel name. Log messages have the following format: