2021-09-17 18:28:39 +02:00
|
|
|
const axios = require("axios");
|
2021-09-06 12:38:25 +02:00
|
|
|
module.exports = {
|
|
|
|
name: "docs",
|
|
|
|
usage: "(Query)",
|
|
|
|
description: "Search the discord.js docs for something!",
|
|
|
|
type: "CHAT_INPUT",
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
type: 3,
|
|
|
|
name: "query",
|
|
|
|
description: "The query you want to search",
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
run: async (client, interaction, args) => {
|
|
|
|
const query = args.join(" ");
|
2021-09-17 18:28:39 +02:00
|
|
|
await axios
|
|
|
|
.get(
|
|
|
|
`https://djsdocs.sorta.moe/v2/embed?src=stable&q=${encodeURIComponent(
|
|
|
|
query
|
|
|
|
)}`
|
|
|
|
)
|
2021-09-06 12:38:25 +02:00
|
|
|
.then(async data => {
|
2021-11-18 18:56:42 +01:00
|
|
|
interaction.followUp({ embeds: [data.data] });
|
2021-09-06 12:38:25 +02:00
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|