Bot

The bot hosts games in Telegram groups. Players are only allowed to play if they have connected a wallet, and have both approved and hold a large enough balance of DART to pay the minimum bet for any particular game.

Initially, the bot is limited to playing in a single Telegram group (the main Telegram for this project). In the future, access will be opened so that the bot can host games in any group that it is added to.

The bot hosts a single game at a time per Telegram group. If a game is in progress, prospective players in the group will have to wait until the game finishes before a new one can be started.

The max number of players is equal to the size of the revolver.

When the game starts, the bot places the dart in a randomly selected chamber of the revolver. The amount of DART wagered by each player is transferred from their wallet into the escrow smart contract.

During the game, the bot hands the dart to a player and waits for them to /shot or . Each player must pull the trigger at least once before they are allowed to pass the dart. If a player goes AFK, auto shot.

When the game concludes, the bot sends information on the winner to the escrow contract, and the winnings are distributed to each survivor.

If any issue occurs while collecting bets (e.g. a player front runs the escrow contract, revoking their DART approval), the game will be canceled.

Every time the bot interacts with the escrow contract, it will display a link to the corresponding transaction on Etherscan.

At any time, if all players in a game vote to /stop, the bot will cancel the game and each player will be refunded their original bet.

Every turn from every player from every game is stored in a database. The /leaderboard command exposes historical game stats in various ways.