Update to read contents of embeds

This commit is contained in:
Skylar Grant 2023-02-12 10:25:32 -05:00 committed by GitHub
parent 33ee3e9c4f
commit e3ed133830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -534,7 +534,8 @@ const functions = {
const filter = message => message.author.id != process.env.BOTID; const filter = message => message.author.id != process.env.BOTID;
const collector = channel.createMessageCollector({ filter }); const collector = channel.createMessageCollector({ filter });
collector.on('collect', message => { collector.on('collect', message => {
if (message.content.includes(strings.notifications.water)) { if (message.embeds.length == 0) return;
if (message.embeds[0].data.description(strings.notifications.water)) {
this.sendReminder(guildInfo, guildInfo.waterMessage, guildInfo.reminderChannelId, guild); this.sendReminder(guildInfo, guildInfo.waterMessage, guildInfo.reminderChannelId, guild);
} else if (message.content.includes(strings.notifications.fruit)) { } else if (message.content.includes(strings.notifications.fruit)) {
this.sendReminder(guildInfo, guildInfo.fruitMessage, guildInfo.reminderChannelId, guild); this.sendReminder(guildInfo, guildInfo.fruitMessage, guildInfo.reminderChannelId, guild);