From 6f1b95809acc74b0a81aa162e5be9a372820fb13 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 20 Feb 2023 03:40:23 +0100 Subject: Temporary commit. Signed-off-by: TheArcaneBrony --- src/util/entities/Message.ts | 2 ++ .../plural_tooling/PluralCommandInterceptor.ts | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index 998513f8..37782609 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -219,6 +219,8 @@ export class Message extends BaseClass { components?: MessageComponent[]; ephemeral?: boolean; + + intercepted?: boolean = false; } export interface MessageComponent { diff --git a/src/util/message_interceptors/plural_tooling/PluralCommandInterceptor.ts b/src/util/message_interceptors/plural_tooling/PluralCommandInterceptor.ts index ac6bb153..13c7b45e 100644 --- a/src/util/message_interceptors/plural_tooling/PluralCommandInterceptor.ts +++ b/src/util/message_interceptors/plural_tooling/PluralCommandInterceptor.ts @@ -30,14 +30,15 @@ export class PluralCommandInterceptor implements IMessageInterceptor { } as MessageDeleteEvent);*/ //result.message.flags = String((BigInt(ctx.message.flags ?? "0")) | MessageTypes.); // @ts-ignore - result.message.ephemeral = true; - result.message.content += ' (ephemeral?)'; - /*await emitEvent({ + result.message.content += ' (ephemeral, interceptor: PluralCommandInterceptor)'; + //prevent sending via gateway and storing: + result.message.id = "0"; // this is implied by `result.cancel = true`, we're setting it for the following emitEvent + await emitEvent({ event: "MESSAGE_CREATE", //channel_id: ctx.opts.channel_id, user_id: ctx.opts.author_id, - data: ctx.message.toJSON(), - } as MessageCreateEvent);*/ + data: result.message.toJSON(), + } as MessageCreateEvent); } return result; -- cgit 1.4.1