class DevTrainingBot::SlackService
Public Class Methods
new()
click to toggle source
# File lib/dev_training_bot/services/slack_service.rb, line 11 def initialize @client = Slack::Web::Client.new @client.auth_test end
Public Instance Methods
create_poll(topics)
click to toggle source
# File lib/dev_training_bot/services/slack_service.rb, line 16 def create_poll(topics) return no_topics_available if topics.empty? next_friday = Chronic.parse('next friday').to_date @client.chat_command channel: ENV['SLACK_CHANNEL'], command: '/poll', text: "\"@engineering Vote for the next dev learning! [#{next_friday}]\" #{topics}" end
link_doc()
click to toggle source
# File lib/dev_training_bot/services/slack_service.rb, line 32 def link_doc @client.chat_postMessage channel: ENV['SLACK_CHANNEL'], text: GoogleDriveService::DOC_URL, as_user: true end
no_topics_available()
click to toggle source
# File lib/dev_training_bot/services/slack_service.rb, line 26 def no_topics_available @client.chat_postMessage channel: ENV['SLACK_CHANNEL'], text: '<!engineering> Please propose your topics for the next Dev Learning!', as_user: true end