Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions .github/workflows/image-builder-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: image builder dev
run-name: Building new docker containers
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: set lower case owner name
env:
OWNER: "${{ github.repository_owner }}"
run: echo "OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
- name: set image tag name
shell: bash
env:
BRANCH_NAME: "${{ github.head_ref || github.ref_name }}"
run: |
if [[ "${BRANCH_NAME,,}" == "main" || "${BRANCH_NAME,,}" == "master" ]]; then
echo "IMAGE_TAG=latest" >> ${GITHUB_ENV}
else
echo "IMAGE_TAG=${BRANCH_NAME,,}" >> ${GITHUB_ENV}
fi
- uses: actions/checkout@v4
- run: sudo apt-get install -y podman
- run: echo ${{ secrets.GITHUB_TOKEN }} | podman login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- run: podman build --tag "ghcr.io/$OWNER_LC/bigmeow_bot:$IMAGE_TAG" .
- run: podman push "ghcr.io/$OWNER_LC/bigmeow_bot:$IMAGE_TAG"
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info

# Virtual environments
.venv
.env
.envrc

# Node

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A dumb experimental bot done for no good reason
* `!meowisblocked domain.tld`: Perform a query to https://blockedornot.sinarproject.org/ to check if a domain is blocked in Malaysia
* `!meowprompt prompt`: a reply to the supplied prompt, powered by https://ifttt.com/
* `!meowremind text @ when`: Set a reminder for yourself after the time specified
* If your message has a `meow` in it, a cat photo is fetched from https://cataas.com/ (Currently not supported on slack)
* If your message has a `meow` in it, a cat photo is fetched from https://cataas.com/

NOTE: all `!` commands can be replaced by `/` in telegram, e.g. `/meowsay hello world`.

Expand All @@ -27,18 +27,24 @@ NOTE: all `!` commands can be replaced by `/` in telegram, e.g. `/meowsay hello
You can pull an image from https://hub.docker.com/r/jeffrey04/bigmeow_bot and supply the following environment variables to run the container.

```
DISCORD_APP_ID=<DISCORD APP ID>
DISCORD_APP_PUBLIC=<DISCORD APP PUBLIC KEY>
DISCORD_TOKEN=<DISCORD TOKEN>
DISCORD_USER=<OWNER DISCORD ID>

TELEGRAM_TOKEN=<TELEGRAM TOKEN>
TELEGRAM_USER=<OWNER TELEGRAM CHAT ID>
TELEGRAM_WEB_TOKEN=<TOKEN FOR TELEGRAM WEBHOOK REQUEST>

ECHO_TOKEN=<TOKEN FOR WEB ECHO REQUEST>

WEBHOOK_URL=<URL TO WEBHOOK>

WEB_SECRET_PING=<SECRET PING WEBHOOK TO FOR UPTIME CHECK>
WEB_EECRET_PASSWORD=<TOKEN FOR SECRET PING WEBHOOK>

DEBUG=<True IF RUNNING LOCALLY OTHERWISE False>

IFTTT_KEY=<IFTTT_TOKEN>
SLACK_SECRET_SIGN=<SLACK SIGNING SECRET>
SLACK_SECRET_CLIENT=<SLACK CLIENT SECRET>
SLACK_CLIENT_ID=<SLACK CLIENT ID>

DATABASE_URL=postgresql+psycopg://<DATABASE_USER>:<DATABASE_PASSWORD>@<DATABASE_HOST>:<DATABASE_PORT>/<DATABASE_NAME>
```

Expand All @@ -58,9 +64,5 @@ $ poetry run python -m bigmeow.main

Optionally, you can run the application with the following options:

* `--noweb` to run without a web frontend
* `--notg` to run without a telegram bot
* `--nodiscord` to run without a discord bot
* `--noslack` to run without a slack bot

Notice slack and telegram bot would fail to receive event input without the web frontend
* `--nodiscord` to run without a discord bot
123 changes: 122 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ prospector = "^1.10.3"
pytest = "^8.2.1"
ipdb = "^0.13.13"
psutil = "^7.0.0"
pytest-cov = "^6.1.1"
pytest-asyncio = "^1.0.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
Loading