This document details the setup process of downloading a development copy of Tablebot. This was originally authored by Benji (Git won't reflect this as it was taken out of CONTRIBUTING.md).
If at any point something doesn't work, restart your computer first and try it again. If the problem persists please feel free to ask for help in the Discord server. Sections are marked depending on what OS they rely on, if any.
- git, wsl, and vscode setup
- github
- Create a GitHub account
- Go to https://github.com/WarwickTabletop/tablebot
- Click fork on the repo (should be top right) (this creates your own version of the repo)
- Take note of the url that your forked repo is on
- wsl and git (Windows)
- Install wsl by going to https://docs.microsoft.com/en-us/windows/wsl/install, and make sure it's in the right click context menu of folders
- Navigate to an empty folder on your computer that you want to do your programming from (the project folder)
- Shift-right click in the project folder, and click "open linux shell here"
- Type
git clone <your repo url>
into the terminal - The folder should be filled with a bunch of files and folders
- terminal and git (Linux)
- Navigate to an empty folder on your computer that you want to do your programming from (the project folder)
- Shift-right click in the project folder and press "open in terminal"
- Type
git clone <your repo url>
into the terminal - The folder should be filled with a bunch of files and folders
- vscode
- Install vscode from https://code.visualstudio.com/
- Install this https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack
- From a terminal opened in the project folder, type
code .
- There should soon be a window which has all the folders and files open on the left hand side
- github
- Haskell setup
- In any linux terminal window (wsl or the linux terminal itself), type
curl -sSL https://get.haskellstack.org/ | sh
, allowing sudo access and providing passwords as needed - In the linux terminal window opened from the project folder (or the terminal open in the vscode window) run
stack build
, and then wait until it's done - This will take a long time
- Make some tea, or maybe some coffee or hot chocolate
- If it didn't work, reopen all terminal windows and try again. if that doesn't work, restart your computer and try again
- Install this https://marketplace.visualstudio.com/items?itemName=haskell.haskell
- Open a file and marvel at the colours, and the fact you can hover over things and see values and stuff
- In any linux terminal window (wsl or the linux terminal itself), type
- Discord and Environment variables
- Create a file in the top level of the project folder called
.env
, based on the template in.env.example
- Follow the instructions in Environment File Setup to fill in the
.env
. Make sure to get aDISCORD_TOKEN
and aSQLITE_FILENAME
(which can be named anything, but use something likedatabase.db
) - To run the bot, type
stack run
into the terminal, and the bot will start to run - Make sure to invite the bot to a server so you can test it out!
- Create a file in the top level of the project folder called
Congratulations, you now know the very basics needed to set up your own tablebot!
To learn more about git, you should look up a tutorial or watch this video: https://youtu.be/HOIC804Berc