Sha256: 6f7ca8aac57ffed95b7b4e0d4200a2aff6ebd4d69be78e1b664542cc7cab2390

Contents?: true

Size: 442 Bytes

Versions: 3

Compression:

Stored size: 442 Bytes

Contents

# frozen_string_literal: true

Del.configure do |x|
  puts 'Registering custom routes.'

  x.router.register(/.*/) do |message|
    Del.logger.info('Backwards!')
    message.reply(message.text.reverse)
  end

  x.router.register(/^cowsay (.*)/) do |message, match_data|
    Del.logger.info('COWSAY!')
    message.execute_shell(['cowsay', match_data[1]])
  end

  x.router.register(/^[Hh]ello/) do |message|
    message.reply('Hi!')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
del-0.1.19 lib/del/examples/routes.rb
del-0.1.18 lib/del/examples/routes.rb
del-0.1.17 lib/del/examples/routes.rb