This commit is contained in:
spiral 2021-09-13 08:42:51 -04:00
parent 78ab3f8bcd
commit 07b12f39b0
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31
2 changed files with 9 additions and 6 deletions

View File

@ -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);

View File

@ -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 <id|link> [delete|author]", "Looks up a proxied message");
public static Command MessageEdit = new Command("edit", "edit [link] <text>", "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 <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> [channel 2] [channel 3...]", "Enables message logging in certain channels");