Added Discord.JS Docs command.

This commit is contained in:
Keanu Timmermans 2021-04-11 10:58:06 +02:00
parent c980a182f8
commit 51d19d5787
Signed by: keanucode
GPG key ID: A7431C0D513CA93B

View file

@ -0,0 +1,17 @@
import {NamedCommand, RestCommand} from "../../core";
import {URL} from "url";
import {getContent} from "../../lib";
export default new NamedCommand({
description: "Provides you with info from the Discord.JS docs.",
run: "You need to specify a term to query the docs with.",
any: new RestCommand({
description: "What to query the docs with.",
async run({send, args}) {
var queryString = args[0];
let url = new URL(`https://djsdocs.sorta.moe/v2/embed?src=master&q=${queryString}`);
const content = await getContent(url.toString());
return send({embed: content});
}
})
});