Examples

An example page to use options

Disabling the resultEmbed option

const blackjack = require("discord-blackjack")
const Discord = require("discord.js")

module.exports = {
    name: "blackjack",
    async execute(message, args, client) => {
    
        let game = await blackjack(message, {resultEmbed: false})
        
        switch (game.result) {
            
            case "WIN":
                message.channel.send(
                    new Discord.MessageEmbed()
                    .setTitle("You won!")
                    .setDescription(`You have a total of ${game.yvalue} points!`)
                )
                break;
            case "LOSE":
                message.channel.send("You're a disgrace to us...")
            
        }
        
    }
}

Basically, resultEmbed will disable the bot from sending it's own default result embed and will let the user make their own win/lose embed.

Disabling the buttons option

Disabling the normalEmbed option

So to make your own embed, the bot will need you empty out the value. Don't worry as it will replace it when sending messages.

Last updated

Was this helpful?