mirror of
https://github.com/keanuplayz/TravBot-v3.git
synced 2024-08-15 02:33:12 +00:00
Added Discord.JS Docs command.
This commit is contained in:
parent
c980a182f8
commit
51d19d5787
1 changed files with 17 additions and 0 deletions
17
src/commands/utility/docs.ts
Normal file
17
src/commands/utility/docs.ts
Normal 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});
|
||||
}
|
||||
})
|
||||
});
|
Loading…
Reference in a new issue