try explicitly stating the port

This commit is contained in:
Absurdon 2018-11-18 20:41:33 +01:00
parent 60653e12af
commit c688568b46
2 changed files with 6 additions and 4 deletions

View file

@ -2,7 +2,7 @@ const React = require("react");
const ReactDOM = require("react-dom"); const ReactDOM = require("react-dom");
const App = require("javascripts/components/main"); const App = require("javascripts/components/main");
const io = require("socket.io-client"); 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')); const socket = io(socketUrl.replace(/^http/,'ws'));
module.exports = function (mount) { module.exports = function (mount) {

View file

@ -2,6 +2,7 @@
// Import the discord.js module // Import the discord.js module
const Discord = require('discord.js'); const Discord = require('discord.js');
const winston = require('winston');
function DiscordBot(config) { function DiscordBot(config) {
this.hook = new Discord.WebhookClient(config.hook_id,config.hook_token); this.hook = new Discord.WebhookClient(config.hook_id,config.hook_token);
@ -19,7 +20,8 @@ var bot;
module.exports = (config) => { module.exports = (config) => {
if (bot) return bot; if (bot) return bot;
if (!config) throw new Error("No credentials provided for Discord Gather Bot"); if (!config) throw new Error("No credentials provided for Discord Gather Bot");
bot = new DiscordBot(config); bot = new DiscordBot(config);
//bot.notifyChannel('Gather restarted');
return bot; return bot;
}; };