From e21e6e510f580b8f59c117b15b7fb7cba0192e5f Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 17 Feb 2023 14:44:43 -0500 Subject: [PATCH] Add ability to manually send ping from watch chan --- main.js | 4 ++-- modules/functions.js | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 20cd257..9b8f634 100644 --- a/main.js +++ b/main.js @@ -4,7 +4,7 @@ const dotenv = require('dotenv'); dotenv.config(); const token = process.env.TOKEN; -const statusChannelId = process.env.statusChannelId; +const statusChannelId = process.env.STATUSCHANNELID; // Discord.JS const { Client, GatewayIntentBits, Partials, ActivityType } = require('discord.js'); @@ -25,7 +25,7 @@ const client = new Client({ const fn = require('./modules/functions.js'); const strings = require('./data/strings.json'); const dbfn = require('./modules/dbfn.js'); -const isDev = process.env.isDev; +const isDev = process.env.DEBUG; client.once('ready', async () => { await fn.collectionBuilders.slashCommands(client); diff --git a/modules/functions.js b/modules/functions.js index 72d0a4f..ef1f18d 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -621,10 +621,18 @@ const functions = { // console.log(guildInfo instanceof GuildInfo); const channel = await guild.channels.fetch(guildInfo.watchChannelId); const filter = message => { - return message.author.id != process.env.BOTID && message.embeds != undefined; + return message.author.id != process.env.BOTID; } const collector = channel.createMessageCollector({ filter }); collector.on('collect', message => { + if (message.content.toLowerCase().includes("water ping")) { + this.sendWaterReminder(guildInfo, guildInfo.waterMessage, guildInfo.reminderChannelId, guild); + return; + } else if (message.content.toLowerCase().includes("fruit ping")) { + this.sendFruitReminder(guildInfo, guildInfo.fruitMessage, guildInfo.reminderChannelId, guild); + return; + } + if (message.embeds == undefined) return; if (message.embeds.length == 0) return; guildInfo = client.guildInfos.get(guild.id); if (message.embeds[0].data.description.includes(strings.notifications.water)) {