From a4362c9bb38771ddfc058667dcadee37e4e29a1d Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Fri, 28 Apr 2023 15:52:41 -0400 Subject: [PATCH] Add logging for when event fills --- db/populateDefaults.ts | 1 + src/buttons/live-event/utils.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/db/populateDefaults.ts b/db/populateDefaults.ts index f5aacfb..a92cad7 100644 --- a/db/populateDefaults.ts +++ b/db/populateDefaults.ts @@ -33,6 +33,7 @@ const actions = [ 'btn-eeChangeDesc', 'btn-eeMakePublic', 'btn-eeMakeWL', + 'lfg-filled', ]; for (const action of actions) { await dbClient.execute('INSERT INTO command_cnt(command) values(?)', [action]).catch((e) => { diff --git a/src/buttons/live-event/utils.ts b/src/buttons/live-event/utils.ts index 5c09e81..b9ddd8e 100644 --- a/src/buttons/live-event/utils.ts +++ b/src/buttons/live-event/utils.ts @@ -6,6 +6,7 @@ import { selfDestructMessage } from '../tokenCleanup.ts'; import { approveStr, customId as joinRequestCustomId, denyStr } from './joinRequest.ts'; import { customId as updateEventCustomId } from './updateEvent.ts'; import { customId as leaveViaDMCustomId } from './leaveViaDM.ts'; +import { dbClient, queries } from '../../db.ts'; import utils from '../../utils.ts'; // Join status map to prevent spamming the system @@ -304,6 +305,7 @@ export const joinMemberToEvent = async ( // Check if we need to notify the owner that their event has filled if (memberList.length === maxMemberCount) { + dbClient.execute(queries.callIncCnt('lfg-filled')).catch((e) => utils.commonLoggers.dbError('utils.ts@lfg-filled', 'call sproc INC_CNT on', e)); const urlIds: UrlIds = { guildId: evtGuildId, channelId: evtChannelId, @@ -315,7 +317,7 @@ export const joinMemberToEvent = async ( embeds: [{ color: successColor, title: `Good news, your event in ${guildName} has filled!`, - description: `[Click here to view the event in ${guildName}.](${utils.idsToMessageUrl(urlIds)})`, + description: `[Click here](${utils.idsToMessageUrl(urlIds)}) to view the event in ${guildName}.`, fields: evtMessageEmbed.fields, }], }).catch((e: Error) => utils.commonLoggers.messageSendError('utils.ts', 'event filled dm', e));