Self-destructing water relay

This commit is contained in:
Skylar Grant 2023-02-20 14:14:54 -05:00
parent 30c43ee0cf
commit 989d26af83
1 changed files with 6 additions and 1 deletions

View File

@ -688,7 +688,12 @@ const functions = {
async sendWaterReminder(guildInfo, message, channelId, guild) { async sendWaterReminder(guildInfo, message, channelId, guild) {
const reminderChannel = await guild.channels.fetch(channelId); const reminderChannel = await guild.channels.fetch(channelId);
const reminderEmbed = functions.builders.waterReminderEmbed(message, guildInfo); 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); console.error(err);
}); });
}, },