chore(discord-bot): remove all migration related code
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user