diff --git a/src/NoEmbed.ts b/src/NoEmbed.ts index 65f72df..fa10fc2 100644 --- a/src/NoEmbed.ts +++ b/src/NoEmbed.ts @@ -69,13 +69,13 @@ const make = Effect.gen(function* () { yield* getChannel(event.guild_id!, event.channel_id).pipe( Effect.flatMap(EligibleChannel), ) - const message = event.content - ? event - : yield* rest - .getChannelMessage(event.channel_id, event.id) - .json.pipe(Effect.flatMap(EligibleMessage)) + const message = yield* EligibleMessage( + event.content + ? event + : yield* rest.getChannelMessage(event.channel_id, event.id).json, + ) yield* rest.editMessage(message.channel_id, message.id, { - flags: message.flags! | Discord.MessageFlag.SUPPRESS_EMBEDS, + flags: message.flags | Discord.MessageFlag.SUPPRESS_EMBEDS, }) }).pipe( Effect.withSpan("NoEmbed.handleMessage"),