From dde9d71a14349487be8b8e76346eef2439b3235b Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 28 Feb 2020 13:59:01 -0500 Subject: [PATCH] Support sending reports to a specific channel in the home guild --- .env.example | 2 ++ commands/util/report.js | 4 ++++ package.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 447c85f4..61bb2328 100644 --- a/.env.example +++ b/.env.example @@ -9,6 +9,8 @@ XIAO_WEBHOOK_TOKEN= POSTER_ID= POSTER_TOKEN= POSTER_TIME= +HOME_GUILD_ID= +REPORT_CHANNEL_ID= # Emoji IDs GOLD_FISH_EMOJI_ID= diff --git a/commands/util/report.js b/commands/util/report.js index a6211a73..4f594733 100644 --- a/commands/util/report.js +++ b/commands/util/report.js @@ -4,6 +4,7 @@ const { list } = require('../../util/Util'); const reasons = ['bug', 'feedback', 'suggestion']; const reasonColors = ['RED', 'GREEN', 'YELLOW']; const displayReasons = ['🐛 Bug Report', '📬 Feedback', '❓ Suggestion']; +const { HOME_GUILD_ID, REPORT_CHANNEL_ID } = process.env; module.exports = class ReportCommand extends Command { constructor(client) { @@ -39,6 +40,9 @@ module.exports = class ReportCommand extends Command { .setFooter(`ID: ${msg.author.id}`) .setTimestamp() .setColor(reasonColors[reason]); + if (HOME_GUILD_ID && REPORT_CHANNEL_ID) { + await this.client.guilds.cache.get(HOME_GUILD_ID).channels.cache.get(REPORT_CHANNEL_ID).send({ embed }); + } for (const owner of this.client.owners) { try { await owner.send({ embed }); diff --git a/package.json b/package.json index 77fc9c7f..828b6163 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "110.9.8", + "version": "110.9.9", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {