mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 22:44:32 +02:00
Move code commands to code group
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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: 'code',
|
||||
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);
|
||||
if (!embed) return msg.say('Could not find any results.');
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user