-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to provide help information for bot and commands WIP #69
Conversation
It's a great idea, but maybe part of |
Yep, I thought about |
Right, the author of the command could document it, maybe something like this?
|
Ok, so it's optional feature and we show only documented commands? |
I mean in list of possible commands. We can show not documented plain commands too. |
I say we show all and make it mandatory feature part of the |
So, we'll put the logic that checks that all the commands have documented in
Do you mean for specific command? |
You can default to blank when a command isn't documented. I mean if you want to replace the built-in Help command (that you're coding) by something else you can always make your own. |
I think that What about backward compatibility? User should be define all help attributes or replace built-in help command? |
I wouldn't worry too much about backward compatibility here. We can provide an entry in UPGRADING that explains how to do it by hand. |
b4ee1fa
to
50d9203
Compare
@@ -1,6 +1,10 @@ | |||
require 'slack-ruby-bot' | |||
|
|||
class Bot < SlackRubyBot::Bot | |||
title 'ping' | |||
desc 'Sends you pong.' | |||
long_desc '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we don't require this? For demo purposes maybe remove this line?
Overall, this is great, but I still have a problem with scope. When something inherits from title 'foo'
command 'foo' do ...
end
title 'bar'
command 'bar' do ...
end Which just means that a new help do
title 'Weather Bot'
desc 'This bot tells you the weather.'
command 'clouds' do
desc 'Tells you how many clouds there're above you.'
end
command 'What's the weather in <city>?' do
desc 'Tells you the weather in a <city>.'
long_desc '...'
end
end What do you think? |
Yeah, I see. I think it would be great. I'll try to implement it. |
But may be |
fc6651a
to
239485b
Compare
|
||
class << self | ||
|
||
private |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't have private class methods. You can just make this a regular method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really, it's possible. http://domon.cc/2013/12/25/private-class-methods-in-ruby/
I already have done it here: https://github.com/dblock/slack-ruby-bot/blob/master/lib/slack-ruby-bot/commands/base.rb#L81 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm learning. Thanks!
This is great. It needs specs, documentation, CHANGELOG, etc and it will be good to go. |
24bcb48
to
27a4877
Compare
7a39b85
to
2a7cfd0
Compare
2a7cfd0
to
8046fb7
Compare
ready. check it, please. |
This is great, merged. |
Hi @dblock!
In process now. I'd like to add ability for showing all possible commands. What do you think about it?