import { Message, EmbedOptions } from 'eris'; import axios, { AxiosResponse } from 'axios'; import { Client, Command, RichEmbed } from '../class'; export default class DJS extends Command { constructor(client: Client) { super(client); this.name = 'djs'; this.description = 'Get information about Discord.js.'; this.usage = 'djs '; this.permissions = 0; this.guildOnly = false; this.enabled = true; } public async run(message: Message, args: string[]) { try { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); const { data }: AxiosResponse = await axios.get(`https://djsdocs.sorta.moe/v2/embed?src=master&q=${args[0]}`); if (!data) return this.error(message.channel, 'Could not find information. Try something else.'); const embed = new RichEmbed(data); return message.channel.createMessage({ embed }); } catch (err) { return this.client.util.handleError(err, message, this); } } }