We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 411ce5d commit 057cdadCopy full SHA for 057cdad
src/handler/messageDeleteHandler.ts
@@ -13,7 +13,8 @@ import log from "#log";
13
const deleteInlineRepliesFromBot = (messageRef: Message<true>, botUser: ClientUser) =>
14
Promise.allSettled(
15
messageRef.channel.messages.cache
16
- .filter(m => m.author.id === botUser.id && m.reference?.messageId === messageRef.id)
+ // the author?. is needed because the message might not be cached, and thus author is null (which is not reflected in the type system)
17
+ .filter(m => m.author?.id === botUser.id && m.reference?.messageId === messageRef.id)
18
.map(m => m.delete()),
19
);
20
0 commit comments