import type { Message , TextChannel } from "eris" ; import { Command } from "../../classes/Command" ; import axios from "axios" ; export class DogCommand extends Command { aliases = [ "puppy" ] ; description = "Sends a random picture of a dog." ; cooldown = 3000 ; allowdms = true ; async run ( msg ) { const body = await axios . get ( "https://random.dog/woof.json" ) . catch ( ( ) => { } ) ; if ( ! body || ! body . data ?. url ) { return msg . createEmbed ( msg . string ( "global.ERROR" ) , msg . string ( "global.RESERROR_IMAGE" ) , "error" ) ; } msg . channel . createMessage ( { embed : { title : `🐶 ${ msg . string ( "image.DOG" ) }` , color : msg . convertHex ( "general" ) , image : { url : body . data . url , } , footer : { text : msg . string ( "global.RAN_BY" , { author : msg . tagUser ( msg . author ) , poweredBy : "random.dog" , } ) , icon_url : msg . author . dynamicAvatarURL ( ) , } , } , } ) ; } }