mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Remove private stuff
This commit is contained in:
@@ -5,13 +5,19 @@ module.exports = class CommandLastRunExportCommand extends Command {
|
||||
super(client, {
|
||||
name: 'command-last-run-export',
|
||||
aliases: [
|
||||
'lr-export',
|
||||
'lrlb-export',
|
||||
'last-run-export',
|
||||
'cmd-lr-export',
|
||||
'cmd-last-run-export',
|
||||
'command-lr-export',
|
||||
'export-cmd-lr',
|
||||
'export-cmd-last-run',
|
||||
'export-command-lr',
|
||||
'export-command-last-run'
|
||||
'export-command-last-run',
|
||||
'export-lr',
|
||||
'export-lrlb',
|
||||
'export-last-run'
|
||||
],
|
||||
group: 'util',
|
||||
memberName: 'command-last-run-export',
|
||||
|
||||
@@ -5,13 +5,19 @@ module.exports = class CommandLastRunImportCommand extends Command {
|
||||
super(client, {
|
||||
name: 'command-last-run-import',
|
||||
aliases: [
|
||||
'lr-import',
|
||||
'lrlb-import',
|
||||
'last-run-import',
|
||||
'cmd-lr-import',
|
||||
'cmd-last-run-import',
|
||||
'command-lr-import',
|
||||
'import-cmd-lr',
|
||||
'import-cmd-last-run',
|
||||
'import-command-lr',
|
||||
'import-command-last-run'
|
||||
'import-command-last-run',
|
||||
'import-lr',
|
||||
'import-lrlb',
|
||||
'import-last-run'
|
||||
],
|
||||
group: 'util',
|
||||
memberName: 'command-last-run-import',
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { sortByName, embedURL } = require('../../util/Util');
|
||||
|
||||
module.exports = class GenerateCreditCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'generate-credit',
|
||||
aliases: ['gen-credit'],
|
||||
group: 'util',
|
||||
memberName: 'generate-credit',
|
||||
description: 'Generates the credit list for Xiao\'s README.',
|
||||
details: 'Only the bot owner(s) may use this command.',
|
||||
ownerOnly: true,
|
||||
guarded: true
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
let credit = [];
|
||||
for (const command of this.client.registry.commands.values()) {
|
||||
if (!command.credit || command.credit.length <= 1) continue;
|
||||
for (const cred of command.credit) {
|
||||
const found = credit.find(c => c.name === cred.name);
|
||||
if (found) {
|
||||
found.commands.push({
|
||||
name: command.name,
|
||||
reason: cred.reason,
|
||||
reasonURL: cred.reasonURL
|
||||
});
|
||||
continue;
|
||||
}
|
||||
if (cred.name === 'Dragon Fire') continue;
|
||||
credit.push({
|
||||
name: cred.name,
|
||||
url: cred.url,
|
||||
commands: [{
|
||||
name: command.name,
|
||||
reason: cred.reason,
|
||||
reasonURL: cred.reasonURL
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
credit = sortByName(credit, 'name');
|
||||
const mapped = credit
|
||||
.map(c => `- ${embedURL(c.name, c.url || '', false)}\n${sortByName(c.commands, 'name').map(cmd => {
|
||||
if (!cmd.reasonURL) return ` * ${cmd.name} (${cmd.reason})`;
|
||||
return ` * ${cmd.name} (${embedURL(cmd.reason, cmd.reasonURL || '', false)})`;
|
||||
}).join('\n')}`);
|
||||
await msg.direct({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] });
|
||||
return msg.say('📬 Sent `credit.txt` to your DMs!');
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { formatNumber } = require('../../util/Util');
|
||||
|
||||
module.exports = class GenerateFunInformationCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'generate-fun-information',
|
||||
aliases: ['gen-fun-information', 'generate-fun-info', 'gen-fun-info', 'generate-fun', 'gen-fun'],
|
||||
group: 'util',
|
||||
memberName: 'generate-fun-information',
|
||||
description: 'Generates the "Fun Information" for Xiao\'s README.',
|
||||
details: 'Only the bot owner(s) may use this command.',
|
||||
ownerOnly: true,
|
||||
guarded: true
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const cloc = await this.client.registry.commands.get('cloc').cloc();
|
||||
const text = stripIndents`
|
||||
- ${formatNumber(Math.floor(this.client.registry.commands.size / 100) * 100)}+ commands
|
||||
- ${formatNumber(Math.floor(cloc.JavaScript.code / 1000) * 1000)}+ lines of JavaScript
|
||||
- ${formatNumber(Math.floor(cloc.JSON.code / 1000) * 1000)}+ lines of JSON data
|
||||
- ${new Date().getFullYear() - 2017} years of development
|
||||
`;
|
||||
await msg.direct({ files: [{ attachment: Buffer.from(text), name: 'fun-information.txt' }] });
|
||||
return msg.say('📬 Sent `fun-information.txt` to your DMs!');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user