Issue with Embed Box Not Displaying in HighLow Game
Description
I'm encountering a problem with my HighLow game bot. Normally, when the game is initiated using !start highlow, an embedded message box should appear for user interaction. However, this box is no longer displaying.
Key Details
Issue Description: The embedded box that allows players to interact with the game does not appear upon starting the game.
No Visible Errors: There are no errors in the logs, and adding debug steps indicates that the expected processes are running correctly.
No Recent Changes: No recent code modifications or alterations to the bot's permissions have been made.
Troubleshooting Attempts:
Reviewed change logs for any inadvertent changes.
Reset the bot token.
Unfortunately, neither of these steps resolved the issue.
Code Snippet
Below is a snippet of the function sendBetOptions where the embedded box is implemented:
func sendBetOptions(s *discordgo.Session, channelID string, m *discordgo.MessageCreate, game *HighLowGame) {
userUsername := m.Author.Username // Get user's username
// Check if player has enough balance for the lowest bet
if game.PlayerBalance < 1000 {
s.ChannelMessageSend(channelID, fmt.Sprintf("Sorry %s, you do not have enough balance to place a bet.", userUsername))
return
}
// Enhanced betEmbedDescription with better formatting and readability
betEmbedDescription := fmt.Sprintf("**%s's High Low Game**\n\n"+
"**🔮 Predict the next card! Is it higher or lower?**\n\n"+
"**💰 Round Bonuses:**\n"+
"🔹 Round 15: **+25,000** chips\n"+
"🔹 Round 25: **+250,000** chips\n"+
"🔹 Round 50: **+1,000,000** chips\n"+
"🔹 **Tie**: Win **15x** your current jackpot!\n\n"+
"**📜 Rules:**\n"+
"1. **Choose your bet amount**.\n"+
"2. **Guess the next card** - higher or lower than the dealer's.\n"+
"3. **Win and increase your jackpot**, or lose and reduce your balance.\n\n"+
"💼 **Your balance: %d chips**\n", userUsername, game.PlayerBalance)
betEmbed := &discordgo.MessageEmbed{
Title: "🎲 Place Your Bets!",
Description: betEmbedDescription,
Color: 0x00ff00, // Green color
Thumbnail: &discordgo.MessageEmbedThumbnail{
URL: m.Author.AvatarURL("256"),
},
}
betButtons := make([]*discordgo.Button, 0)
// Adding buttons conditionally based on user balance
if game.PlayerBalance >= 1000 {
betButtons = append(betButtons, &discordgo.Button{
Label: "Bet 1000",
Style: discordgo.PrimaryButton,
CustomID: "bet_1000",
})
}
if game.PlayerBalance >= 2500 {
betButtons = append(betButtons, &discordgo.Button{
Label: "Bet 2500",
Style: discordgo.PrimaryButton,
CustomID: "bet_2500",
})
}
if game.PlayerBalance >= 5000 {
betButtons = append(betButtons, &discordgo.Button{
Label: "Bet 5000",
Style: discordgo.PrimaryButton,
CustomID: "bet_5000",
})
}
actionRow := discordgo.ActionsRow{
Components: make([]discordgo.MessageComponent, len(betButtons)),
}
for i, btn := range betButtons {
actionRow.Components[i] = btn
}
s.ChannelMessageSendComplex(channelID, &discordgo.MessageSend{
Embed: betEmbed,
Components: []discordgo.MessageComponent{
&actionRow,
},
})
}
Issue with Embed Box Not Displaying in HighLow Game
Description
I'm encountering a problem with my HighLow game bot. Normally, when the game is initiated using
!start highlow
, an embedded message box should appear for user interaction. However, this box is no longer displaying.Key Details
Code Snippet
Below is a snippet of the function
sendBetOptions
where the embedded box is implemented: