Merge remote-tracking branch 'upstream/main' into rust-command-parser

This commit is contained in:
dawn 2026-01-14 00:26:12 +03:00
commit 22b008df17
No known key found for this signature in database
5 changed files with 20 additions and 10 deletions

View file

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

View file

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

View file

@ -43,7 +43,7 @@ public class YesNoPrompt: BaseInteractive
{
if (ctx.User.Id != User)
{
await Update(ctx);
await Error(ctx, Errors.InteractionWrongAccount(User ?? 0));
return;
}