mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
Clean up
This commit is contained in:
+14
-7
@@ -45,15 +45,22 @@ module.exports = class ReportCommand extends Command {
|
|||||||
const channel = await this.client.channels.fetch(REPORT_CHANNEL_ID);
|
const channel = await this.client.channels.fetch(REPORT_CHANNEL_ID);
|
||||||
await channel.send({ embed });
|
await channel.send({ embed });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
for (const owner of this.client.owners) {
|
await this.sendOwnerDM(embed);
|
||||||
try {
|
|
||||||
await owner.send({ embed });
|
|
||||||
} catch (err) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
await this.sendOwnerDM(embed);
|
||||||
}
|
}
|
||||||
return msg.say(`${displayReasons[reason]} sent! Thank you!`);
|
return msg.say(`${displayReasons[reason]} sent! Thank you!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async sendOwnerDM(embed) {
|
||||||
|
for (const owner of this.client.owners) {
|
||||||
|
try {
|
||||||
|
await owner.send({ embed });
|
||||||
|
} catch (err) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user