From 5a8d568931d9b23ce0df1265d05259a7012081c9 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Sun, 14 Jun 2026 01:46:29 +0300 Subject: init: mostly vibed --- osterman/help.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 osterman/help.py (limited to 'osterman/help.py') diff --git a/osterman/help.py b/osterman/help.py new file mode 100644 index 0000000..fdc94c0 --- /dev/null +++ b/osterman/help.py @@ -0,0 +1,30 @@ +""" +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}") -- cgit v1.2.3