Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable merge 18/7/2022 #139

Merged
merged 118 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
db7d045
initial fix for some breaking changes
L0neGamer Jan 12, 2022
40493b1
renamed some vars
L0neGamer Jan 20, 2022
39b41e4
added the basics for application commands and components, and interac…
L0neGamer Jan 21, 2022
263d3ba
fix formatting
L0neGamer Jan 21, 2022
c91d85c
adding convenient interaction options
L0neGamer Jan 21, 2022
c8d7f58
formatting
L0neGamer Jan 21, 2022
8b5d785
trying to get a working example in Roll
L0neGamer Jan 21, 2022
f54346b
cleaning up and pinning a new discord-haskell version (from my repo)
L0neGamer Jan 22, 2022
d143af6
working example of reroll button on dice rolling
L0neGamer Jan 22, 2022
f3d28a9
added working slash commands example. raised a couple of things I'd l…
L0neGamer Jan 22, 2022
8637e7a
associated an application command with a handler
L0neGamer Jan 22, 2022
9140650
Beginning of automated application command argument creation, adding …
L0neGamer Jan 22, 2022
b437b47
moved dice functions over to using proxies instead
L0neGamer Jan 22, 2022
a78e5a5
further worked on making slash commands as painless as possible
L0neGamer Jan 23, 2022
f136175
renamed and moved some stuff around
L0neGamer Jan 23, 2022
ac960eb
comandeering the smart parser to use with components
L0neGamer Jan 23, 2022
5696582
smarter components
L0neGamer Jan 24, 2022
7551af0
moving some stuff around, commenting a bit
L0neGamer Jan 24, 2022
45e6d6e
somre reformatting, fixes, and comments
L0neGamer Jan 24, 2022
46da674
added default for message details
L0neGamer Jan 25, 2022
c305bab
commenting, shifting, cleaning, and clarifying
L0neGamer Jan 25, 2022
24acbea
finished tidying. todo: add stuff to quote, make stack.yaml imports p…
L0neGamer Jan 25, 2022
381b772
made some changes to be in line with changes to discord-haskell
L0neGamer Jan 26, 2022
94ac8b9
updating to base docs and moving to CreateEmbed because it's honestly…
L0neGamer Jan 27, 2022
1ff267a
started adding application commands in quote - first and foremost, ri…
L0neGamer Jan 27, 2022
0c5d286
added random, show, and add to the application command quote stuff
L0neGamer Jan 27, 2022
71fee90
beginning autocomplete for show
L0neGamer Jan 27, 2022
25cba32
added an autocomplete option for quote show application command
L0neGamer Jan 28, 2022
31ec7a3
fixed up message click option
L0neGamer Jan 28, 2022
e656197
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
L0neGamer Jan 28, 2022
770fcb9
added getters for values, and added quote author options
L0neGamer Jan 28, 2022
16d5c49
added edit quote option
L0neGamer Jan 28, 2022
c181cac
initial (kinda working) variables in dice expressions
L0neGamer Feb 1, 2022
f54d279
tinkered with let statements a bit more
L0neGamer Feb 2, 2022
e3411c1
tinkered with let statements a even more - broadening statements as a…
L0neGamer Feb 2, 2022
033d5e8
more fiddling to get things to work again
L0neGamer Feb 2, 2022
bb1b89d
added if expressions and moved some stuff around
L0neGamer Feb 2, 2022
04af9c5
added replicate function and set value function
L0neGamer Feb 2, 2022
567a390
added discord haskell update
L0neGamer Feb 10, 2022
2d351d3
merging from main, untested
L0neGamer Feb 10, 2022
878170c
more merging
L0neGamer Feb 10, 2022
ef25044
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
L0neGamer Feb 10, 2022
8fafa2f
started normalising the additional operators (let and if)
L0neGamer Feb 10, 2022
699a554
some commenting
L0neGamer Feb 10, 2022
a31da8b
more commenting and documenting
L0neGamer Feb 10, 2022
ab8272b
reduced if's dev space to only work with Expr
L0neGamer Feb 10, 2022
7e853c7
describing more complex stuff in roll.md
L0neGamer Feb 10, 2022
a3f82d8
applying parser fix
L0neGamer Feb 10, 2022
e623ddc
updated docs to include at least some info about let, if, and program…
L0neGamer Feb 10, 2022
df8ab31
more let description
L0neGamer Feb 10, 2022
aa75919
updated functions list and added some more functions
L0neGamer Feb 11, 2022
7cfa020
spacing issues
L0neGamer Feb 11, 2022
db3adef
adjusting comments
L0neGamer Feb 13, 2022
7d8002c
added full stop
L0neGamer Feb 13, 2022
042f51a
modified language
L0neGamer Feb 13, 2022
3f3e180
removed old comment
L0neGamer Feb 13, 2022
dd87166
merge from upstream
L0neGamer Feb 22, 2022
0462346
updated roll link
L0neGamer Mar 2, 2022
5a6a524
updated discord-haskell version and fixed hole
L0neGamer Mar 20, 2022
2706ba4
tablebot will now join threads whenever they are created
L0neGamer Mar 20, 2022
2ac3a1a
fixed documnetation slightly
L0neGamer Mar 27, 2022
e7e4a35
Made bot easier to import.
finnbar Apr 2, 2022
0fa17b8
Documentation / ormolu
finnbar Apr 2, 2022
356a95c
Allow game and root help text to be customised.
finnbar Apr 2, 2022
0c46be0
Don't use Maybe and hardcoded defaults
finnbar Apr 2, 2022
0683aa1
Allow restriction of emoji origination.
the-Bruce Apr 4, 2022
06ede54
Added warning to runTablebot
finnbar Apr 4, 2022
c05c155
Fixed warning from Netrunner plugin
finnbar Apr 4, 2022
0275b10
Added Default to BotConfig
finnbar Apr 4, 2022
87dd94c
Renamed a few commands to make them clearer
finnbar Apr 4, 2022
b251774
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
L0neGamer Apr 5, 2022
340494f
remove trace
L0neGamer Apr 5, 2022
d215282
moved over to transformer monads for dice evaluation
L0neGamer Apr 5, 2022
8c29e5c
added help text to stats about statements and how they don't work
L0neGamer Apr 5, 2022
9a317d9
updated documentation
L0neGamer Apr 5, 2022
2ffb556
Merge pull request #131 from WarwickTabletop/better-config
finnbar Apr 6, 2022
f74a893
Merge pull request #130 from L0neGamer/roll-doc-link
finnbar Apr 6, 2022
67c6b04
aliases work
L0neGamer Apr 6, 2022
f7d85a5
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
L0neGamer Apr 6, 2022
441418d
changed let values to be called var values instead
L0neGamer Apr 6, 2022
edee8de
add options to either ignore appcomms or make it global. also fixed a…
L0neGamer Apr 6, 2022
25e6611
Merge branch 'main' of github.com:L0neGamer/tablebot into interactions
L0neGamer Apr 6, 2022
dc11340
update discord-haskell, limit reroll button
L0neGamer Apr 7, 2022
b0cef26
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
L0neGamer Apr 13, 2022
4952e8d
Merge pull request #132 from the-Bruce/main
finnbar May 2, 2022
fe15ebe
Removed .issue and .pr, added more to .about
finnbar May 4, 2022
272b6d5
Remove `ping` and `pong`
finnbar May 4, 2022
6c46188
Improvements to CONTRIBUTING.md (fixes #136)
finnbar May 4, 2022
a0b4251
Moved setup into its own file.
finnbar May 4, 2022
7725e0b
Whoops, missed a link
finnbar May 4, 2022
1588ac5
added a bunch of comments
L0neGamer May 6, 2022
b460ffb
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
L0neGamer May 6, 2022
b0685f5
made requested changes
L0neGamer May 7, 2022
8170d71
removed commented content
L0neGamer May 7, 2022
47af85e
made requested changes
L0neGamer May 8, 2022
1a2d3ec
interaction tutorial
L0neGamer May 10, 2022
b221b22
moved to discord haskell 13 - no major feature changes but a bunch of…
L0neGamer May 12, 2022
074501b
changes to take advantge of some new discord-haskell type system stuff
L0neGamer May 28, 2022
f8fbef2
made changes and split some things up
L0neGamer Jul 15, 2022
29c184b
Merge pull request #134 from L0neGamer/alias
finnbar Jul 17, 2022
8a4072b
Merge pull request #133 from L0neGamer/dice-variables
finnbar Jul 17, 2022
02ae70f
Reinstate `ping`
finnbar Jul 17, 2022
aa812fe
Please don't make big PRs
finnbar Jul 17, 2022
731d554
Tiny rename to improve understanding
finnbar Jul 17, 2022
fca75dc
Merge branch 'main' into fewer-commands
finnbar Jul 17, 2022
e1198eb
Made "played game" more generic
finnbar Jul 17, 2022
c2d7b3c
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot in…
L0neGamer Jul 17, 2022
101a4e6
added some more stuff to tutorial
L0neGamer Jul 18, 2022
af0b693
Merge pull request #118 from L0neGamer/interactions
finnbar Jul 18, 2022
08f589c
Merge branch 'main' into fewer-commands
finnbar Jul 18, 2022
74b734c
Merge pull request #137 from WarwickTabletop/fewer-commands
finnbar Jul 18, 2022
a2dbafd
minor changes and fixes, mostly adding descriptions and modifying pro…
L0neGamer Jul 19, 2022
f0ac354
made changes that mean buttons should only appear when needed, and qu…
L0neGamer Jul 19, 2022
74f13e8
added warning about allowing git update
L0neGamer Jul 19, 2022
a4a7ccc
Merge pull request #140 from L0neGamer/fixes
finnbar Jul 20, 2022
818ff51
removed button on quote failure, stop aliasing when alias is blacklisted
L0neGamer Jul 23, 2022
af70a37
made command parser more forgiving
L0neGamer Jul 26, 2022
a9e7d13
Merge pull request #141 from L0neGamer/fixes2
finnbar Jul 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ CATAPI_TOKEN=12345678-1234-1234-1234-123456789012
EXEC_GROUP=123456789123456789
MODERATOR_GROUP=321654987321654987
SUPERUSER_GROUP=147258369147258369
SERVER_ID=314159265358979323
ALLOW_GIT_UPDATE=False
EMOJI_SERVERS=[121213131414151516]
# NOTE: YOU MUST HAVE A NEWLINE AT THE END OF THE FILE
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ database*
*.cabal
stack.yaml.lock
.gitattributes
.vscode
95 changes: 33 additions & 62 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,44 @@ Welcome to the [University of Warwick Tabletop and Roleplaying Society](https://

Please feel free to contribute to the code in whatever way you are able. We're more than happy to accept new code, bug fixes, documentation, issues, and anything else you think will improve the bot! If you do start work on an issue, please first let us know in the issue's thread or in our Discord server to avoid competing pull requests.

## Code of Conduct
**Our society has a [Code of Conduct](https://www.warwicktabletop.co.uk/page/codeofconduct/). We expect it to be upheld by contributors in all our online spaces the same way we'd expect it to be upheld by attendees of our events.**

Our society has a [Code of Conduct](https://www.warwicktabletop.co.uk/page/codeofconduct/). We expect it to be upheld by contributors in all our online spaces the same way we'd expect it to be upheld by attendees of our events.
## What can I contribute?

## Good Practice Recommendations
We're happy to accept any contribution, big or small. You can find our list of issues [here](https://github.com/WarwickTabletop/tablebot/issues), which details bugs and feature requests. Both code (with documentation) and documentation alone is accepted - we want this project to be as accessible as possible, so any contributions must come with documentation or add documentation.

Here are some good practice tips for git and this project.
If you think of a feature you'd like added or find a bug in the current implementation please do create a new ticket! There's no obligation to implement the issue. If you don't have any ideas but do want to get involved with programming you can check the issues page for new features and fixes to work on. If you're not too familiar with Haskell or our codebase, look out for the "good first issue" label. We put this on issues that we think would be good for newcomers to the language/project to get started on.

* Whenever a new feature is being worked on, create a new branch on your forked repo
* When a feature is ready to be merged into the bot, make a pull request from the feature branch to the main repo
* Before making a pull request, make sure your branch is up to date with main (and that it compiles and complies with `ormolu` - see below for details) so that it can be merged without hassle
* Write comments! This project will be maintained by many people, and it can be difficult to work out what others' code does
* To communicate with the maintainers, please join the [Tabletop Discord server](https://warwicktabletop.co.uk/discord) and give yourself the @computer_person role to join the developer channel
* If you need help finding a function to do a particular task, you can search on [Hoogle](https://hoogle.haskell.org/). The two libraries that deal with parsing are `Text.Megaparsec` and `Control.Monad.Combinators`, and `Discord` is the package that deals with Discord itself. You can filter by package if that helps to find certain functions
If you have trouble at any time, please do ask for help in an issue thread or on our Discord. The maintainers generally communicate in the [Tabletop Discord server](https://warwicktabletop.co.uk/discord). The channel we use, #computers-were-a-mistake, is opt-in so you'll need to give yourself the @computer_person role in #roles. Finally, you can also check out the [tutorials](tutorials) in the repository and pre-existing solutions in the code for guidance.

You can check out the [README](README.md) for a brief overview on how to set up a local bot for testing. If you've never done something like this before, see the bottom of this document for a walkthrough.
## How to contribute

## Ormolu
### The basics

If you'd like to contribute code, these are the steps you'll need to follow along with some tips. (If you've contributed to an open-source Haskell project before, you likely know all of this.)

* You'll need to fork this repo if you haven't already, and then create a branch for the feature you're implementing. Please split up features into different branches where you can.
* When a feature is ready to be merged into the bot, make a pull request from the feature branch to the main repo. In the next section we'll talk about pull requests.
* Before making a pull request (PR), **make sure your branch is up to date with main**. The CI must also not complain, so the code must compile and not throw any formatting errors. We use `ormolu` to check for the latter, which is detailed later.
* If you need help finding a function to do a particular task, you can search on [Hoogle](https://hoogle.haskell.org/). The two libraries that deal with parsing are `Text.Megaparsec` and `Control.Monad.Combinators`, and `Discord` is the package that deals with Discord itself. You can filter by package if that helps to find certain functions.

You can check out the [README](README.md) for a brief overview on how to set up a local bot for testing. If you've never done something like this before, see [SETUP.md](SETUP.md).

### Writing good Pull Requests (PRs)

Writing good PRs is hard. As such, here are some important points to consider when writing your PR to make it easier for the reviewer.

* **Ask yourself: what does this PR contribute?** It is very important that you're clear about all of the features being added, because they justify the changes you have made and point out what exactly needs testing. Mention _everything_ even if it is just cleaning up a file - this makes it clear what the point is of each change and doesn't leave the reviewer guessing why you've added a certain change.
* **Documentation is key.** PRs without documentation will be rejected. A few points to consider about documentation:
* Functions should have top-level documentation explaining what they do (even if it is very brief) unless they are self-evident. Classes should be justified in the same way. Use Haddock style.
* In larger implementations, it may help to talk about the high-level structure of your implementation - e.g. you might have a section of your plugin that deals with parsing messages, another which deals with some specific case, another which deals with the general case and so on. Make it clear how these parts interact. Splitting your implementation into multiple files may help here, with a base file that imports each auxiliary file and puts the results within those files together.
* Haskell code has a habit of being extremely abstract, and talking about it in the abstract does not aid understanding. Give concrete examples of how the abstract is used to justify its existence - instead of solely saying "we have a parser that doesn't look at `t`", back it up with an example like "this is used within a Discord interaction, so doesn't necessarily have an associated message".
* **Remember the plugin writer as well as the end user.** If you've written something that changes how plugins are written, update existing tutorials or add new ones. Make sure that the API you're defining is clear and easy to use, so doesn't put too much burden on someone writing a plugin.
* **Try to keep your PR small.** If you can split your work into multiple PRs, please do - the smaller a PR is, the more likely your reviewer will be able to understand it and thus accept it.

If you follow these steps, it becomes much easier for the reviewer to understand your code and thus feel confident about accepting it. This also allows the reviewer to make more helpful suggestions about the code itself - both allowing them to verify that the code does what you say it does, and that you've implemented it in a helpful way. The review process should help you write better code as well as making Tablebot as a whole better.

### Ormolu

To maintain consistent formatting you must use Ormolu, which can be installed via stack:

Expand All @@ -33,7 +53,7 @@ Then you can run it on every file via:

You can see full documentation on the [Ormolu repo](https://github.com/tweag/ormolu#usage).

### Running Ormolu automatically with git
#### Running Ormolu automatically with git

You may also wish to set up Ormolu to run when you stage a file (get ready to commit it) - this can be done using `.gitattributes` and `.gitconfig` as follows.

Expand All @@ -55,52 +75,3 @@ You may also wish to set up Ormolu to run when you stage a file (get ready to co

That's it! (With thanks to Sam Coy for explaining this process)

## What can I work on?

We're happy to accept any contribution, big or small. You can find our list of issues [here](https://github.com/WarwickTabletop/tablebot/issues). If you think of a feature you'd like added or a bug in the current implementation please do create a new ticket! There's no obligation to implement the issue. If you don't have any ideas but do want to get involved with programming you can check the issues page for new features and fixes to work on. If you're not too familiar with Haskell or our codebase, look out for the "good first issue" label. We put this on issues that we think would be good for newcomers to the language/project to get started on.

If you have trouble at any time, please do ask for help in an issue thread or on our Discord. You can also check out the [tutorials](tutorials) in the repository and pre-existing solutions in the code for guidance.

## Setup from Scratch

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](https://www.warwicktabletop.co.uk/discord/). Sections are marked depending on what OS they rely on, if any.

1. git, wsl, and vscode setup
1. github
1. Create a GitHub account
2. Go to <https://github.com/WarwickTabletop/tablebot>
3. Click fork on the repo (should be top right) (this creates your own version of the repo)
4. Take note of the url that your forked repo is on
2. wsl and git (Windows)
1. 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
2. Navigate to an empty folder on your computer that you want to do your programming from (the project folder)
3. Shift-right click in the project folder, and click "open linux shell here"
4. Type `git clone <your repo url>` into the terminal
5. The folder should be filled with a bunch of files and folders
3. terminal and git (Linux)
1. Navigate to an empty folder on your computer that you want to do your programming from (the project folder)
2. Shift-right click in the project folder and press "open in terminal"
3. Type `git clone <your repo url>` into the terminal
4. The folder should be filled with a bunch of files and folders
4. vscode
1. Install vscode from <https://code.visualstudio.com/>
2. Install this <https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack>
3. From a terminal opened in the project folder, type `code .`
4. There should soon be a window which has all the folders and files open on the left hand side
2. Haskell setup
1. 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
2. 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
3. This will take a long time
4. Make some tea, or maybe some coffee or hot chocolate
5. If it didn't work, reopen all terminal windows and try again. if that doesn't work, restart your computer and try again
6. Install this <https://marketplace.visualstudio.com/items?itemName=haskell.haskell>
7. Open a file and marvel at the colours, and the fact you can hover over things and see values and stuff
3. Discord and Environment variables
1. Create a file in the top level of the project folder called `.env`, based on the template in `.env.example`
2. Follow the instructions in [Environment File Setup](README.md#environment-file-setup) to fill in the `.env`. Make sure to get a `DISCORD_TOKEN` and a `SQLITE_FILENAME` (which can be named anything, but use something like `database.db`)
3. To run the bot, type `stack run` into the terminal, and the bot will start to run
4. Make sure to invite the bot to a server so you can test it out!

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>
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Changelog for tablebot

## Unreleased changes
- Allow configuration of which servers are allowed to provide emoji
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

An extendable Discord bot framework written on top of [`discord-haskell`](https://github.com/aquarial/discord-haskell).

If you're new to this project, or completely new to git, and Haskell, you might be interested in looking at the [Setup from Scratch](CONTRIBUTING.md#setup-from-scratch) section in the [contributor's guide](CONTRIBUTING.md). If you want tutorials on making your first plugin or how exceptions work, checkout the tutorials in the [tutorials](tutorials) folder.
If you're new to this project, or completely new to git, and Haskell, you might be interested in looking at the [Setup from Scratch](SETUP.md) guide. If you want to contribute, please consult the [contributor's guide](CONTRIBUTING.md). If you want tutorials on making your first plugin or how exceptions work, checkout the tutorials in the [tutorials](tutorials) folder.

## Environment file setup

Expand All @@ -23,9 +23,18 @@ Create a `.env` file containing the following keys. Consult `.env.example` if yo
* `EXEC_GROUP` (optional) - the group ID assigned to exec members.
* `MODERATOR_GROUP` (optional) - the group ID assigned to moderator members.
* `SUPERUSER_GROUP` (optional) - the group ID assigned to the superuser. Strongly recommended
* `SERVER_ID` (optional) - either `global` or the id of the server the bot will mainly be deployed in. Application commands will be
registered here. If absent, application commands won't be registered.
* `EMOJI_SERVERS` (optional) - a list of server IDs that the bot will search for emoji within.
* `ALLOW_GIT_UPDATE` (optional) - a `true` or `false` value that determines whether the bot can automatically load data from the repository.
**Warning!** Be very careful with setting this to true; if you haven't set up permissions properly on your repo and your discord servers then things can go wrong!

The three Group settings are optional, but without them any commands that require elevated permissions will not be able
to be called when DEBUG is false. Users with the superuser group are able to run every command (including some dangerous
to be called when `DEBUG` is false. Users with the superuser group are able to run every command (including some dangerous
ones), so caution should be used when setting these up.

If you have any difficulties setting it up, see the [contributor's guide](CONTRIBUTING.md) for a walkthrough.
If you have any difficulties setting it up, see the [setup guide](SETUP.md) for a walkthrough.

## Importing this bot and running it yourself.

If you like, rather than directly running this bot you can run it yourself with minor tweaks. An example of this is in `app/Main.hs` - tweak this to your needs and then run `stack run` as per usual.
46 changes: 46 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Setup from Scratch

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](https://www.warwicktabletop.co.uk/discord/). Sections are marked depending on what OS they rely on, if any.

1. git, wsl, and vscode setup
1. github
1. Create a GitHub account
2. Go to <https://github.com/WarwickTabletop/tablebot>
3. Click fork on the repo (should be top right) (this creates your own version of the repo)
4. Take note of the url that your forked repo is on
2. wsl and git (Windows)
1. 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
2. Navigate to an empty folder on your computer that you want to do your programming from (the project folder)
3. Shift-right click in the project folder, and click "open linux shell here"
4. Type `git clone <your repo url>` into the terminal
5. The folder should be filled with a bunch of files and folders
3. terminal and git (Linux)
1. Navigate to an empty folder on your computer that you want to do your programming from (the project folder)
2. Shift-right click in the project folder and press "open in terminal"
3. Type `git clone <your repo url>` into the terminal
4. The folder should be filled with a bunch of files and folders
4. vscode
1. Install vscode from <https://code.visualstudio.com/>
2. Install this <https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack>
3. From a terminal opened in the project folder, type `code .`
4. There should soon be a window which has all the folders and files open on the left hand side
2. Haskell setup
1. 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
2. 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
3. This will take a long time
4. Make some tea, or maybe some coffee or hot chocolate
5. If it didn't work, reopen all terminal windows and try again. if that doesn't work, restart your computer and try again
6. Install this <https://marketplace.visualstudio.com/items?itemName=haskell.haskell>
7. Open a file and marvel at the colours, and the fact you can hover over things and see values and stuff
3. Discord and Environment variables
1. Create a file in the top level of the project folder called `.env`, based on the template in `.env.example`
2. Follow the instructions in [Environment File Setup](README.md#environment-file-setup) to fill in the `.env`. Make sure to get a `DISCORD_TOKEN` and a `SQLITE_FILENAME` (which can be named anything, but use something like `database.db`)
3. To run the bot, type `stack run` into the terminal, and the bot will start to run
4. Make sure to invite the bot to a server so you can test it out!

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>
Loading