mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Support sending reports to a specific channel in the home guild
This commit is contained in:
@@ -9,6 +9,8 @@ XIAO_WEBHOOK_TOKEN=
|
|||||||
POSTER_ID=
|
POSTER_ID=
|
||||||
POSTER_TOKEN=
|
POSTER_TOKEN=
|
||||||
POSTER_TIME=
|
POSTER_TIME=
|
||||||
|
HOME_GUILD_ID=
|
||||||
|
REPORT_CHANNEL_ID=
|
||||||
|
|
||||||
# Emoji IDs
|
# Emoji IDs
|
||||||
GOLD_FISH_EMOJI_ID=
|
GOLD_FISH_EMOJI_ID=
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const { list } = require('../../util/Util');
|
|||||||
const reasons = ['bug', 'feedback', 'suggestion'];
|
const reasons = ['bug', 'feedback', 'suggestion'];
|
||||||
const reasonColors = ['RED', 'GREEN', 'YELLOW'];
|
const reasonColors = ['RED', 'GREEN', 'YELLOW'];
|
||||||
const displayReasons = ['🐛 Bug Report', '📬 Feedback', '❓ Suggestion'];
|
const displayReasons = ['🐛 Bug Report', '📬 Feedback', '❓ Suggestion'];
|
||||||
|
const { HOME_GUILD_ID, REPORT_CHANNEL_ID } = process.env;
|
||||||
|
|
||||||
module.exports = class ReportCommand extends Command {
|
module.exports = class ReportCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -39,6 +40,9 @@ module.exports = class ReportCommand extends Command {
|
|||||||
.setFooter(`ID: ${msg.author.id}`)
|
.setFooter(`ID: ${msg.author.id}`)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(reasonColors[reason]);
|
.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) {
|
for (const owner of this.client.owners) {
|
||||||
try {
|
try {
|
||||||
await owner.send({ embed });
|
await owner.send({ embed });
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "110.9.8",
|
"version": "110.9.9",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user