From c688568b46ab5e0155170cf738ce60b2ce66cd86 Mon Sep 17 00:00:00 2001 From: Absurdon Date: Sun, 18 Nov 2018 20:41:33 +0100 Subject: [PATCH] try explicitly stating the port --- app/javascripts/app.js | 2 +- lib/discord/bot.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/javascripts/app.js b/app/javascripts/app.js index 9b5cf9a..7dfe108 100644 --- a/app/javascripts/app.js +++ b/app/javascripts/app.js @@ -2,7 +2,7 @@ const React = require("react"); const ReactDOM = require("react-dom"); const App = require("javascripts/components/main"); const io = require("socket.io-client"); -const socketUrl = window.location.protocol + "//" + window.location.host; +const socketUrl = window.location.protocol + "//" + window.location.hostname + window.location.port; const socket = io(socketUrl.replace(/^http/,'ws')); module.exports = function (mount) { diff --git a/lib/discord/bot.js b/lib/discord/bot.js index d65efe1..10c23bd 100644 --- a/lib/discord/bot.js +++ b/lib/discord/bot.js @@ -2,6 +2,7 @@ // Import the discord.js module const Discord = require('discord.js'); +const winston = require('winston'); function DiscordBot(config) { this.hook = new Discord.WebhookClient(config.hook_id,config.hook_token); @@ -19,7 +20,8 @@ var bot; module.exports = (config) => { if (bot) return bot; - if (!config) throw new Error("No credentials provided for Discord Gather Bot"); - bot = new DiscordBot(config); + if (!config) throw new Error("No credentials provided for Discord Gather Bot"); + bot = new DiscordBot(config); + //bot.notifyChannel('Gather restarted'); return bot; -}; \ No newline at end of file +};