Bug 206528 - [bot] (KOS-MOS) should privately provide list of commands when asked
Summary: [bot] (KOS-MOS) should privately provide list of commands when asked
Status: CLOSED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.0.0M4   Edit
Assignee: Remy Suen CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-10-16 16:28 EDT by Jeff Ramsdale CLA
Modified: 2008-05-18 19:49 EDT (History)
3 users (show)

See Also:


Attachments
patch to add ~list command (59.65 KB, patch)
2007-10-23 18:06 EDT, Nick Boldt CLA
no flags Details | Diff
same patch again w/ linux line endings (much smaller patch) (4.53 KB, patch)
2007-10-23 18:10 EDT, Nick Boldt CLA
no flags Details | Diff
generate html output (6.84 KB, patch)
2007-10-30 00:33 EDT, Nick Boldt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Ramsdale CLA 2007-10-16 16:28:07 EDT
Build ID: n/a

Steps To Reproduce:
1. Join #eclipse
2. Type ~list
3. Nothing happens!

More information:
A Better option:
1. Join #eclipse
2. Type ~list
3. KOS-MOS responds via private msg with list of available commands.

Alternatively, command could be ~commands (or both ~list and ~commands could work).

Note: ~commands is currently mapped to point to the wiki with the promise of a list of commands, except <https://bugs.eclipse.org/bugs/show_bug.cgi?id=201751> prevents the wiki from being a useful provider of mapped commands.
Comment 1 Remy Suen CLA 2007-10-16 17:46:44 EDT
It'd have to do this at a very slow pace or something. Attempting to send too many messages at a time will get the bot kicked off of the server.

The 'commands' command has been removed for the time being to prevent confusions.
Comment 2 Nick Boldt CLA 2007-10-23 15:28:10 EDT
what about a request to copy the latest version of the source properties file into the webserver root on ecf.eclipse.org, then have the bot spit back a link to that page?

We could get fancy and add a properties-file-to-wiki-markup converter which would not only copy the file but reformat it so it would be easy to just cut n' paste that into the wiki. Of course at that point there's no need since the file on ecf.eclipse.org could just be linked to from the wiki, negating the need to clone the information in two places / two formats.

If you give me details about how the webserver is structured on ecf.eclipse.org (I assume the web root is in /var/www/html/) and where on the server the properties file lives, I can cobble together a patch for this.
Comment 3 Remy Suen CLA 2007-10-23 15:42:28 EDT
The web root is in /var/www/html as you guessed, which loads http://ecf.eclipse.org. The properties file is currently in /home/rcjsuen/bot/plugins/org.eclipse.ecf.presence.bot.kosmos_1.0.0.200709281923/messages.properties.
Comment 4 Nick Boldt CLA 2007-10-23 18:06:48 EDT
Created attachment 81002 [details]
patch to add ~list command

copies messages.properties to /home/rcjsuen/public_html/IRC_bot_messages.txt, then echoes a pointer to that URL to the requesting user.
Comment 5 Nick Boldt CLA 2007-10-23 18:10:53 EDT
Created attachment 81003 [details]
same patch again w/ linux line endings (much smaller patch)
Comment 6 Nick Boldt CLA 2007-10-23 18:42:57 EDT
Y'know, a simpler approach would be to just symlink the messages.properties file from inside your ~/public_html folder ... ;-)

might still be better to dump the contents as HTML instead of just a verbatim copy. thoughts?

eg., instead of 

keyword=some bit of text

we could dump

<li><b>keyword</b>: some bit of text</li>

or 

<tr><td><b>keyword</b></td><td>some bit of text</td></tr>

just so it's more legible...
Comment 7 Remy Suen CLA 2007-10-23 18:54:04 EDT
(In reply to comment #6)
> might still be better to dump the contents as HTML instead of just a verbatim
> copy. thoughts?

Right. The file right itself is not very readable in its raw form since there is no spacing whatsoever.
Comment 8 Nick Boldt CLA 2007-10-30 00:33:48 EDT
Created attachment 81548 [details]
generate html output

this version outputs a simple HTML table instead of just copying the properties file to a text file; also turns URLs into links and makes ~commands appear red so they're more visible
Comment 9 Remy Suen CLA 2007-11-02 23:35:08 EDT
Fixed in CVS HEAD. Thanks Nick, for the patch, I had to do some tweaking, but whatever.
Comment 10 Nick Boldt CLA 2007-11-03 00:21:57 EDT
Yes, as discussed it makes more sense to update the HTML file with every change to the properties file rather than just when people fire a ~list command.

Next time I'll make sure I get all the NLS markers in place and format multi-line strings according to the ECF style guide. ;-)
Comment 11 Scott Lewis CLA 2008-05-18 19:49:34 EDT
closing