From 07b12f39b0ab2300f9a9e1d85515ce26f97615f4 Mon Sep 17 00:00:00 2001 From: spiral Date: Mon, 13 Sep 2021 08:42:51 -0400 Subject: [PATCH] aaaaaaa --- PluralKit.Bot/Commands/Checks.cs | 13 ++++++++----- PluralKit.Bot/Commands/CommandTree.cs | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/PluralKit.Bot/Commands/Checks.cs b/PluralKit.Bot/Commands/Checks.cs index b7941974..43dce925 100644 --- a/PluralKit.Bot/Commands/Checks.cs +++ b/PluralKit.Bot/Commands/Checks.cs @@ -165,7 +165,10 @@ namespace PluralKit.Bot public async Task PermCheckChannel(Context ctx) { - var error = ""; + if (!ctx.HasNext()) + throw new PKSyntaxError("You need to specify a channel."); + + var error = "Channel not found or you do not have permissions to access it."; var channel = await ctx.MatchChannel(); if (channel == null || channel.GuildId == null) @@ -226,7 +229,7 @@ namespace PluralKit.Bot public async Task MessageProxyCheck(Context ctx) { if (!ctx.HasNext() && ctx.Message.MessageReference == null) - throw new PKError("You need to specify a message."); + throw new PKSyntaxError("You need to specify a message."); var failedToGetMessage = "Could not find a valid message to check, was not able to fetch the message, or the message was not sent by you."; @@ -259,11 +262,11 @@ namespace PluralKit.Bot throw new PKError(failedToGetMessage); if ((_botConfig.Prefixes ?? BotConfig.DefaultPrefixes).Any(p => msg.Content.StartsWith(p))) - throw new PKError("This message starts with the bot's prefix, and was parsed as a command."); + await ctx.Reply("This message starts with the bot's prefix, and was parsed as a command."); if (msg.WebhookId != null) - throw new PKError("You cannot check messages sent by a webhook."); + await ctx.Reply("You cannot check messages sent by a webhook."); if (msg.Author.Id != ctx.Author.Id) - throw new PKError("You can only check your own messages."); + await ctx.Reply("You can only check your own messages."); // get the channel info var channel = _cache.GetChannel(channelId.Value); diff --git a/PluralKit.Bot/Commands/CommandTree.cs b/PluralKit.Bot/Commands/CommandTree.cs index 9d8f7417..79860097 100644 --- a/PluralKit.Bot/Commands/CommandTree.cs +++ b/PluralKit.Bot/Commands/CommandTree.cs @@ -84,7 +84,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 [delete|author]", "Looks up a proxied message"); public static Command MessageEdit = new Command("edit", "edit [link] ", "Edit a previously proxied message"); - public static Command ProxyCheck = new Command("proxycheck", "proxycheck [link]", "Checks why your message has not been proxied"); + public static Command ProxyCheck = new Command("debug proxy", "debug proxy [link|reply]", "Checks why your message has not been proxied"); 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");