mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Discord.js Docs Command
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Docs = require('discord.js-docs');
|
||||
|
||||
module.exports = class DocstCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'docs',
|
||||
aliases: ['discord-js-docs', 'discord-js', 'djs', 'djs-docs'],
|
||||
group: 'search',
|
||||
memberName: 'docs',
|
||||
description: 'Searches the discord.js docs for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What do you want to search the docs for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { query }) {
|
||||
const doc = await Docs.fetch('stable');
|
||||
const embed = doc.resolveEmbed(query);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "136.3.1",
|
||||
"version": "136.4.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"private": true,
|
||||
@@ -48,6 +48,7 @@
|
||||
"didyoumean2": "^4.1.0",
|
||||
"discord.js": "^12.5.3",
|
||||
"discord.js-commando": "github:discordjs/Commando",
|
||||
"discord.js-docs": "github:TeeSeal/discord.js-docs",
|
||||
"dotenv": "^8.2.0",
|
||||
"emoji-regex": "^9.2.2",
|
||||
"eslint": "^7.24.0",
|
||||
|
||||
Reference in New Issue
Block a user