aboutsummaryrefslogtreecommitdiffstats
path: root/jeeves/help.py
diff options
context:
space:
mode:
authorAhmed <git@gumx.cc>2026-06-14 01:46:29 +0300
committerAhmed <git@gumx.cc>2026-06-14 01:46:29 +0300
commit5a8d568931d9b23ce0df1265d05259a7012081c9 (patch)
tree4ea19b8bb1763a38246f342f172c285f6579e09b /jeeves/help.py
init: mostly vibed
Diffstat (limited to 'jeeves/help.py')
-rw-r--r--jeeves/help.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/jeeves/help.py b/jeeves/help.py
new file mode 100644
index 0000000..ac953ff
--- /dev/null
+++ b/jeeves/help.py
@@ -0,0 +1,32 @@
+"""
+Sopel plugin: jeeves help
+
+Three-level help system:
+ !help - topics overview
+ !help <topic> - commands in that topic
+ !help <cmd> - command description
+ !help <topic> <cmd> - same as above
+"""
+
+import os as _os, sys as _sys
+_d = _os.path.dirname(_os.path.abspath(__file__))
+if _d not in _sys.path:
+ _sys.path.insert(0, _d)
+import jv_core as jv
+import helpstrings as h
+
+from sopel import plugin
+
+
+def setup(bot):
+ jv.ensure_setup(bot)
+
+
+@plugin.command("help")
+def cmd_help(bot, trigger):
+ args = (trigger.group(2) or "").split()
+ result = h.lookup(args)
+ if result:
+ bot.notice(result, trigger.nick)
+ else:
+ bot.notice(f"no help for '{' '.join(args)}'. {h.TOPICS}", trigger.nick)