""" Sopel plugin: osterman help system !help list topics !help list commands for a topic !help description and usage for a command !help description and usage (topic not required) """ import os as _os, sys as _sys _osterman_dir = _os.path.dirname(_os.path.abspath(__file__)) if _osterman_dir not in _sys.path: _sys.path.insert(0, _osterman_dir) import helpstrings as h from sopel import plugin def _notice(bot, nick, text): bot.notice(text, nick) @plugin.command("help", "h") def cmd_help(bot, trigger): args = (trigger.group(2) or "").split() result = h.lookup(args) if result: _notice(bot, trigger.nick, result) else: _notice(bot, trigger.nick, f"no help for '{' '.join(args)}'. {h.TOPICS}")