Lullabot / lubot

1 stars 0 forks source link

Add in help script #11

Closed q0rban closed 9 years ago

q0rban commented 10 years ago

We need some help functionality:

q0rban> lubot: help
lubot> Detailed information is available with "lubot: help <feature>" where <feature> is one of: factoids, karma, tell, seen, ..."
q0rban> lubot: help factoids
lubot> Set factoids with "BOTNAME: Drupal is great.", "No, BOTNAME, cats are furry.", "BOTNAME: Drupal is also powerful.", "BOTNAME: cheer is <action>cheers for !who in !channel!", or "BOTNAME: ping is <reply>WHAT?!". Retrieve with "Drupal?" or "BOTNAME: cheer!" Forget with "BOTNAME: forget ping". PM with "BOTNAME: tell newb about support". Browsable at <http://lullabot.lullabotwork.com/bot/factoid>.

Note, the above help was just copy/pasted as an example.

eojthebrave commented 9 years ago

Seems like we'll need a way for scripts to register their help text with the bot.

Something like bot.help.add(key, message)

So you could then do

bot.help.add('factoids', 'Set factoids with "BOTNAME: Seth is tall." ...');

We could then also add

bot.help.summary() which lists all the keys and creates the summary output.

And

bot.help.get('factoid') which retrieves the detailed help for a script.

eojthebrave commented 9 years ago

Here's an attempt at making this happen, and adding some help text for the existing commands.

https://github.com/Lullabot/lubot/pull/29