minor trolling

This commit is contained in:
JandereDev 2022-04-19 12:01:14 +02:00
parent d54edfdeed
commit b567de2277
No known key found for this signature in database
GPG key ID: 5D5E18ACB990F57A

View file

@ -22,9 +22,13 @@ client.on('message/delete', async id => {
const targetMsg = await discordFetchMessage(bridgedMsg.discord.messageId, bridgeCfg.discord); const targetMsg = await discordFetchMessage(bridgedMsg.discord.messageId, bridgeCfg.discord);
if (!targetMsg) return logger.debug(`Revolt: Could not fetch message from Discord`); if (!targetMsg) return logger.debug(`Revolt: Could not fetch message from Discord`);
const client = new WebhookClient({ id: bridgeCfg.discordWebhook.id, token: bridgeCfg.discordWebhook.token }); if (targetMsg.webhookId && targetMsg.webhookId == bridgeCfg.discordWebhook.id) {
await client.deleteMessage(bridgedMsg.discord.messageId); const client = new WebhookClient({ id: bridgeCfg.discordWebhook.id, token: bridgeCfg.discordWebhook.token });
client.destroy(); await client.deleteMessage(bridgedMsg.discord.messageId);
client.destroy();
} else if (targetMsg.deletable) {
targetMsg.delete();
} else logger.debug(`Revolt: Unable to delete Discord message`);
} catch(e) { } catch(e) {
console.error(e); console.error(e);
} }