-
Notifications
You must be signed in to change notification settings - Fork 167
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
add option[:at] to #ping #66
Conversation
sorry, I don't know well why travis fails... |
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.
This seems like a neat concept that would certainly be useful, could you change it over to be implemented via a middleware? (https://github.com/stevenosloan/slack-notifier#writing-your-own-middleware) if not, no worries -- this test case & implementation should be straightforward enough to move over myself.
lib/slack-notifier.rb
Outdated
@@ -49,6 +51,15 @@ def post payload={} | |||
|
|||
private | |||
|
|||
def add_ats(message, ats) | |||
special_commands = [:here, :channel, :everyone, :group] |
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.
It'll make more sense once it's moved to a middleware, but these should be moved to a class constant.
@stevenosloan |
75d04e3
to
f51b1b9
Compare
f51b1b9
to
0713bef
Compare
@stevenosloan notifier = Slack::Notifier.new
# it can be set as option
# notifier = Slack::Notifier.new url do
# middleware :at [:default_at_user]
# end
notifier.ping("Hi let's go drink tonight!", at: [:john, :ken, :smith, :here, :tailer])
# => {text: "<@john> <@ken> <@smith> <!here> <@tailar> Hi let's go drink tonight!"} |
I don't still know why travis fails.... |
Yeah, no worries about those failures -- were coming from ku1ik/rainbow#48 (hoping the suggested fix works). Thanks for taking the time to reformat that! I'll look at cutting a |
Thank you so much :) !! |
Hi, I added at option to #ping method.
In default text option, need to write like this to add @ or special command.
message tend to be long and little hard to read
so I added at option it can be written like this.
thanks,