Skip to content

Add config-driven meta module loading and introduce ReactionRegister - #61

Open
WolfDakuraito wants to merge 6 commits into
Quasky:mainfrom
WolfDakuraito:main
Open

Add config-driven meta module loading and introduce ReactionRegister#61
WolfDakuraito wants to merge 6 commits into
Quasky:mainfrom
WolfDakuraito:main

Conversation

@WolfDakuraito

Copy link
Copy Markdown

Summary

This PR reworks how optional meta modules are loaded and adds a new one: ReactionRegister.

The goal here is to make optional modules easier to add without hardcoding each one directly in bridgeipelago.py.

Core changes

  • changed LoadMetaModules() to load enabled modules from MetaConfig
  • added support for module setup() hooks

New module: ReactionRegister

  • added a new optional module for reaction-based slot subscriptions
  • users can react to subscribe to slot
    • supports direct user subscriptions
    • supports role-based subscriptions for group games
  • added a $setupreactionregister setup flow
  • stores its own config and slot mapping data per UniqueID
  • updates managed messages when reactions are added or removed
  • added safer handling for setup timeouts, invalid input, missing channels, missing guilds, missing members, and missing roles
  • mirrors individual subscriptions into the existing RegistrationData system
    • individual reaction-based subscriptions now behave like $register / $clearreg

DeathlinkFlavor

  • updated DeathlinkFlavor so it works with the new dynamic module loading flow
  • kept the existing flavor text behavior intact

Config changes

  • updated config.json.template

  • added ReactionRegister to MetaConfig

  • aligned meta module naming with the new loader behavior by renaming FlavorDeathlink to DeathlinkFlavor

    Why

    The old meta module setup was still mostly hardcoded.
    This change makes the system more reusable and gives me a cleaner base for adding future optional modules.

Testing

Confirmed working:

  • dynamic module loading
  • DeathlinkFlavor loading
  • ReactionRegister setup flow
  • reaction add/remove handling
  • role assignment/removal
  • managed message refresh
  • RegistrationData sync for individual subscriptions
  • setup cancellation and invalid input handling

Notes

This is built around the pre-3.0 modular direction, so some naming was adjusted to fit config-driven loading more cleanly.

I may add another module later that complements ReactionRegister. I originally planned for this to pair with hint notifications in the main Discord channel, but I wanted to get the base system and this module in first.

 - add a standalone ReactionRegister module for Discord-based slot subscriptions
 - store module configuration and managed message metadata in per-UniqueID JSON files
 - generate subscription messages with reaction bindings for Archipelago slots
 - support both direct user subscriptions and role-backed subscriptions for group games
 - add guided setup flow through $setupreactionregister
 - update managed messages dynamically when reactions are added or removed
 - validate setup input for missing replies, missing channel mentions, and inaccessible channels
 - improve resilience around Discord message fetch/edit/delete operations
 - harden raw reaction handlers against missing guilds, members, and roles
 - add module-level error logging via the core error log hook
- add ReactionRegister as a configurable optional module
- rename FlavorDeathlink to DeathlinkFlavor to match module-based loading (see Bridgeipelago.py changes)
- generalize LoadMetaModules() to load optional modules from MetaConfig
- replace the previous hardcoded DeathlinkFlavor import path with dynamic module loading
- call module setup() hooks when present so modules can attach their own bot behavior
- expose module contents to the runtime so optional modules can integrate with existing core behavior
- enable Discord member intent required by reaction-based subscription modules
- keep module loading controlled through configuration flags
update DeathlinkFlavor for the new dynamic meta-module loading
- make individual reaction subscriptions also register users in RegistrationData
- mirror $register / $clearreg behavior through the reaction system
- leave role-based subscriptions untouched
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