nyx/commands/Utilities/docs.js

20 lines
532 B
JavaScript
Raw Normal View History

2021-06-14 12:53:39 +02:00
const fetch = require("node-fetch");
module.exports = {
name: "docs",
usage: "(Query)",
description: "Search the discord.js docs for something!",
run: async (client, message, args) => {
const query = args.join(" ");
if (!query) return client.err(message, "Utilities", "docs", 51);
fetch(
`https://djsdocs.sorta.moe/v2/embed?src=stable&q=${encodeURIComponent(
query
)}`
)
.then(res => res.json())
.then(data => {
message.inlineReply({ embed: data });
});
},
};