Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timelessnesses/countable
A alphabet count bot inspired by Counting
https://github.com/timelessnesses/countable
alphabet discord-py discordpy docker english fun poetry postgres python replit sql
Last synced: about 1 month ago
JSON representation
A alphabet count bot inspired by Counting
- Host: GitHub
- URL: https://github.com/timelessnesses/countable
- Owner: timelessnesses
- License: mpl-2.0
- Created: 2022-05-10T21:30:18.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T18:03:13.000Z (9 months ago)
- Last Synced: 2024-03-15T19:27:08.930Z (9 months ago)
- Topics: alphabet, discord-py, discordpy, docker, english, fun, poetry, postgres, python, replit, sql
- Language: Python
- Homepage:
- Size: 418 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# countable
A alphabet count bot inspired by Counting
## How this works
You continue saying alphabet in order like this
```text
a
b
...
z
```But when it reached ended sequel, you add a character to it like you counting a number like this
```text
aa
ab
...
az
ba
bb
bc
...
bz
```etc.
If you ruined the chain you will be logged and people can look at who ruined the chain.
This entire came from snaky's idea and inspired by counting bot## How to setup
There's 2 types you can host this bot.
- Replit (likely the easiest)
- Docker (easier than replit and can be scaled)
- Others (applies to others that they don't show the files publicly)## Replit
Clone my [repl](https://replit.com/@Mooping/alphabet-count-bot) is the easiest way but you can follow stuff below.
Clone my repository and tell replit to run the following command everytime repl starts up```bash
python bot.py
```You also likely need to install packages using poetry (I think it is install for it automatically)
```bash
poetry install
```You need to also need to add env var via `Secrets` like:
```dotenv
ALPHABET_DB_HOST=
ALPHABET_DB_PORT=
ALPHABET_DB_USER=
ALPHABET_DB_PASSWORD=
ALPHABET_DB_NAME=
ALPHABET_URI=
ALPHABET_TOKEN=
IS_REPLIT=any value (this is for replit)
```Start repl up and you should be good to go(?)
## Docker
### Compose (Easiest)
Create new file called `compose.yaml` with these contents inside:
```yaml
services:
countable:
image: ghcr.io/timelessnesses/countable
environment:
- ALPHABET_DB_HOST=db
- ALPHABET_DB_PORT=5432
- ALPHABET_DB_USER=countable
- ALPHABET_DB_PASSWORD=countable
- ALPHABET_DB_NAME=countables
- ALPHABET_TOKEN=
db:
image: postgres:14
environment:
- POSTGRES_USER=countable
- POSTGRES_PASSWORD=countable
- POSTGRES_DB=countables
volumes:
- data:/var/lib/postgresql/data
volumes:
data:
```Then start it up with `docker compose up` (add `-d` for running it in the background)
### Running directly from an image
Clone the image with `docker pull ghcr.io/timelessnesses/countable:latest` and run it by
```sh
docker run ghcr.io/timelessnesses/countable -e ALPHABET_DB_HOST= -e ALPHABET_DB_PORT= -e ALPHABET_DB_USER= -e ALPHABET_DB_PASSWORD= -e ALPHABET_DB_NAME= -e ALPHABET_TOKEN=
```### Cloned from GitHub Repository (Compose)
Create `.env` with these contents inside:
```sh
ALPHABET_TOKEN=
```Then run `make compose_run`
### Cloned from GitHub Repository (Image)
You need `make` for this to work.
Run `make build_image` then run
```sh
docker run countable_dev:latest -e ALPHABET_DB_HOST= -e ALPHABET_DB_PORT= -e ALPHABET_DB_USER= -e ALPHABET_DB_PASSWORD= -e ALPHABET_DB_NAME= -e ALPHABET_TOKEN=
```## Others
Rename .env.example to .env and add your env vars.
```dotenv
ALPHABET_DB_HOST=
ALPHABET_DB_PORT=
ALPHABET_DB_USER=
ALPHABET_DB_PASSWORD=
ALPHABET_DB_NAME=
ALPHABET_URI=
ALPHABET_TOKEN=
```and run `python -m pip install poetry` then `python -m poetry install` then `python -m poetry shell` and run `python bot.py`
# Current State
- [x] Stable
- [ ] Broken