# Drb application in bots

**URL:** <https://www.ruby-forum.com/t/drb-application-in-bots/124594>\
**Category:** Ruby\
**Created:** [December 30, 2007, 7:52pm UTC](https://www.ruby-forum.com/t/drb-application-in-bots/124594 "2007-12-30T19:52:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [December 30, 2007, 7:52pm UTC](https://www.ruby-forum.com/t/drb-application-in-bots/124594/1 "2007-12-30T19:52:19Z")

</div>

Hello.  
I am doing a drb application for a bot client and have a prob. How can  
i set up the server so that it will accept a string and do someaction  
like bot.deliver(string)

bot server  
!/usr/bin/env ruby  
require ‘rubygems’  
require ‘jabber/bot’  
require ‘fileutils’  
require ‘drb’

# Create a public Jabber::Bot

$bot = Jabber::Bot.new(  
:jabber\_id =\> ‘removed\_email\_address@domain.invalid’,  
:password =\> ‘pass’,  
:master =\> ‘removed\_email\_address@domain.invalid’,  
:is\_public =\> true  
)

Thread.new do  
$bot.connect  
end

puts “starting anothe rsergice”  
DRb.start\_service(‘druby://localhost:9000’,  
$bot.deliver("removed\_email\_address@domain.invalid,somestring)  
DRb.thread.join # Don’t exit just yet!  
puts “starting anothe service”

# Bring the new bot to life

Bot client  
irb(main):013:0\> obj = DRbObject.new(nil, ‘druby://localhost:9000’)  
=\> #\<DRb::DRbObject:0x2e4a80c @uri=“druby://localhost:9000”, @ref=nil\>  
irb(main):014:0\> obj.im(“this is a true bot.”)
