Get Started

Using, configuring and understanding the bot can be found here

Adding the Bot

Permissions

  • Sending Messages / Threads
  • View Channels
  • Embed Links
  • Attach Files
  • Manage Messages

Commands

Below is a list of all commands available

Command Use
help List the rules and commands available for the user
balance Show your balance
race Begin racing against your Guild
stat List all of your stats including (streaks, wins, losses, balance, guild position)
streaks List leaderboard of players with highest current streak within the server
winners List leaderboard of players with highest wins within the server

/help

help

/balance

balance

When you first play as a user you have a chance to win BIG on your first game by betting 5 - 10 - 100 and maintaing this new balance if won, if lost your new account balance is set to 50

If a user falls below 5 this chance of redemption is once again offered, however losing after going ALL IN will result with a balance net of 5

/race

balance

Selecting the horses

The odds of each horse are first displayed before the race and here race, where odds matter

This screen also displays which emoji is related to the amount of your balance you are betting.
Selecting a horse based on their odds can increase your chance to win as a cumulative probability is calculated with the normalised odds to decide which horse should move. You can only bet on one horse and your final selection is the one stored

balance
You have 30 seconds to choose your horse

/stat

balance

Here you can see all of your global stats across your time playing EQL, including your balance, current and longest streak, wins and losses as well as a ratio

Guild based stats can also be viewed here including your position in both leaderboards of streak and overall server wins

/streaks

balance

Streak leaderboard lists players in order of their current streak (will fluctuate as you play)

Scroll through the leaderboard using the arrows

/winners

balance

Scroll through the leaderboard using the arrows

Placing your Bet

The next screen allows you to place a bet on your horse with a selection (If you miss the default bet is the house minimum of 5). Your last selection is the final one used

balance
You have 30 seconds to place your bet

Racing

The races are live and occur in real-time with the odds playing a large roll in a horses' performance. Each horse now has a probability of being selected to move forward but to prevent dominance the step size a horse can move is randomly selected between 1 and 5, allowing other horses to catch up and even win (much like real world gambling)

Once a horse moves 26 steps and is first they are the winner of the race and the end condition is once all horses reach the end

balance

Payouts

At the end of a race the results are sent with the winne's listed alongside the winning horse and all of the odds. The payout is calculated using British fractional odds with the calculation of
𝗣𝗿𝗼𝗳𝗶𝘁 = 𝗦𝘁𝗮𝗸𝗲 𝘅 (𝗙𝗿𝗮𝗰𝘁𝗶𝗼𝗻𝗮𝗹 𝗢𝗱𝗱) + 𝗦𝘁𝗮𝗸𝗲

If your horse didn't win, the amount you bet is subtracted from your current balance. If you went ALL IN, your balance is reset to 5

balance

Self-Hosting

Note: This should be functional for both Windows and Unix systems

Pre-requisites

Equestrian-League is built using discord.js,node.js and relies on a sqlite3 database. Before you start setting up the bot these are what you will need first

Required

  • 𝗻𝗼𝗱𝗲 : latest >= v20
  • 𝗱𝗶𝘀𝗰𝗼𝗿𝗱.𝗷𝘀 : v14
  • 𝘀𝗾𝗹𝗶𝘁𝗲𝟯 : latest >= v5

Optional

  • 𝗴𝗶𝘁 : Version Control System, to download the source code
  • 𝗗𝗼𝗰𝗸𝗲𝗿 : Create a containerised environemnt for bot

Native

Download the source code using

              
                $ git clone https://github.com/CR3A7OR/Equestrian-League
              
            

Navigate to the directory you downloaded the source files

              
                $ cd Equestrian-League
              
            

The directory should contain a package.json file. To install the dependencies use NPM (node's package manager), or some alternative.

            
              $ npm install
              added 128 packages, and audited 129 packages in 30s

              5 packages are looking for funding
                run `npm fund` for details

              found 0 vulnerabilities
            
          

Run the deploy-commands file to register all the commands with Discord

            
              $ node deploy-commands.js
            
          

Once everything is installed, you're finally ready to start the bot

            
              $ node index.js
            
          

Docker

Make sure you have installed on your system first.

Download the source code using

              
                $ git clone https://github.com/CR3A7OR/Equestrian-League
                $ cd Equestrian-League
              
            

Edit the config.json file adding your own DISCORD_API_KEY

              
                $ nano config.json
              
            

Start the bot

              
                $ docker-compose up -d