Skip to content

Commit f030ea2

Browse files
committed
🐛 fix: check for author before trying to access author.id
1 parent fcf39a6 commit f030ea2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/commands/moderation/repel.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,15 @@ const handleDeleteMessages = async ({
144144
lookBack: number;
145145
}) => {
146146
let deleted = 0;
147-
console.log({ '😭 targetId': target.id });
148147
const failedChannels: string[] = [];
149148
await Promise.allSettled(
150149
channels.map(async (channel) => {
151150
try {
152151
const messages = channel.messages.cache;
153152
const targetMessages = messages
154153
.filter((message) => {
155-
console.log({
156-
'😭 message author id': message.author.id,
157-
});
158154
return (
155+
message.author &&
159156
message.author.id === target.id &&
160157
message.deletable &&
161158
Date.now() - message.createdTimestamp < lookBack

0 commit comments

Comments
 (0)