Skip to content

Major Overhaul of roll handling, Dynamic channel whitelist, admin commands, and autotest rework#17

Open
mfriik wants to merge 22 commits into
paqul:developfrom
mfriik:dev
Open

Major Overhaul of roll handling, Dynamic channel whitelist, admin commands, and autotest rework#17
mfriik wants to merge 22 commits into
paqul:developfrom
mfriik:dev

Conversation

@mfriik
Copy link
Copy Markdown
Collaborator

@mfriik mfriik commented May 20, 2026

Whitelist

  • Add ChannelWhitelistStore with persistent JSON storage (config/channel_whitelist.json)
  • Seed JSON from existing channels_whitelist.py on first run
  • Channel check now uses channel.id + channel.name (case-insensitive)
  • Auto git commit on branch after every successful Add_Channel

Admin mention commands

  • Add @bot Add_Channel <name|#mention> — only ALLOWED_ADMIN_USER_IDS
  • Block DM usage, handle duplicates, unknown channels, missing args
  • Shared admin user ID list (ALLOWED_ADMIN_USER_IDS in bot_config.py)

Autotest rework

  • New autotest.py: dynamic test runner covers all command types
    (regular, modifier, advantage/disadvantage, CoC bonus/penalty,
    Mork Borg k66, statystyki_dnd, help, edge cases)
  • @bot autotest summary — runs tests locally,
    sends one pass/fail summary message to Discord channel
  • @bot autotest — original chat-iteration mode preserved
  • @bot stop — stops legacy task; admin-only like all above
  • Removed static hardcoded auto_test() from bot_config.py

Misc

  • Fix handle_name_response signature (author param now optional)
  • Guard against bot echoing its own messages in on_message
  • README updated with new commands and admin config instructions

mfriik and others added 22 commits August 10, 2024 09:12
updated readme to provide overview of bot deployment and use
* Refactor bot_config.py for improved readability and remove unused files

* Update README.md with auto-restart instructions and enhance bot_config.py channel organization; remove roles.py

* Moved Whitelist from bot config to separate file - channels_whitelist.py with main and test channel configurations

* Add systemd service configuration for MinionBot - due to missing filementioned in readme

---------

Co-authored-by: Michal Milobedzki <michal.milobedzki@pl.abb.com>
## Whitelist
- Add ChannelWhitelistStore with persistent JSON storage (config/channel_whitelist.json)
- Seed JSON from existing channels_whitelist.py on first run
- Channel check now uses channel.id + channel.name (case-insensitive)
- Auto git commit on branch after every successful Add_Channel

## Admin mention commands
- Add @bot Add_Channel <name|#mention> — only ALLOWED_ADMIN_USER_IDS
- Block DM usage, handle duplicates, unknown channels, missing args
- Shared admin user ID list (ALLOWED_ADMIN_USER_IDS in bot_config.py)

## Autotest rework
- New autotest.py: dynamic test runner covers all command types
  (regular, modifier, advantage/disadvantage, CoC bonus/penalty,
   Mork Borg k66, statystyki_dnd, help, edge cases)
- @bot autotest / @bot autotest summary — runs tests locally,
  sends one pass/fail summary message to Discord channel
- @bot autotest legacy — original chat-iteration mode preserved
- @bot stop — stops legacy task; admin-only like all above
- Removed static hardcoded auto_test() from bot_config.py

## Misc
- Fix handle_name_response signature (author param now optional)
- Guard against bot echoing its own messages in on_message
- README updated with new commands and admin config instructions
bot_config: change default autotest mode to legacy
@mfriik mfriik requested a review from paqul May 20, 2026 20:00
@mfriik mfriik self-assigned this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant