how to make a gif command discord.js code example

Example: gif command discordjs

if(command === "gif"){
          	const gifSearch =require('gif-search');
            const gif = args.join(" ")
            try{
            gifSearch.query(gif).then((gifurl) =>{
                const embed = new discord.MessageEmbed()
                    .setTitle("Result for "+saymessage)
                    .setImage(gifurl)
                    .setFooter("Requested by "+message.author.username)
                message.channel.send(embed)
            }).catch(error)}
            catch(error){message.channel.send("NO gif found")}
        }
		//I hope it helps ;)