const {Command} = require('../../lib.js')
const {EmbedBuilder } = require('discord.js');

    class coinflip extends Command{
        constructor(client){
            super(client, {
                name: 'coinflip',
                description: 'Flips a coin.'
            })
        }
        async run(message, args){
           var rand = 1 + Math.floor(Math.random() * 100);
        var title;
        var url;
        if (rand > 50) {
            url = 'https://cdn.ram.moe/HJSEfDUbl.gif';
            title = 'Tails';
        } else {
            url = 'https://cdn.ram.moe/Byu2fPLWg.png';
            title = 'Heads';
        }

        const embed = new EmbedBuilder()
        .setColor(0x0099FF)
        .setTitle(title)
        .setAuthor({name:"Rem-chan", iconURL:"https://i.imgur.com/g6FSNhL.png",url:'https://rem.wordfights.com/addtodiscord'})
        .setThumbnail(url)
        .setTimestamp()
        .setFooter({ text: 'Rem-Chan on', iconURL: 'https://i.imgur.com/g6FSNhL.png' });
        message.channel.send({embeds:[embed]}) 
    }
    
    }module.exports = coinflip;