mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 00:07:36 +02:00
Use txt files in README generator commands
This commit is contained in:
@@ -724,9 +724,6 @@ here.
|
|||||||
* brony-speak ([Original "My Little Pony: Friendship is Magic" Show](https://mylittlepony.hasbro.com/en-us))
|
* brony-speak ([Original "My Little Pony: Friendship is Magic" Show](https://mylittlepony.hasbro.com/en-us))
|
||||||
* connect-four (Original "Connect Four" Game)
|
* connect-four (Original "Connect Four" Game)
|
||||||
* scrabble-score ([Original Scrabble Game](https://scrabble.hasbro.com/en-us))
|
* scrabble-score ([Original Scrabble Game](https://scrabble.hasbro.com/en-us))
|
||||||
- [Hastebin](https://hastebin.com/about.md)
|
|
||||||
* generate-commands (API)
|
|
||||||
* generate-credit (API)
|
|
||||||
- [Horst Faas](https://en.wikipedia.org/wiki/Horst_Faas)
|
- [Horst Faas](https://en.wikipedia.org/wiki/Horst_Faas)
|
||||||
* vietnam-flashbacks (Image)
|
* vietnam-flashbacks (Image)
|
||||||
- [HTTP Cats](https://http.cat/)
|
- [HTTP Cats](https://http.cat/)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const request = require('node-superfetch');
|
|
||||||
|
|
||||||
module.exports = class GenerateCommandsCommand extends Command {
|
module.exports = class GenerateCommandsCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -11,25 +10,15 @@ module.exports = class GenerateCommandsCommand extends Command {
|
|||||||
description: 'Generates the commands list for Xiao\'s README.',
|
description: 'Generates the commands list for Xiao\'s README.',
|
||||||
details: 'Only the bot owner(s) may use this command.',
|
details: 'Only the bot owner(s) may use this command.',
|
||||||
ownerOnly: true,
|
ownerOnly: true,
|
||||||
guarded: true,
|
guarded: true
|
||||||
credit: [
|
|
||||||
{
|
|
||||||
name: 'Hastebin',
|
|
||||||
url: 'https://hastebin.com/about.md',
|
|
||||||
reason: 'API'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg) {
|
run(msg) {
|
||||||
const list = this.client.registry.groups
|
const list = this.client.registry.groups
|
||||||
.map(g => `\n### ${g.name}:\n\n${g.commands.filter(c => !c.hidden).map(
|
.map(g => `\n### ${g.name}:\n\n${g.commands.filter(c => !c.hidden).map(
|
||||||
c => `* **${c.name}:** ${c.description}${c.ownerOnly ? ' (Owner-Only)' : ''}${c.nsfw ? ' (NSFW)' : ''}`
|
c => `* **${c.name}:** ${c.description}${c.ownerOnly ? ' (Owner-Only)' : ''}${c.nsfw ? ' (NSFW)' : ''}`
|
||||||
).join('\n')}`);
|
).join('\n')}`);
|
||||||
const { body } = await request
|
return msg.channel.send({ files: [{ attachment: Buffer.from(list), name: 'commands.txt' }] });
|
||||||
.post('https://hastebin.com/documents')
|
|
||||||
.send(`Total: ${this.client.registry.commands.size}\n${list.join('\n')}`);
|
|
||||||
return msg.say(`https://hastebin.com/raw/${body.key}`);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,18 +12,11 @@ module.exports = class GenerateCreditCommand extends Command {
|
|||||||
description: 'Generates the credit list for Xiao\'s README.',
|
description: 'Generates the credit list for Xiao\'s README.',
|
||||||
details: 'Only the bot owner(s) may use this command.',
|
details: 'Only the bot owner(s) may use this command.',
|
||||||
ownerOnly: true,
|
ownerOnly: true,
|
||||||
guarded: true,
|
guarded: true
|
||||||
credit: [
|
|
||||||
{
|
|
||||||
name: 'Hastebin',
|
|
||||||
url: 'https://hastebin.com/about.md',
|
|
||||||
reason: 'API'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg) {
|
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;
|
||||||
@@ -55,9 +48,6 @@ 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} ([${cmd.reason}](${cmd.reasonURL}))`;
|
return ` * ${cmd.name} ([${cmd.reason}](${cmd.reasonURL}))`;
|
||||||
}).join('\n')}`);
|
}).join('\n')}`);
|
||||||
const { body } = await request
|
return msg.channel.send({ files: [{ attachment: Buffer.from(mapped), name: 'credit.txt' }] });
|
||||||
.post('https://hastebin.com/documents')
|
|
||||||
.send(mapped.join('\n'));
|
|
||||||
return msg.say(`https://hastebin.com/raw/${body.key}`);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "112.12.0",
|
"version": "112.12.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