[V3 Config] Record custom group information using cog_add event (#2550)

* Do things differently

* Uncomment critical lines

* Reduce, reuse, recycle

* Check groups on all new config objects after a cog loads

* I don't know why this is failing now or why we need the global keyword

* gotta fix this too
This commit is contained in:
Will
2019-04-09 22:02:50 -04:00
committed by GitHub
parent e347ffa336
commit ba19179e4f
3 changed files with 25 additions and 0 deletions

View File

@@ -18,6 +18,8 @@ from .help_formatter import Help, help as help_
from .rpc import RPCMixin
from .utils import common_filters
CUSTOM_GROUPS = "CUSTOM_GROUPS"
def _is_submodule(parent, child):
return parent == child or child.startswith(parent + ".")
@@ -74,6 +76,9 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin):
self.db.register_user(embeds=None)
self.db.init_custom(CUSTOM_GROUPS, 2)
self.db.register_custom(CUSTOM_GROUPS)
async def prefix_manager(bot, message):
if not cli_flags.prefix:
global_prefix = await bot.db.prefix()