From 7cd0b683e2804227dc21d8f0f09c960f0e69222c Mon Sep 17 00:00:00 2001 From: MapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Sun, 19 Dec 2021 23:27:53 -0600 Subject: [PATCH] ensure message content is removed on update --- packages/reacord/src/container.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/reacord/src/container.ts b/packages/reacord/src/container.ts index 275c791..8302e78 100644 --- a/packages/reacord/src/container.ts +++ b/packages/reacord/src/container.ts @@ -76,7 +76,13 @@ export class ReacordContainer { private async runAction(action: Action) { if (action.type === "updateMessage") { this.message = await (this.message - ? this.message.edit(action.options) + ? this.message.edit({ + ...action.options, + + // need to ensure that, if there's no text, it's erased + // eslint-disable-next-line unicorn/no-null + content: action.options.content ?? null, + }) : this.channel.send(action.options)) }