# Examples

## Disabling the resultEmbed option

```javascript
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.&#x20;

## Disabling the buttons option

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

module.exports = {
    name: "blackjack",
    async execute(message, args, client) => {
    
        let game = await blackjack(message, { buttons: false }) // it will use messages instead of buttons now.
        
        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...")
            
        }
        
    }
}
```

## Disabling the normalEmbed option

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

module.exports = {
    name: "blackjack",
    async execute(message, args, client) => {
    
        let embed = {
            title: "A very pro blackjack game",
            color: "RANDOM"
            fields: [
                {name: `${message.author.username}'s hand`, value: "" },
                {name: `Dealer's Hand`, value: "" }
            ],
            footer: { text: "Type E to end the game. This bot is so pro so go support us..." }
            
        let game = await blackjack(message, {normalEmbed: false, normalEmbedContent: embed})
        
        switch (game.result) {
            
            case "WIN":
                // do win stuff
                break;
            case "LOSE":
                // do lose stuff
                break;
            // rest of the case stuff 
            
        }
        
    }
}

```

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://discord-blackjack.gitbook.io/discord-blackjack/examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
