chore(discord-bot): remove all migration related code
All checks were successful
Build and Deploy / typecheck (push) Successful in 27s
Build and Deploy / build (push) Successful in 28s
Build and Deploy / deploy (push) Successful in 2s

This commit is contained in:
2026-05-30 22:13:13 +02:00
parent 82eb239f5e
commit 4059ea1ddf
2 changed files with 1 additions and 36 deletions

View File

@@ -248,39 +248,6 @@ export const handleDeleteButton = async (interaction: ButtonInteraction, reportI
await interaction.editReply({ content: "Signalement supprimé." });
};
export const migrateReportEmbeds = async (client: Client<true>) => {
const reports = await db.select().from(tables.reports);
let migrated = 0;
let failed = 0;
for (const report of reports) {
if (!report.messageLink) continue;
const parts = report.messageLink.split("/");
const channelId = parts.at(-2);
const messageId = parts.at(-1);
if (!channelId || !messageId) continue;
try {
const channel = await client.channels.fetch(channelId);
if (channel?.type !== ChannelType.GuildText) continue;
const message = await channel.messages.fetch(messageId);
await message.edit({
embeds: [buildReportEmbed(report)],
components: [reportActionRow(report.id)],
});
migrated++;
} catch {
logger.warn(`Embed migration failed for report ${report.id}`);
failed++;
}
await new Promise(resolve => setTimeout(resolve, 500));
}
logger.info(`Embed migration complete: ${migrated} updated, ${failed} failed`);
};
export const handleEditModal = async (interaction: ModalSubmitInteraction, client: Client, reportId: string, channelId: string, messageId: string) => {
const reason = interaction.fields.getTextInputValue("reason");