A Discord bot for collecting, managing, and visualizing village map data with scatter plots and town-layout tools.
- CI workflow: ci.yml
- Dependency review workflow: dependency-review.yml
- Pull requests list: Open PRs
- Slash commands for point submission, plotting, and village summaries.
- Daily reset cycle with optional reset announcements and GOAT stat callouts.
- JSON-based persistence for points, XP, backups, and town layouts.
- Town rendering and chunk-based town editing workflows.
- Role/channel guards for sensitive/admin operations.
- Autocomplete for villages, colors, and town names.
- Python 3.10+
- A Discord application and bot token
git clone https://github.com/AleksanderKGH/ScatterBot.git
cd ScatterBotCreate a .env file in the project root:
ENV=DEV
DISCORD_TOKEN=your_token_here
LOG_CHANNEL_ID=123456789012345678
POINT_CHANNEL_ID=123456789012345678
PLOT_CHANNEL_ID=123456789012345678
GUILD_ID=123456789012345678
RESIDENT_ROLE_ID=123456789012345678
PEARL_ROLE_ID=123456789012345678
VILLAGES=Dogville,Wheat Street,An Bread Capital
PEARL_REFILLER_ROLE_ID=1575295378985590805
DOGVILLE_PING_10_ROLE_ID=1575545053152153722
DOGVILLE_PING_20_ROLE_ID=1575296083867996270
DOGVILLE_PING_33_ROLE_ID=1575296868014096445
DOGVILLE_PING_55_ROLE_ID=1575296928244301845
CAPITAL_PING_10_ROLE_ID=1575545122337325086
CAPITAL_PING_20_ROLE_ID=1575296991905185993
CAPITAL_PING_33_ROLE_ID=1575297050092896377
CAPITAL_PING_55_ROLE_ID=1575297303403569314
ALL_PING_20_ROLE_ID=1575297394491269140
ALL_PING_33_ROLE_ID=1575297861145591939
ALL_PING_55_ROLE_ID=1575297891944235128
ALL_PING_70_ROLE_ID=1575298594368397354
ALL_PING_85_ROLE_ID=1575298682058965165
ALL_PING_100_ROLE_ID=1575298752430870600
ALL_PING_115_ROLE_ID=1575299802609098945
ALL_PING_130_ROLE_ID=1575299953407037652Notes:
VILLAGESis optional. If omitted, built-in defaults are used.- Fill each pearl ping role ID with that existing Discord role's ID.
/pearlpinglets members opt into multiple configured milestone roles; leave a role ID blank to disable that tier. - Fill
PEARL_REFILLER_ROLE_IDto mention Pearl Refiller on the daily reset message. The bot needs permission to mention the configured roles. - Never commit
.env.
pip install -r requirements.txtpython main.py| Command | Description |
|---|---|
/point |
Add a point to a village map. |
/undo |
Remove your most recent point from a village. |
/plot |
Plot village points (with fake decoy point). |
/plotdetailed |
Plot village points without fake decoy point. |
/cook |
Generate a shared town route with a requester-specific fake pearl. |
/pearlping |
Choose which configured pearl milestone role pings to receive. |
/botprofile |
Change the bot profile picture from a public HTTPS image URL (available in #pearl-hunter and #pearl-map-helper). |
/villages |
Show point totals by village. |
/townplot |
Render a town layout from towns/<village>.json. |
/townedit |
Open chunk-based town editing tools. |
/xp |
Show XP for yourself or another user. |
/leaderboard |
Show XP leaderboard. |
/incognito |
Opt in/out of appearing in the XP leaderboard. |
/residentjson |
Export users with configured roles as JSON. |
/residentcsv |
Export users with configured roles as CSV. |
/sync |
Sync slash commands to guild (admin only). |
/clearmaps |
Clear all village point data (admin only). |
/noob |
Show command help embed. |
This repository now includes two workflows:
-
- Runs on pushes to
main/master, pull requests, and manual dispatch. - Tests Python 3.10, 3.11, and 3.12.
- Installs dependencies.
- Runs
ruff check .with the starter config inpyproject.toml. - Validates syntax/importability with
python -m compileall ..
- Runs on pushes to
-
Dependency Review(.github/workflows/dependency-review.yml)- Runs on pull requests.
- Flags risky dependency changes using GitHub's dependency review action.
For your default branch (main), enable these GitHub settings:
- Require a pull request before merging.
- Require approvals (at least 1).
- Require status checks to pass before merging:
Python 3.10Python 3.11Python 3.12dependency-review
- Require branches to be up to date before merging.
- Dismiss stale approvals when new commits are pushed.
- Restrict force pushes and deletions.
ScatterBot/
|-- main.py
|-- commands.py
|-- config.py
|-- data.py
|-- utils.py
|-- views.py
|-- xp.py
|-- command_modules/
|-- .github/workflows/
|-- requirements.txt
`-- readme.md
Issues and pull requests are welcome.
- Coding standards: CODING_STANDARDS.md
- Pull request template: .github/pull_request_template.md
- Bug report template: .github/ISSUE_TEMPLATE/bug_report.yml
- Feature request template: .github/ISSUE_TEMPLATE/feature_request.yml