From 55a6881891f8b078601c6be2ed1b8c0a40d19148 Mon Sep 17 00:00:00 2001 From: Florian Strzelecki Date: Mon, 18 May 2020 15:01:47 +0200 Subject: [PATCH] bot: fix plugin name in _command_groups The "_command_groups" attribute is used to generate the documentation for plugin's command (there is an old piece of code for some undocumented feature here but that's something else). The problem is that it tries to derive the plugin's name from the Python module the callable come from, instead of, you know, the actual plugin's name. Since we added the "plugin_name" attribute on all callable back in 8776354b7aae7087f090a0989181400899f6c0d0 (see #1840) we can now use it safely for the command group. One-line fix for you all! --- sopel/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sopel/bot.py b/sopel/bot.py index 5e9469d52f..779a3f07b4 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -470,7 +470,7 @@ def register(self, callables, jobs, shutdowns, urls): callable_name) if commands: - plugin_name = callbl.__module__.rsplit('.', 1)[-1] + plugin_name = callbl.plugin_name # TODO doc and make decorator for this. Not sure if this is how # it should work yet, so not making it public for 6.0. category = getattr(callbl, 'category', plugin_name)