ConsoleLabs

Overview

We are looking to develop a Blackjack game as a Discord bot. The bot will allow users to play Blackjack by interacting with it through various commands. Users will be required to transfer tokens from their wallet to the game’s wallet as a deposit to participate. The bot will manage the game logic, including dealing cards, calculating winnings, and transferring tokens back to the winner’s wallet. Below are the detailed requirements for this project.

Game Initialization

Discord Commmand

Create a command to initiate a new Blackjack game. Users should be able to start a new game by typing a command, e.g., /blackjack new <bet_amount> <token>.

Users will wait for others to join the blackjack game.

Deposit Requirement

Before joining a game, users must transfer a specified amount of tokens to the game’s wallet as a deposit. The required deposit amount has already been configured and clearly communicated to users when they initiate a game.

Gameplay

Card Dealing

The bot will automatically deal cards to the player and the dealer as each user has 2 cards. Ensure that the deck is shuffled before each game.

The bot will notify users in DM about their card values.

Player Actions

The bot will notify users in DM about their card values with 2 action button “hit" (receive an additional card) or “stand” (end their turn). Each user can do it only once. If users choose “hit”, the additional card will be randomly taken from the remaining cards.

Maximum users to join: 15 users

Winning Calculation

List all the sum card values of each user in the channel. Determine the winner(s) based on the final hands of the players and the dealer. Calculate winnings according to the standard Blackjack rules and payout rates.

Token Transfers

Winner Payout

Once a winner is determined, transfer the winnings (tokens) from the game’s wallet to the winner’s wallet, double the amount they bet. Ensure that the transfer is secure and transparent.

Refund on Tie or Dealer Win

In case of a tie, refund the players’ deposits.

User Interface

Start games & Users join