Skip to content

Instantly share code, notes, and snippets.

@kidach1
Last active August 29, 2015 14:06
Show Gist options
  • Save kidach1/797b0ebdd2f4cd8c754a to your computer and use it in GitHub Desktop.
Save kidach1/797b0ebdd2f4cd8c754a to your computer and use it in GitHub Desktop.
コード1行でBotがSlackへ通知してくれるGemを公開しました ref: http://qiita.com/kidachi_/items/debfd0474d0888e5b1f1
# Call me anywhere
SlackBot.notify
# Call me anywhere
SlackBot.notify
SlackBot.notify(
body: 'Custom body!',
bot_name: 'CustomBot',
channel: 'custom-channel'
)
#Call me anywhere
SlackBot.notify(
body: "[#{Rails.env}] Custom body!",
bot_name: "CustomBot"
)
SlackBot.setup do |config|
config.token = <YOUR_API_TOKEN>
config.channel = <YOUR_CHANNEL_OR_GROUPE_NAME>
config.bot_name = <BOT_NAME>
config.message = <DEFAULT_MESSAGE>
end
SlackBot.setup do |config|
config.token = xxxxxx
config.channel = '#sample-channel'
config.bot_name = 'SlackBot'
config.body = "[#{Rails.env}] Hello, SlackBot!"
end
SlackBot.setup do |config|
config.token = xxxxxx
config.channel = '#sample-channel'
config.bot_name = 'SlackBot'
config.body = "[#{Rails.env}] Hello, SlackBot!"
end
SlackBot.setup do |config|
config.token = xxxxxx
config.channel = '#sample-channel'
config.bot_name = 'SlackBot'
config.body = "[#{Rails.env}] Hello, SlackBot!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment