From 99569821549c0dba518976d773839b826fb2614a Mon Sep 17 00:00:00 2001 From: niekcandaele <22315101+niekcandaele@users.noreply.github.com> Date: Wed, 15 Jul 2020 22:47:27 +0200 Subject: [PATCH] GBL Notification bug Fixes #168 --- api/hooks/countryBan/index.js | 3 ++- .../discordNotifications/notifications/countrybanKick.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/hooks/countryBan/index.js b/api/hooks/countryBan/index.js index aa7008a9c..70cf3dff1 100644 --- a/api/hooks/countryBan/index.js +++ b/api/hooks/countryBan/index.js @@ -405,7 +405,8 @@ module.exports = function sdtdCountryBan(sails) { async function handleCountryBan(connectedMessage) { let country = connectedMessage.country; let steamId = connectedMessage.steamId; - let serverId = this.server.id; + let serverId = connectedMessage.server.id; + try { let server = await SdtdServer.findOne(serverId); diff --git a/api/hooks/discordNotifications/notifications/countrybanKick.js b/api/hooks/discordNotifications/notifications/countrybanKick.js index ed517c953..aa44529a0 100644 --- a/api/hooks/discordNotifications/notifications/countrybanKick.js +++ b/api/hooks/discordNotifications/notifications/countrybanKick.js @@ -5,14 +5,14 @@ class CountrybanKick extends DiscordNotification { super('countrybanKick'); } - async makeEmbed(event){ + async makeEmbed(event) { let client = sails.hooks.discordbot.getClient(); let embed = new client.customEmbed(); embed.setTitle(`:flag_${event.player.country.toLowerCase()}: Country ban kicked: ${event.player.playerName}`) .setColor('ORANGE') - .addField('Steam ID', `[${event.player.steamID}](https://steamidfinder.com/lookup/${event.player.steamID}/)`, true) - .addField('Entity ID', `${event.player.entityID}`, true) + .addField('Steam ID', `[${event.player.steamId}](https://steamidfinder.com/lookup/${event.player.steamId}/)`, true) + .addField('Entity ID', `${event.player.entityId}`, true) .setFooter(`${event.server.name}`) .setURL(`${process.env.CSMM_HOSTNAME}/player/${event.player.id}/profile`);