Make reminders visually distinct

This commit is contained in:
Skylar Grant 2023-02-16 09:13:50 -05:00
parent d30ee5c0b8
commit cd0c088c4e
2 changed files with 28 additions and 7 deletions

View File

@ -20,6 +20,10 @@
"embeds": {
"footer": "Silvanus is not affiliated with Grow A Tree or Limbo Labs",
"color": "0x55FF55",
"waterColor": "0x5555FF",
"fruitColor": "0xCC5555",
"waterTitle": "Water Notification",
"fruitTitle": "Fruit Notification",
"roleMenuTitle": "Role Menu",
"treeRoleMenu": [
"Use the buttons below to give yourself roles.\n\n",

View File

@ -124,11 +124,21 @@ const functions = {
const messageContents = { embeds: [embed], components: [this.actionRows.comparisonActionRow(guildInfo)] };
return messageContents;
},
reminderEmbed(content, guildInfo) {
waterReminderEmbed(content, guildInfo) {
// Create the embed using the content passed to this function
const embed = new EmbedBuilder()
.setColor(strings.embeds.color)
.setTitle('Notification Relay')
.setColor(strings.embeds.waterColor)
.setTitle(strings.embeds.waterTitle)
.setDescription(`[Click here to go to your Tree](https://discord.com/channels/${guildInfo.guildId}/${guildInfo.treeChannelId}/${guildInfo.treeMessageId})`)
.setFooter({ text: `Click ♻️ to delete this message` });
const messageContents = { content: content, embeds: [embed], components: [this.actionRows.reminderActionRow()] };
return messageContents;
},
fruitReminderEmbed(content, guildInfo) {
// Create the embed using the content passed to this function
const embed = new EmbedBuilder()
.setColor(strings.embeds.fruitColor)
.setTitle(strings.embeds.fruitTitle)
.setDescription(`[Click here to go to your Tree](https://discord.com/channels/${guildInfo.guildId}/${guildInfo.treeChannelId}/${guildInfo.treeMessageId})`)
.setFooter({ text: `Click ♻️ to delete this message` });
const messageContents = { content: content, embeds: [embed], components: [this.actionRows.reminderActionRow()] };
@ -588,9 +598,16 @@ const functions = {
}, ms);
});
},
async sendReminder(guildInfo, message, channelId, guild) {
async sendWaterReminder(guildInfo, message, channelId, guild) {
const reminderChannel = await guild.channels.fetch(channelId);
const reminderEmbed = functions.builders.reminderEmbed(message, guildInfo);
const reminderEmbed = functions.builders.waterReminderEmbed(message, guildInfo);
await reminderChannel.send(reminderEmbed).catch(err => {
console.error(err);
});
},
async sendFruitReminder(guildInfo, message, channelId, guild) {
const reminderChannel = await guild.channels.fetch(channelId);
const reminderEmbed = functions.builders.fruitReminderEmbed(message, guildInfo);
await reminderChannel.send(reminderEmbed).catch(err => {
console.error(err);
});
@ -612,9 +629,9 @@ const functions = {
guildInfo = client.guildInfos.get(guild.id);
console.log(message.embeds);
if (message.embeds[0].data.description.includes(strings.notifications.water)) {
this.sendReminder(guildInfo, guildInfo.waterMessage, guildInfo.reminderChannelId, guild);
this.sendWaterReminder(guildInfo, guildInfo.waterMessage, guildInfo.reminderChannelId, guild);
} else if (message.embeds[0].data.description.includes(strings.notifications.fruit)) {
this.sendReminder(guildInfo, guildInfo.fruitMessage, guildInfo.reminderChannelId, guild);
this.sendFruitReminder(guildInfo, guildInfo.fruitMessage, guildInfo.reminderChannelId, guild);
}
});
}