Revision 748bfcf3
Added by Marc Dequènes about 14 years ago
- ID 748bfcf3476615356454d8a71bc146f30508a45e
lib/cyborghood/base/config.rb | ||
---|---|---|
end
|
||
end
|
||
|
||
protected def self.merge_into_default_config(conf_default, conf)
|
||
protected
|
||
|
||
def self.merge_into_default_config(conf_default, conf)
|
||
new_conf = conf_default.dup
|
||
conf.each_pair do |k, v|
|
||
if conf_default.has_key?(k) and conf_default[k].is_a?(Hash) and v.is_a?(Hash)
|
lib/cyborghood/cyborg/conversation.rb | ||
---|---|---|
def send_message(message)
|
||
raise CyberError.new(:unrecoverable, "bot/conversation", "Cannot send message without action id") if message.action_id.nil?
|
||
|
||
send_line "#{@config.bot_id}-#{message.conv_thread.id}-#{message.action_id}" + (message.action_parameters.nil? : "" : "+") + " #{message.action_code}"
|
||
send_line "#{@config.bot_id}-#{message.conv_thread.id}-#{message.action_id}" + (message.action_parameters.nil? ? "" : "+") + " #{message.action_code}"
|
||
unless message.action_parameters.nil?
|
||
message.action_parameters.to_yaml.split.each {|l| send_line l }
|
||
send_line EOD
|
lib/cyborghood/cyborg/protocol.rb | ||
---|---|---|
@conversation.bot.schedule_task(@@request_callback) do
|
||
{
|
||
:reply_message => message,
|
||
:action_result => @conversation.bot.interface.has_node? message.parameters[:node]
|
||
:action_result => @conversation.bot.interface.has_node?(message.parameters[:node])
|
||
}
|
||
end
|
||
end
|
Also available in: Unified diff
[evol] fix silly mistakes/typos