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

@@ -4,14 +4,12 @@ import { env } from "~/env";
import { questCheckCron } from "~/quests";
import { trackingCron } from "~/tracking";
import { commands } from "~/commands";
import { handleReportButton, handleReportModal, handleEditButton, handleDeleteButton, handleEditModal, migrateReportEmbeds, REPORT_BUTTON_ID, REPORT_MODAL_ID, REPORT_EDIT_BUTTON_PREFIX, REPORT_DELETE_BUTTON_PREFIX, REPORT_EDIT_MODAL_PREFIX } from "~/reporting";
import { handleReportButton, handleReportModal, handleEditButton, handleDeleteButton, handleEditModal, REPORT_BUTTON_ID, REPORT_MODAL_ID, REPORT_EDIT_BUTTON_PREFIX, REPORT_DELETE_BUTTON_PREFIX, REPORT_EDIT_MODAL_PREFIX } from "~/reporting";
const onReady = async (client: Client<true>) => {
logger.info(`Client ready`);
logger.info(`Connected as @${client.user.username}`);
void migrateReportEmbeds(client);
await questCheckCron(client);
setInterval(() => void questCheckCron(client), env.WOV_FETCH_INTERVAL);

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");