diff --git a/PluralKit.Bot/Errors.cs b/PluralKit.Bot/Errors.cs index 25cecab0..9b496da0 100644 --- a/PluralKit.Bot/Errors.cs +++ b/PluralKit.Bot/Errors.cs @@ -183,4 +183,6 @@ public static class Errors public static PKError ChannelNotFound(string channelString) => new($"Channel \"{channelString}\" not found or is not in this server."); + + public static PKError InteractionWrongAccount(ulong user) => new($"This prompt is only available for <@{user}>"); } \ No newline at end of file diff --git a/PluralKit.Bot/Interactive/BaseInteractive.cs b/PluralKit.Bot/Interactive/BaseInteractive.cs index 779058fe..043c5b8d 100644 --- a/PluralKit.Bot/Interactive/BaseInteractive.cs +++ b/PluralKit.Bot/Interactive/BaseInteractive.cs @@ -5,6 +5,7 @@ using Myriad.Rest.Types.Requests; using Myriad.Types; using NodaTime; +using PluralKit.Core; namespace PluralKit.Bot.Interactive; @@ -47,6 +48,11 @@ public abstract class BaseInteractive new InteractionApplicationCommandCallbackData { Components = GetComponents() }); } + protected async Task Error(InteractionContext ctx, PKError error) + { + await ctx.Reply(content: $"{Emojis.Error} {error.Message}"); + } + protected async Task Finish(InteractionContext? ctx = null) { foreach (var button in _buttons) diff --git a/PluralKit.Bot/Interactive/YesNoPrompt.cs b/PluralKit.Bot/Interactive/YesNoPrompt.cs index 194dd1f1..f6de2695 100644 --- a/PluralKit.Bot/Interactive/YesNoPrompt.cs +++ b/PluralKit.Bot/Interactive/YesNoPrompt.cs @@ -43,7 +43,7 @@ public class YesNoPrompt: BaseInteractive { if (ctx.User.Id != User) { - await Update(ctx); + await Error(ctx, Errors.InteractionWrongAccount(User ?? 0)); return; } diff --git a/docs/content/staff/permissions.md b/docs/content/staff/permissions.md index 41f27747..b48cf82f 100644 --- a/docs/content/staff/permissions.md +++ b/docs/content/staff/permissions.md @@ -2,21 +2,23 @@ PluralKit requires some channel permissions in order to function properly: -- Message proxying requires the **Manage Messages** and **Manage Webhooks** permissions in a channel. -- Most commands require the **Embed Links**, **Attach Files** and **Add Reactions** permissions to function properly. +- *Everything* PluralKit does aside from the Message Info app command requires **View Channel** permissions in a channel. +- Message proxying requires the **Manage Messages**, **Manage Webhooks**, and **Send Messages** permissions in a channel. +- Most commands require the **Embed Links** and **Add Reactions** permissions to function properly. - Commands with reaction menus also require **Manage Messages** to remove reactions after clicking. + - Commands executed via reactions (for example the :x:, :bell:, and :question: reactions, as well as any commands with reaction menus) need **Read Message History** to be able to see that reactions were added. + - A couple commands (`pk;s color` and `pk;m color`) currently require **Attach Files**. - [Proxy logging](/staff/logging) requires the **Send Messages** permission in the log channel. - [Log cleanup](/staff/compatibility/#log-cleanup) requires the **Manage Messages** permission in the log channels. -Denying the **Send Messages** permission will *not* stop the bot from proxying, although it will prevent it from sending command responses. Denying the **Read Messages** permission will, as any other bot, prevent the bot from interacting in that channel at all. - ## Webhook permissions -Webhooks exist outside of the normal Discord permissions system, and (with a few exceptions) it's not possible to modify their permissions. +Webhooks exist outside of the normal Discord permissions system, but as of August 2022 they mostly follow the permissions of the webhook owner (in this case, PluralKit). -However, PluralKit will make an attempt to apply the sender account's permissions to proxied messages. For example, role mentions, `@everyone`, and `@here` +PluralKit will also make an attempt to apply the sender account's permissions to proxied messages. For example, role mentions, `@everyone`, and `@here` will only function if the sender account has that permission. The same applies to link embeds. -For external emojis to work in proxied messages, the `@everyone` role must have the "Use External Emojis" permission. If it still doesn't work, check if the permission was denied in channel-specific permission settings. +For external emojis to work in proxied messages, PluralKit or one of its roles must have the "Use External Emojis" permission. If it still doesn't work, +check if the permission was denied in channel-specific permission settings. PluralKit must also be in the server the external emoji belongs to. ## Troubleshooting @@ -30,4 +32,4 @@ For example: pk;debug permissions 466707357099884544 -You can find this ID [by enabling Developer Mode and right-clicking (or long-pressing) on the server icon](https://discordia.me/developer-mode). \ No newline at end of file +You can find this ID [by enabling Developer Mode and right-clicking (or long-pressing) on the server icon](https://discordia.me/developer-mode). diff --git a/docs/content/user-guide.md b/docs/content/user-guide.md index 51654841..cfe02c47 100644 --- a/docs/content/user-guide.md +++ b/docs/content/user-guide.md @@ -453,7 +453,7 @@ You can #### Pinging the user who sent it If you'd like to "ping" the account behind a proxied message without having to query the message and ping them yourself, -you can react to the message with the `:bell:` :bell: emoji (or `:bellhop:` :bellhop:, `:exclamation:` :exclamation:, or even `:ping_pong:` :ping_pong:), and PluralKit will ping the relevant member and account in the same channel on your behalf with a link to the message you reacted to. +you can react to the message with the `:bell:` :bell: emoji (or `:bellhop:` :bellhop_bell:, `:exclamation:` :exclamation:, or even `:ping_pong:` :ping_pong:), and PluralKit will ping the relevant member and account in the same channel on your behalf with a link to the message you reacted to. ## Autoproxy The bot's *autoproxy* feature allows you to have messages be proxied without directly including the proxy tags. Autoproxy can be set up in various ways. There are three autoproxy modes currently implemented: