minor trolling

This commit is contained in:
JandereDev 2022-04-19 12:01:14 +02:00
parent d54edfdeed
commit b567de2277
Signed by: Lea
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`);
if (targetMsg.webhookId && targetMsg.webhookId == bridgeCfg.discordWebhook.id) {
const client = new WebhookClient({ id: bridgeCfg.discordWebhook.id, token: bridgeCfg.discordWebhook.token }); const client = new WebhookClient({ id: bridgeCfg.discordWebhook.id, token: bridgeCfg.discordWebhook.token });
await client.deleteMessage(bridgedMsg.discord.messageId); await client.deleteMessage(bridgedMsg.discord.messageId);
client.destroy(); 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);
} }