Skip to content

Instantly share code, notes, and snippets.

@dariubs
Created October 15, 2016 23:41
Show Gist options
  • Save dariubs/a2c4d5cb3e41c332a954b53b6de75fbc to your computer and use it in GitHub Desktop.
Save dariubs/a2c4d5cb3e41c332a954b53b6de75fbc to your computer and use it in GitHub Desktop.

Revisions

  1. dariubs created this gist Oct 15, 2016.
    15 changes: 15 additions & 0 deletions ibot-first.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    require 'ibot'

    bot = IBot.new('mybot')

    bot.add_group 'greeting'
    bot.add_group 'goodby'

    bot.add_pattern 'greeting', /hi/i
    bot.add_pattern 'greeting', /hello/i

    bot.add_response 'greeting', 'Hello.'
    bot.add_response 'greeting', 'Holla.'

    out = bot.response bot.text_group 'Hello, world!'
    puts out