summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/util/entities/Message.ts2
-rw-r--r--src/util/message_interceptors/plural_tooling/PluralCommandInterceptor.ts11
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;