Net::Jabber::Bot|yvesago|agostini@univ-metz.fr|1212476512|yvesago|xx|0|193.50.117.72|rivescript works fine on xmpp, jabber gtalk with Net::Jabber::Bot<br /><br />see here some sample code :<br /><br />[code]sub new_bot_message &#123;<br /> &nbsp; &nbsp;my %bot_message_hash = @_;<br /> &nbsp; &nbsp;my %command_actions;<br /> &nbsp; &nbsp;$command_actions&#123;'subject'&#125; &nbsp;= \&amp;bot_change_subject; &nbsp; &nbsp;if(defined $command_actions&#123;$command&#125;) &#123;<br /> &nbsp; &nbsp; &nbsp; &nbsp;$command_actions&#123;$command&#125;-&gt;(\%bot_message_hash, @options);<br /> &nbsp; &nbsp;&#125; else &#123;<br /> &nbsp; &nbsp; &nbsp; &nbsp;$command_actions&#123;'chat'&#125;-&gt;(\%bot_message_hash, $bot_message_hash&#123;body&#125;);<br /> &nbsp; &nbsp;&#125;<br />&#125;<br /><br />sub bot_chat &#123;<br /> &nbsp; my %bot_message_hash = %&#123;shift @_&#125;;<br /> &nbsp; my $message = shift;<br /><br /> &nbsp; my $bot_object = $bot_message_hash&#123;bot_object&#125;;<br /> &nbsp; my $reply_to &nbsp; = $bot_message_hash&#123;reply_to&#125;;<br /><br /> &nbsp; my $user = 'bot';<br /> &nbsp; $user = $1 if $reply_to=~m/^(.*?)\@im\.univ-metz\.fr(.*?)$/;<br /><br /> &nbsp; utf8::encode($message);<br /> &nbsp; my $unaccented = unac_string('utf8',$message);<br /><br /> &nbsp; my $reply = $rs-&gt;reply ($user,$unaccented);<br /> &nbsp; return if $reply =~/^ERR:/;<br /><br /> &nbsp; utf8::decode($reply);<br /><br /> &nbsp; $bot_object-&gt;SendJabberMessage($reply_to, $reply, $bot_message_hash&#123;type&#125;);<br /><br /> &nbsp; return;<br />&#125;[/code]||||
Re: Net::Jabber::Bot|Casey|casey@cuvou.net|1212536890|Kirsle|xx|0|72.37.252.206|Good job. Would you mind creating a &quot;starter bot template&quot; for Jabber? I'm sure other users would find it useful (as there's currently only a bot template for AIM so far).||||
Re: Net::Jabber::Bot|yvesago|agostini@univ-metz.fr|1213179804|yvesago|xx|0|193.50.117.72|You will find a template in &quot;Bot templates&quot;<br />thanks for your job||||
