Support sending reports to a specific channel in the home guild

This commit is contained in:
Dragon Fire
2020-02-28 13:59:01 -05:00
parent 3ef2ab319d
commit dde9d71a14
3 changed files with 7 additions and 1 deletions
+4
View File
@@ -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 });