Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type GuildTextBasedChannel,
type Collection,
type Message,
GuildPremiumTier,

Check warning on line 5 in packages/bot/src/functions/moderation/batch/channelMoveExecutor.ts

View workflow job for this annotation

GitHub Actions / quality / Lint (lint)

'GuildPremiumTier' is defined but never used. Allowed unused vars must match /^_/u
PermissionFlagsBits,
} from 'discord.js'
import {
Expand Down Expand Up @@ -141,6 +141,20 @@
}
}

// Re-validate client connection mid-loop
const currentClient = getStoredClient() as CustomClient | null
if (!currentClient) {
debugLog({
message: `Bot disconnected during batch job ${jobId}, pausing execution`,
})
return {
moved: movedMessages.length,
failed: failedIds.length,
skipped,
paused: true,
Comment thread
LucasSantana-Dev marked this conversation as resolved.
Resolved
}
}

// Fetch a page of messages
const messages = (await sourceChannel.messages
.fetch({
Expand Down Expand Up @@ -197,7 +211,16 @@
tooLarge,
})

const files = await fetchAttachments(toUpload)
let files: any[] = []

Check failure on line 214 in packages/bot/src/functions/moderation/batch/channelMoveExecutor.ts

View workflow job for this annotation

GitHub Actions / quality / Lint (lint)

Unexpected any. Specify a different type

Check failure on line 214 in packages/bot/src/functions/moderation/batch/channelMoveExecutor.ts

View workflow job for this annotation

GitHub Actions / Checks

Unexpected any. Specify a different type
try {
files = await fetchAttachments(toUpload)
Comment thread
LucasSantana-Dev marked this conversation as resolved.
Resolved
} catch (fetchError) {
errorLog({
message: `Failed to fetch attachments for message ${message.id}, continuing without files`,
error: fetchError,
})
// Continue with empty files array — embed will be posted without attachments
}

const movedMessage = await destChannel.send({
embeds: [embed],
Expand Down
Loading