Skip to content

About

Discord bot for mapping pearls in Breadwinner World

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

ScatterBot

CI Dependency Review

A Discord bot for collecting, managing, and visualizing village map data with scatter plots and town-layout tools.

Status

Features

  • 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.

Requirements

  • Python 3.10+
  • A Discord application and bot token

Getting Started

1. Clone the repository

git clone https://github.com/AleksanderKGH/ScatterBot.git
cd ScatterBot

2. Create your environment file

Create 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=1575299953407037652

Notes:

  • VILLAGES is optional. If omitted, built-in defaults are used.
  • Fill each pearl ping role ID with that existing Discord role's ID. /pearlping lets members opt into multiple configured milestone roles; leave a role ID blank to disable that tier.
  • Fill PEARL_REFILLER_ROLE_ID to mention Pearl Refiller on the daily reset message. The bot needs permission to mention the configured roles.
  • Never commit .env.

3. Install dependencies

pip install -r requirements.txt

4. Run the bot

python main.py

Bot Commands

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.

GitHub Actions

This repository now includes two workflows:

  • CI (.github/workflows/ci.yml)

    • 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 in pyproject.toml.
    • Validates syntax/importability with python -m compileall ..
  • Dependency Review (.github/workflows/dependency-review.yml)

    • Runs on pull requests.
    • Flags risky dependency changes using GitHub's dependency review action.

Recommended Branch Protection

For your default branch (main), enable these GitHub settings:

  1. Require a pull request before merging.
  2. Require approvals (at least 1).
  3. Require status checks to pass before merging:
    • Python 3.10
    • Python 3.11
    • Python 3.12
    • dependency-review
  4. Require branches to be up to date before merging.
  5. Dismiss stale approvals when new commits are pushed.
  6. Restrict force pushes and deletions.

Project Structure

ScatterBot/
|-- main.py
|-- commands.py
|-- config.py
|-- data.py
|-- utils.py
|-- views.py
|-- xp.py
|-- command_modules/
|-- .github/workflows/
|-- requirements.txt
`-- readme.md

Contributing

Issues and pull requests are welcome.

About

Discord bot for mapping pearls in Breadwinner World

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages