ZeroKnight / ZeroBot

My personal IRC/Multi-protocol Bot created (and re-created) for education and amusement.
MIT License
1 stars 0 forks source link

Allow features modules to be packages like protocol modules #27

Closed ZeroKnight closed 3 years ago

ZeroKnight commented 3 years ago

Protocol modules can be built as packages, e.g.:

ZeroBot/protocol
├── context.py
└── discord
    ├── classes.py
    └── protocol.py

However, feature modules are detected more naively, and as such only support a single, top-level .py file. In addition to how they are detected currently, feature modules should also be detected the same as protocol modules, with the entry point being a similar feature.py file as an immediate child of the package.

As an example, Quote has become the largest ported feature thus far, weighing in at over 1,000 lines; it would be much better organized as a package. Something like the following:

ZeroBot/feature
├── magic8ball.py
└── quote
    ├── classes.py   # Quote, QuoteLines, Participant, etc.
    ├── commands.py  # _register_commands, command handler/helper functions
    ├── database.py  # _init_tables, fetch functions, etc.
    └── feature.py