From 989d26af83ce25b881243a630f098ed0e5672e3e Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 20 Feb 2023 14:14:54 -0500 Subject: [PATCH] Self-destructing water relay --- modules/functions.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/functions.js b/modules/functions.js index 055f428..9554bec 100755 --- a/modules/functions.js +++ b/modules/functions.js @@ -688,7 +688,12 @@ const functions = { async sendWaterReminder(guildInfo, message, channelId, guild) { const reminderChannel = await guild.channels.fetch(channelId); const reminderEmbed = functions.builders.waterReminderEmbed(message, guildInfo); - await reminderChannel.send(reminderEmbed).catch(err => { + await reminderChannel.send(reminderEmbed).then(async m => { + if (!m.deletable) return; + await this.sleep(500).then(async () => { + await m.delete().catch(e => console.error(e)); + }); + }).catch(err => { console.error(err); }); },