diff --git a/scripts/bot/run-bot.js b/scripts/bot/run-bot.js index 2e37ccc3d62a5d6bea59efa64a8b11d9984ee1e0..4f1568dd685936bc3c4ef4fb604da0d9caf7aece 100644 --- a/scripts/bot/run-bot.js +++ b/scripts/bot/run-bot.js @@ -4,8 +4,9 @@ Usage: ./run-bot.js [options] Options: - -h --host=<host> Hubs host [default: localhost:8080] - -r --room=<room> Room id [default: 234234]. + -u --url=<url> Url [default: null]. + -h --host=<host> Hubs host if url is not specified [default: localhost:8080] + -r --room=<room> Room id [default: null]. -h --help Show this screen. `; @@ -22,12 +23,19 @@ const querystring = require("query-string"); page.on("error", err => console.error("ERROR: ", err)); page.on("pageerror", err => console.error("PAGE ERROR: ", err)); + const baseUrl = options["--url"] || `https://${options["--host"]}/hub.html`; + const params = { - room: options["--room"], - bot: true + bot: true, + allow_multi: true }; - console.log(params); - const url = `https://${options["--host"]}/hub.html?${querystring.stringify(params)}`; + const roomOption = options["--room"]; + if (roomOption) { + params.room = roomOption; + } + + const url = `${baseUrl}?${querystring.stringify(params)}`; + console.log(url); const navigate = async () => { try { diff --git a/scripts/bot/run-bot.sh b/scripts/bot/run-bot.sh index 7bd9b986a2463a2864403b81599a0e161206d58e..aa693b25a11eca48bb83d4cc51115fdf6138f2eb 100755 --- a/scripts/bot/run-bot.sh +++ b/scripts/bot/run-bot.sh @@ -9,7 +9,6 @@ yarn echo 'Building Hubs' yarn build > /dev/null -# install run-bot.js dependencies cd $script_directory echo 'Installing bot dependencies' yarn