mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
Export to dm in owner only stuff
This commit is contained in:
@@ -22,8 +22,9 @@ module.exports = class CommandLeaderboardExportCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(msg) {
|
async run(msg) {
|
||||||
const result = this.client.exportCommandLeaderboard();
|
const result = this.client.exportCommandLeaderboard();
|
||||||
return msg.say({ files: [{ attachment: result, name: 'command-leaderboard.json' }] });
|
await msg.direct({ files: [{ attachment: result, name: 'command-leaderboard.json' }] });
|
||||||
|
return msg.say('📬 Sent \`command-leaderboard.json\` to your DMs!');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ module.exports = class GenerateCommandsCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(msg) {
|
async run(msg) {
|
||||||
const list = this.client.registry.groups
|
const list = this.client.registry.groups
|
||||||
.map(g => {
|
.map(g => {
|
||||||
const commands = g.commands.filter(c => !c.hidden);
|
const commands = g.commands.filter(c => !c.hidden);
|
||||||
@@ -24,6 +24,7 @@ module.exports = class GenerateCommandsCommand extends Command {
|
|||||||
}).join('\n')}`;
|
}).join('\n')}`;
|
||||||
});
|
});
|
||||||
const text = `Total: ${this.client.registry.commands.size}\n${list.join('\n')}`;
|
const text = `Total: ${this.client.registry.commands.size}\n${list.join('\n')}`;
|
||||||
return msg.say({ files: [{ attachment: Buffer.from(text), name: 'commands.txt' }] });
|
await msg.direct({ files: [{ attachment: Buffer.from(text), name: 'commands.txt' }] });
|
||||||
|
return msg.say('📬 Sent \`commands.txt\` to your DMs!');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ module.exports = class GenerateCreditCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(msg) {
|
async run(msg) {
|
||||||
let credit = [];
|
let credit = [];
|
||||||
for (const command of this.client.registry.commands.values()) {
|
for (const command of this.client.registry.commands.values()) {
|
||||||
if (!command.credit || command.credit.length <= 1) continue;
|
if (!command.credit || command.credit.length <= 1) continue;
|
||||||
@@ -47,6 +47,7 @@ module.exports = class GenerateCreditCommand extends Command {
|
|||||||
if (!cmd.reasonURL) return ` * ${cmd.name} (${cmd.reason})`;
|
if (!cmd.reasonURL) return ` * ${cmd.name} (${cmd.reason})`;
|
||||||
return ` * ${cmd.name} (${embedURL(cmd.reason, cmd.reasonURL || '', false)})`;
|
return ` * ${cmd.name} (${embedURL(cmd.reason, cmd.reasonURL || '', false)})`;
|
||||||
}).join('\n')}`);
|
}).join('\n')}`);
|
||||||
return msg.say({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] });
|
await msg.direct({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] });
|
||||||
|
return msg.say('📬 Sent \`credit.txt\` to your DMs!');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const { verify } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class GenerateProcessEnvCommand extends Command {
|
module.exports = class GenerateProcessEnvCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -16,7 +17,7 @@ module.exports = class GenerateProcessEnvCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(msg) {
|
async run(msg) {
|
||||||
const data = fs.readFileSync(path.join(__dirname, '..', '..', '.env.example'), { encoding: 'utf8' });
|
const data = fs.readFileSync(path.join(__dirname, '..', '..', '.env.example'), { encoding: 'utf8' });
|
||||||
const list = data.split('\n').map(line => {
|
const list = data.split('\n').map(line => {
|
||||||
if (!line) return '';
|
if (!line) return '';
|
||||||
@@ -24,6 +25,7 @@ module.exports = class GenerateProcessEnvCommand extends Command {
|
|||||||
line = line.replace('=', '');
|
line = line.replace('=', '');
|
||||||
return `${line}="${process.env[line] || ''}"`;
|
return `${line}="${process.env[line] || ''}"`;
|
||||||
}).join('\n');
|
}).join('\n');
|
||||||
return msg.say({ files: [{ attachment: Buffer.from(list), name: 'process.env.txt' }] });
|
await msg.direct({ files: [{ attachment: Buffer.from(list), name: 'process.env.txt' }] });
|
||||||
|
return msg.say('📬 Sent \`process.env.txt\` to your DMs!');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ module.exports = class ShutdownCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { code }) {
|
async run(msg, { code }) {
|
||||||
this.uses++;
|
this.uses++;
|
||||||
this.client.exportCommandLeaderboard();
|
this.client.exportCommandLeaderboard();
|
||||||
this.client.logger.info('[SHUTDOWN] Manual shutdown engaged.');
|
this.client.logger.info('[SHUTDOWN] Manual shutdown engaged.');
|
||||||
|
await msg.say('Shutting down... :(');
|
||||||
process.exit(code);
|
process.exit(code);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "116.3.0",
|
"version": "116.3.1",
|
||||||
"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