Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
c3b25cb
tidied some code but most importantly fixed the issue with subtractio…
L0neGamer Aug 2, 2022
4cbef87
changes to docs and minor formatting change
L0neGamer Aug 2, 2022
aef69ec
add dockerfile
Joeyh021 Jan 15, 2023
2dbcf62
make the build job within docker
Joeyh021 Jan 15, 2023
69f9103
something about the yaml spec
Joeyh021 Jan 15, 2023
40dfe47
add buildx to workflow
Joeyh021 Jan 15, 2023
3f3feaf
i hate yaml
Joeyh021 Jan 15, 2023
b3519ae
try using the docker metadata thing
Joeyh021 Jan 15, 2023
e1b4378
actually use the metadata generated
Joeyh021 Jan 15, 2023
fbe2e4a
add latest tag to container build
Joeyh021 Jan 15, 2023
bbc3fa5
make the if conditions for push consistent
Joeyh021 Jan 15, 2023
47757c0
Merge pull request #145 from Joeyh021/main
finnbar Jan 17, 2023
3a3a5f8
switch to 'withSqlitePool'
L0neGamer Jan 19, 2023
fdc8ce1
Merge pull request #146 from L0neGamer/with-pool
finnbar Feb 4, 2023
fb98a2a
Update rts opts
finnbar Feb 4, 2023
c0ee0ba
add fonts
L0neGamer Feb 19, 2023
738c715
custom font loading for dice stats
L0neGamer Feb 19, 2023
d24ed28
update dockerfile to copy across fonts
L0neGamer Feb 19, 2023
019fdc7
slight refactor of dice stats
L0neGamer Feb 19, 2023
4f43275
added font generation to startup, and use those fonts instead of read…
L0neGamer Feb 19, 2023
372cd39
Merge pull request #1 from L0neGamer/fixing-dice-stats
Bongo50 Sep 10, 2025
b0d3926
Removing FONT_PATH env variable, using relative paths instead
Bongo50 Sep 10, 2025
843c575
Adding separate license for fonts.
Bongo50 Sep 10, 2025
14d64c1
ormolu tweaks
Bongo50 Sep 10, 2025
bf41c14
Merge pull request #149 from Bongo50/fixing-dice-stats
Bongo50 Sep 10, 2025
e10b04b
Removing Discord toke regex as it no longer works.
Bongo50 Sep 10, 2025
3d5ce51
Updating Ormolu workflow
Bongo50 Sep 10, 2025
e1bb1ae
Various ormolu formatting tweaks
Bongo50 Sep 10, 2025
90b731d
Merge branch 'main' of https://github.com/WarwickTabletop/tablebot
Bongo50 Sep 10, 2025
bb23ad2
Hopefully fixing Docker issue
Bongo50 Sep 10, 2025
7c23b72
Same idea
Bongo50 Sep 10, 2025
75f9874
Same idea, again
Bongo50 Sep 10, 2025
4180830
Removing redundant imports
Bongo50 Sep 11, 2025
1698e4b
Fixing favourite command from welcome plugin on Docker
Bongo50 Sep 11, 2025
6418803
Increasing timeout time for dice stats
Bongo50 Sep 11, 2025
6fb3b2a
Merge branch 'main' into fixing-rolling
Bongo50 Sep 11, 2025
b0bfe24
Merge pull request #142 from L0neGamer/fixing-rolling
Bongo50 Sep 11, 2025
556e984
ormolu fixes
Bongo50 Sep 11, 2025
376837c
you should commit lock files and auto-generated files
L0neGamer Sep 16, 2025
55843cd
bump lts, remove unneeded deps, use more l0negamer deps, and commit l…
L0neGamer Sep 16, 2025
2393ce8
import fixes and discord-haskell upstream updates
L0neGamer Sep 16, 2025
35e325c
adjust the integral parser to have a concrete type
L0neGamer Sep 16, 2025
2f1f496
use the new IntegralData
L0neGamer Sep 16, 2025
d7e163e
remove Tablebot.Utility.Database in favour of lifting sql functions w…
L0neGamer Sep 16, 2025
d4f3046
ormolu formatting
L0neGamer Sep 16, 2025
7cbf2e4
add view patterns
L0neGamer Sep 17, 2025
9466cb8
basic warning fixes
L0neGamer Sep 17, 2025
4ecf533
use nonempty here to avoid `head`
L0neGamer Sep 17, 2025
d294d96
use parser for fromMention, invert module dep and move inlineCommandH…
L0neGamer Sep 17, 2025
b05099f
guarantee nonemptiness to avoid head
L0neGamer Sep 17, 2025
d01404f
treat infinite stream like an infinite stream
L0neGamer Sep 18, 2025
c48667d
Changing Duckling dependency format
Bongo50 Sep 20, 2025
9d68bc7
Updating Dockerfile
Bongo50 Sep 20, 2025
2088e3c
Fixing Dockerfile.
Bongo50 Sep 20, 2025
7114ead
Trying to fix Dockerfile again
Bongo50 Sep 20, 2025
78480ec
Fixing Dockerfile, I think for good this time
Bongo50 Sep 20, 2025
18470fd
Fixing properly, and adding helpful comments
Bongo50 Sep 20, 2025
e167b2e
Downgrading libicu version for bullseye Debian
Bongo50 Sep 20, 2025
d9e6dc5
Merge pull request #151 from Bongo50/refresh
Bongo50 Sep 20, 2025
90da3e5
Making the timeout for the dice stats command an environmental variable
Bongo50 Sep 20, 2025
bef80dc
Ormolu
Bongo50 Sep 20, 2025
fd9137a
Merge pull request #152 from Bongo50/stats-timeout
Bongo50 Sep 20, 2025
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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ SUPERUSER_GROUP=147258369147258369
SERVER_ID=314159265358979323
ALLOW_GIT_UPDATE=False
EMOJI_SERVERS=[121213131414151516]
STATS_TIMEOUT=20
# NOTE: YOU MUST HAVE A NEWLINE AT THE END OF THE FILE
60 changes: 40 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
branches: [main]
pull_request:

