import type { HelpObj } from '../../structures/commandhandler' ; import { MessageEmbed } from 'discord.js' ; import type ReknownClient from '../../structures/client' ; import fetch from 'node-fetch' ; import type { Message , PermissionString } from 'discord.js' ; interface DogResult { message : string ; status : string ; } export async function run ( client , message , args ) { const json = await fetch ( 'https://dog.ceo/api/breeds/image/random' ) . then ( res => res . json ( ) ) ; if ( json . status !== 'success' ) return message . reply ( 'Seems like the API is down, please try again later. If this problem persists, let us know in our Discord server.' ) ; const embed = new MessageEmbed ( ) . setColor ( client . config . embedColor ) . setFooter ( `Requested by ${ message . author . tag } | Powered by https://dog.ceo/dog-api` , message . author . displayAvatarURL ( ) ) . setImage ( json . message ) . setTitle ( 'Doggo!' ) ; message . channel . send ( embed ) ; } export const help = { aliases : [ ] , category : 'Fun' , desc : 'Shows a picture of a dog.' , dm : true , togglable : true , usage : 'dog' } ; export const memberPerms = [ ] ; export const permissions = [ 'EMBED_LINKS' ] ;