diff --git a/package-lock.json b/package-lock.json index 64264de..a0e7f18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "passport-local": "^1.0.0", "pino": "^6.14.0", "pino-pretty": "^4.8.0", - "playwright": "^1.28.1", + "playwright": "1.28.1", "pm2": "^5.2.2", "random": "3.0.6", "randomcolor": "^0.6.2", diff --git a/package.json b/package.json index 0b72240..b625bce 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "passport-local": "^1.0.0", "pino": "^6.14.0", "pino-pretty": "^4.8.0", - "playwright": "^1.28.1", + "playwright": "1.28.1", "pm2": "^5.2.2", "random": "3.0.6", "randomcolor": "^0.6.2", diff --git a/queues/discord.js b/queues/discord.js index 1e8ca44..aed2b16 100644 --- a/queues/discord.js +++ b/queues/discord.js @@ -1,6 +1,6 @@ import assert from "assert"; import logging from '../lib/logging.js'; -import { Client, IntentsBitField, Partials } from "discord.js"; +import { Client, IntentsBitField, Partials, ChannelType } from "discord.js"; import { User } from "../lib/models.js"; import { company } from '../emails/config.js'; import { discord } from "../lib/config.js"; @@ -27,8 +27,8 @@ const load_guild_channel = async (client) => { const channels = await guild.channels.fetch(); for(let chan of channels.entries()) { - if(chan[1].type === "GUILD_TEXT") { - // remember, return await puts the errors here + if(chan[1].type === ChannelType.GuildText) { + log.info(`Found guild text channel ${JSON.stringify(chan[1])}`); return [guild, await chan[1].fetch()]; } } @@ -43,8 +43,8 @@ await client.login(discord.token); const [guild, channel] = await load_guild_channel(client); // if it doesn't exist make it and add it to their account -log.info("Connected to Sever/Guild", guild.name); -log.info("Sending invites from Channel", channel.name); +log.info(`Connected to Sever/Guild ${guild.name}`); +log.info(`!!Sending invites from Channel ${JSON.stringify(channel, null, 4)}`); const invite_email = await load_templates("discord_email"); diff --git a/queues/paypal.js b/queues/paypal.js index b1796b3..ff8ebc0 100644 --- a/queues/paypal.js +++ b/queues/paypal.js @@ -82,6 +82,12 @@ export const validate_order = async (job) => { await Payment.update({id: payment.id}, {status: "failed", status_reason}); } } catch(error) { - log.error(error, `Processing payment paypal varification for ${job.data.payment_id}`); + log.error(error, `Processing payment paypal verification for ${job.data.payment_id}`); + + try { + await Payment.update({id: job.data.payment_id}, {status: "failed", status_reason: "check_logs"}); + } catch (e) { + log.error(error, `Failed to update the database with failure on payment id ${job.data.payment_id}`); + } } }