# Allows you to run this workflow manually from the Actions tab
Expand All @@ -17,26 +17,46 @@ jobs:
ormolu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mrkkrp/ormolu-action@v4
- uses: actions/checkout@v4
- uses: haskell-actions/run-ormolu@v17

build:
name: Build
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
needs: ormolu
name: Build Docker Image
runs-on: ubuntu-latest
permissions:
packages: write
needs:
- ormolu
if: success()
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
- uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
if: github.event_name != 'pull_request' # don't need to login if we're not pushing
with:
ghc-version: 'latest'
enable-stack: true
stack-version: 'latest'
- name: Cache .stack
id: cache-stack
uses: actions/cache@v2
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get Docker Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: | # tag with commit hash and with 'latest'
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and Push Docker image
uses: docker/build-push-action@v3
with:
path: ~/.stack
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}
restore-keys: |
${{ runner.os }}-stack
${{ runner.os }}
- run: stack build
context: .
push: ${{ github.event_name != 'pull_request' }} # dont push on a pull request
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.env
db.*
database*
*.cabal
stack.yaml.lock
.gitattributes
.vscode
dist-newstyle/
cabal.project.local
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# stack resolver 24.10 uses ghc 9.10.2 - when upgrading LTS version in stack.yaml, check Haskell version on https://www.stackage.org/ and check which Debian release is available on https://hub.docker.com/_/haskell/
FROM haskell:9.10.2-bullseye as build
RUN mkdir -p /tablebot/build
WORKDIR /tablebot/build

# system lib dependencies
RUN apt-get update -qq && \
apt-get install -qq -y libpcre3-dev build-essential pkg-config libicu-dev --fix-missing --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY . .

RUN stack build --system-ghc

RUN mv "$(stack path --local-install-root --system-ghc)/bin" /tablebot/build/bin

# ensure this matches first FROM
FROM haskell:9.10.2-slim-bullseye as app

# system runtime deps - if this command fails, check libicu version (https://packages.debian.org/index) and upgrade if necessary
RUN apt-get update -qq && \
apt-get install -qq -y libpcre3 libicu67 --fix-missing --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN mkdir -p /tablebot
WORKDIR /tablebot

COPY --from=build /tablebot/build/bin .
# apparently we need the .git folder
COPY .git .git
# we need fonts for the roll stats
COPY fonts fonts
# resources folder
COPY resources resources
CMD /tablebot/tablebot-exe
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Create a `.env` file containing the following keys. Consult `.env.example` if yo
* `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.
* `STATS_TIMEOUT` (optional) - an integer value that determines the maximum number of seconds that the bot will perform dice stats calculations for before timing out.
* `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!

Expand Down
11 changes: 11 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
packages: .

source-repository-package
type: git
location: git@github.com:L0neGamer/haskell-distribution.git
tag: 569d6452e4bffedb2c0d3795885fccdb22a4d29d

source-repository-package
type: git
location: git@github.com:L0neGamer/duckling.git
tag: f22e3cdd7b77977fe3e9ec75fccd9a0f79c47f97
96 changes: 96 additions & 0 deletions fonts/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
Source Code © 2023 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
Source Sans Copyright 2010-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
Libertine Copyright (c) 2003–2012, Philipp H. Poll (www.linuxlibertine.org | gillian at linuxlibertine.org),
with Reserved Font Name "Linux Libertine" and "Biolinum".

All three Font Softwares are licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Loading
Loading