Skip to content

Instantly share code, notes, and snippets.

@zero734kr
Created March 8, 2020 17:21
Show Gist options
  • Save zero734kr/8cd82fc4595cefb5f823038b9ee6fa79 to your computer and use it in GitHub Desktop.
Save zero734kr/8cd82fc4595cefb5f823038b9ee6fa79 to your computer and use it in GitHub Desktop.
const fetch = require("node-fetch")
exports.run = async(client, message, args) => {
let query = args.join(" ")
if (!query) return message.channel.send(`${message.author} 님, 검색할 키워드를 입력 해주세요.`)
const body = await fetch(`https://djsdocs.sorta.moe/v2/embed?src=https://raw.githubusercontent.com/discordjs/discord.js/docs/stable.json&q=${encodeURI(query)}`).then(res => res.json())
if (!body) return message.channel.send(`${message.author} 님, 검색 결과가 없습니다.`)
body.author = { name: "Discord.js Docs - [stable]" }
const embed = new (require("discord.js").MessageEmbed)(body)
embed.setFooter(message.author.tag, message.author.avatarURL({ format: "png" }))
message.channel.send(embed)
}
module.exports = {
name: "docs",
aliases: ["doc", "djsdocs", "문서", "등등"],
description: "ㅁㄴㅇㄹ",
usage: "docs [query]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment