From 51d19d5787ea79e34d01da7c0224ceb28f65af2b Mon Sep 17 00:00:00 2001 From: Keanu Date: Sun, 11 Apr 2021 10:58:06 +0200 Subject: [PATCH] Added Discord.JS Docs command. --- src/commands/utility/docs.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/commands/utility/docs.ts diff --git a/src/commands/utility/docs.ts b/src/commands/utility/docs.ts new file mode 100644 index 0000000..8c1d74b --- /dev/null +++ b/src/commands/utility/docs.ts @@ -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}); + } + }) +});