Project

jabot

0.0
No commit activity in last 3 years
No release in over 3 years
Jabber bot with DSL
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

>= 0
 Project Readme

Jabot is a jabber bot that provides DSL for configuration.

Installation

$ gem install jabot

Or with Bundler in your Gemfile.

gem 'jabot'

Default commands

stop
Stop bot listening. Also stop main loop, if bot in standalone mode.
help
Commands list.

Example bot.rb file

require 'jabot'

Jabot.start do
    #if you are running in console, this is start a main loop
    standalone_mode

    username 'username@jabber.com'
    password '*****'
    #clients who allowed to send commands
    clients %w{client@jabber.com}

    #example in messenger
    #me: download_file 'http://example.com/image.jpg' '/home/user/image.jpg'
    command :download_file do |url, save_path|
      spawn("wget -c -O '#{save_path}' '#{url}'")
    end

    #if it returns not empty string, it's sent to you
    command :hello do
      'Hello!'
    end
end