Skip to content
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

Merged
merged 2 commits into from
Feb 21, 2017

Conversation

kazuooooo
Copy link
Contributor

Hi, I added at option to #ping method.

In default text option, need to write like this to add @ or special command.

notifier.ping "<@john> <@ken> <@smith> <!here> <@tailar> Hi let's go drink tonight!"

message tend to be long and little hard to read

so I added at option it can be written like this.

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!"}

thanks,

@kazuooooo
Copy link
Contributor Author

sorry, I don't know well why travis fails...

Copy link
Member

@stevenosloan stevenosloan left a 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.

@@ -49,6 +51,15 @@ def post payload={}

private

def add_ats(message, ats)
special_commands = [:here, :channel, :everyone, :group]
Copy link
Member

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.

@kazuooooo
Copy link
Contributor Author

@stevenosloan
Thank you for your review.
OK, I'm going to try moving it to middleware.

@kazuooooo kazuooooo force-pushed the add-at-option branch 3 times, most recently from 75d04e3 to f51b1b9 Compare February 17, 2017 08:43
@kazuooooo
Copy link
Contributor Author

@stevenosloan
hi 😄 I moved at option to middle ware.
could you check again?

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!"}

@kazuooooo
Copy link
Contributor Author

I don't still know why travis fails....
Probably, it's not caused of my implementation.
Sorry for that 🤕

@stevenosloan stevenosloan merged commit 0713bef into slack-notifier:master Feb 21, 2017
@stevenosloan
Copy link
Member

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 2.1.0 release sometime this week.

@kazuooooo
Copy link
Contributor Author

Thank you so much :) !!
Looking forward next release!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants