how to use the random image command

I’m trying to do a random picture selection using my computer files instead of internet ones.

Here is my beta code:

client.on('message', message => {
    if (message.content.startsWith('L!pat')) {
        let targetMember = message.mentions.members.first();
        if (!targetMember) return message.reply('you need to tag a user in order to pat them!!');
        // message goes below!
        message.channel.send(`${targetMember.user}, You just got a pat!"`); 
        message.channel.send({files:["./pats/pat.gif"]})
        ranfile = Math.floor(Math.random() * file.length);
        message.channel.sendFile(ranfile);
        //let embed = new Discord.RichEmbed()
        //embed.setImage(`https://toxicmuffin.files.wordpress.com/2013/04/tumblr_mkzqyghtsm1r0rp7xo1_400.gif`)
        message.channel.send;
    }
});

105 thoughts on “how to use the random image command”

Leave a Comment