mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 08:22:37 +02:00
Fix
This commit is contained in:
+10
-6
@@ -81,15 +81,19 @@ module.exports = class XiaoClient extends CommandoClient {
|
|||||||
|
|
||||||
exportBlacklist() {
|
exportBlacklist() {
|
||||||
let text = '{\n "guild": [\n ';
|
let text = '{\n "guild": [\n ';
|
||||||
for (const id of this.blacklist.guild) {
|
if (this.blacklist.guild.length) {
|
||||||
text += `"${id}",\n `;
|
for (const id of this.blacklist.guild) {
|
||||||
|
text += `"${id}",\n `;
|
||||||
|
}
|
||||||
|
text = text.slice(0, -4);
|
||||||
}
|
}
|
||||||
text = text.slice(0, -4);
|
|
||||||
text += '\n ],\n "user": [\n ';
|
text += '\n ],\n "user": [\n ';
|
||||||
for (const id of this.blacklist.user) {
|
if (this.blacklist.user.length) {
|
||||||
text += `"${id}",\n `;
|
for (const id of this.blacklist.user) {
|
||||||
|
text += `"${id}",\n `;
|
||||||
|
}
|
||||||
|
text = text.slice(0, -4);
|
||||||
}
|
}
|
||||||
text = text.slice(0, -4);
|
|
||||||
text += '\n ]\n}\n';
|
text += '\n ]\n}\n';
|
||||||
const buf = Buffer.from(text);
|
const buf = Buffer.from(text);
|
||||||
fs.writeFileSync(path.join(__dirname, '..', 'blacklist.json'), buf, { encoding: 'utf8' });
|
fs.writeFileSync(path.join(__dirname, '..', 'blacklist.json'), buf, { encoding: 'utf8' });
|
||||||
|
|||||||
Reference in New Issue
Block a user