Commit 36683943 authored by nanahira's avatar nanahira

fix

parent 4d342065
Pipeline #33401 failed with stages
in 5 minutes and 24 seconds
...@@ -1767,11 +1767,11 @@ class Room ...@@ -1767,11 +1767,11 @@ class Room
add_windbot: (botdata)-> add_windbot: (botdata)->
@windbot = botdata @windbot = botdata
url = "http://#{settings.modules.windbot.server_ip}:#{settings.modules.windbot.port}/?name=#{encodeURIComponent(botdata.name)}&deck=#{encodeURIComponent(botdata.deck)}&host=#{settings.modules.windbot.my_ip}&port=#{settings.port}&dialog=#{encodeURIComponent(botdata.dialog)}&version=#{settings.version}&password=#{encodeURIComponent(@name)}" bot_url = "http://#{settings.modules.windbot.server_ip}:#{settings.modules.windbot.port}/?name=#{encodeURIComponent(botdata.name)}&deck=#{encodeURIComponent(botdata.deck)}&host=#{settings.modules.windbot.my_ip}&port=#{settings.port}&dialog=#{encodeURIComponent(botdata.dialog)}&version=#{settings.version}&password=#{encodeURIComponent(@name)}"
if botdata.deckcode if botdata.deckcode
url += "&deckcode=#{encodeURIComponent(botdata.deckcode.toString('base64'))}" bot_url += "&deckcode=#{encodeURIComponent(botdata.deckcode.toString('base64'))}"
request request
url: url url: bot_url
, (error, response, body)=> , (error, response, body)=>
if error if error
log.warn 'windbot add error', error, this.name log.warn 'windbot add error', error, this.name
......
...@@ -2331,13 +2331,14 @@ ...@@ -2331,13 +2331,14 @@
} }
add_windbot(botdata) { add_windbot(botdata) {
var bot_url;
this.windbot = botdata; this.windbot = botdata;
url = `http://${settings.modules.windbot.server_ip}:${settings.modules.windbot.port}/?name=${encodeURIComponent(botdata.name)}&deck=${encodeURIComponent(botdata.deck)}&host=${settings.modules.windbot.my_ip}&port=${settings.port}&dialog=${encodeURIComponent(botdata.dialog)}&version=${settings.version}&password=${encodeURIComponent(this.name)}`; bot_url = `http://${settings.modules.windbot.server_ip}:${settings.modules.windbot.port}/?name=${encodeURIComponent(botdata.name)}&deck=${encodeURIComponent(botdata.deck)}&host=${settings.modules.windbot.my_ip}&port=${settings.port}&dialog=${encodeURIComponent(botdata.dialog)}&version=${settings.version}&password=${encodeURIComponent(this.name)}`;
if (botdata.deckcode) { if (botdata.deckcode) {
url += `&deckcode=${encodeURIComponent(botdata.deckcode.toString('base64'))}`; bot_url += `&deckcode=${encodeURIComponent(botdata.deckcode.toString('base64'))}`;
} }
request({ request({
url: url url: bot_url
}, (error, response, body) => { }, (error, response, body) => {
if (error) { if (error) {
log.warn('windbot add error', error, this.name); log.warn('windbot add error', error, this.name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment