mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
generate fun information command
This commit is contained in:
@@ -86,7 +86,7 @@ don't grant that permission.
|
||||
|
||||
## Fun Information
|
||||
- 500+ Commands
|
||||
- 25,000+ lines of JavaScript
|
||||
- 26,000+ lines of JavaScript
|
||||
- 61,000+ lines of JSON data
|
||||
- 3 years of development
|
||||
- 4,000+ commits
|
||||
@@ -232,7 +232,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 510
|
||||
Total: 511
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -256,6 +256,7 @@ Total: 510
|
||||
* **command-leaderboard-import:** Imports a command leaderboard JSON file. (Owner-Only)
|
||||
* **generate-commands:** Generates the commands list for Xiao's README. (Owner-Only)
|
||||
* **generate-credit:** Generates the credit list for Xiao's README. (Owner-Only)
|
||||
* **generate-fun-information:** Generates the "Fun Information" for Xiao's README. (Owner-Only)
|
||||
* **generate-process-env:** Generates a backup list of Xiao's `process.env`. (Owner-Only)
|
||||
* **ip:** Responds with the IP address the bot's server is running on. (Owner-Only)
|
||||
* **shutdown:** Shuts down the bot. (Owner-Only)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
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!');
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "117.6.0",
|
||||
"version": "117.7.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user