Sha256: d3890c03ba37a0a26eb992b4918d33aae955862ae542bb9de01f875ff778c19f

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

module Ruboty
  module GoodNight
    module AdaptCallback
      BRAIN_NAMESPACE = 'ruboty-goodnight'

      def adapt
        if brain.data[BRAIN_NAMESPACE]
          Thread.new {
            sleep 10
            room.reply('おはようございます')
          }
        end

        super
      end

      def room
        Ruboty::Message.new(brain.data[BRAIN_NAMESPACE].merge(robot: self))
      end
    end
  end

  Robot.prepend(GoodNight::AdaptCallback)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruboty-good-night-0.1.4 lib/ruboty/good_night/adapt_callback.rb