mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 10:45:27 +00:00
minor trolling
This commit is contained in:
parent
d54edfdeed
commit
b567de2277
|
@ -22,9 +22,13 @@ client.on('message/delete', async id => {
|
|||
const targetMsg = await discordFetchMessage(bridgedMsg.discord.messageId, bridgeCfg.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 });
|
||||
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) {
|
||||
console.error(e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue