Project

beeline-rb

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

Development

= 1.8.0, ~> 1.8
~> 2.0, >= 2.0.1
~> 11.1, = 11.1.3
~> 1.2, = 1.2.7
~> 5.14, = 5.14.2
~> 0.6, = 0.6.5
~> 0.13, = 0.13.1
~> 0.2, = 0.2.5
~> 13.0, >= 13.0.1
~> 0.5, = 0.5.5
= 0.19.0, ~> 0.19
= 6.0.0, ~> 6.0
~> 3.9, = 3.9.1
~> 0.9, = 0.9.25

Runtime

= 1.0.0, ~> 1.0
~> 0.1, = 0.1.4
 Project Readme

BeeLine is a BeeChat Client Framework for Ruby. BeeChat has been designed by @reazuliqbal. BeeLine provides abstraction to for ruby developers to interact through the BeeChat API.

Installation

Add to your Gemspec

gem 'beeline-rb', require 'beeline'
bundle install

--or--

In your project ...

gem install beeline-rb
require 'beeline'

Usage

From the root of your project, add a file called config.yml containing (using your own account information):

# Example config.yml

:chain:
  :hive_account: social
  :hive_public_key: STM5ctejUsoZ9FwfCaVbNvWYYgNMBo9TVsHSE8wHrqAmNJi6sDctt
  :hive_posting_wif: 5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC
  :hive_api_url: https://api.openhive.network

In your project, access the session:

require 'beeline'

bot = Beeline::Bot.new(prefix: '$')

# Just match on a message.
bot.message('Ping!') do
  'Pong!'
end

# Match on a pattern.
bot.message(/\d+/) do
  'Yes, those are numbers.'
end

# Respond to `$time` with current time.
bot.command(:time) do
  Time.now.to_s
end

# Respond to `$say` with reply.
bot.command(:say) do |args|
  if args.nil?
    'What do you want me to say?'
  else
    "You wanted me to say: #{args}"
  end
end

# Start the bot run loop.
bot.run

See some of my previous Ruby How To posts in: #radiator #ruby

Get in touch!

If you're using Tender, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on Hive.

License

I don't believe in intellectual "property". If you do, consider BeeLine as licensed under a Creative Commons CC0 License.