Sha256: 8f097a56f340cdbd702574b53ff87f1080839ae8f427298ba23dfcbc0563a928

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 Bytes

Contents

require 'mobb'

set :service, 'slack'
set :name, "example bot"

before do
  puts "=========="
  puts "before filter"
  puts @env.body
  puts "=========="
end

after do
  puts "=========="
  puts "after filter"
  puts @body
  puts "=========="
end

on "hello" do
  "Hi! I'm #{settings.name}"
end

# Warning this is bad implementation
# inifinity loop happend
# TODO: now broken
#receive "Yo", laziness: true do
#  "Yo"
#end

receive /hey (\w+)/ do |someone|
  "hey #{someone}, waz up?"
end

# Need dest_to condition to cron/every task
every :day, at: '12:30', dest_to: 'times_kinoppyd' do
  'Stund up daily meeting time!'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mobb-0.5.1 examples/slack_bot.rb
mobb-0.5.0 examples/slack_bot.rb
mobb-0.4.0 examples/slack_bot.rb