Add logging for when event fills
This commit is contained in:
parent
1e32274376
commit
a4362c9bb3
|
@ -33,6 +33,7 @@ const actions = [
|
||||||
'btn-eeChangeDesc',
|
'btn-eeChangeDesc',
|
||||||
'btn-eeMakePublic',
|
'btn-eeMakePublic',
|
||||||
'btn-eeMakeWL',
|
'btn-eeMakeWL',
|
||||||
|
'lfg-filled',
|
||||||
];
|
];
|
||||||
for (const action of actions) {
|
for (const action of actions) {
|
||||||
await dbClient.execute('INSERT INTO command_cnt(command) values(?)', [action]).catch((e) => {
|
await dbClient.execute('INSERT INTO command_cnt(command) values(?)', [action]).catch((e) => {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { selfDestructMessage } from '../tokenCleanup.ts';
|
||||||
import { approveStr, customId as joinRequestCustomId, denyStr } from './joinRequest.ts';
|
import { approveStr, customId as joinRequestCustomId, denyStr } from './joinRequest.ts';
|
||||||
import { customId as updateEventCustomId } from './updateEvent.ts';
|
import { customId as updateEventCustomId } from './updateEvent.ts';
|
||||||
import { customId as leaveViaDMCustomId } from './leaveViaDM.ts';
|
import { customId as leaveViaDMCustomId } from './leaveViaDM.ts';
|
||||||
|
import { dbClient, queries } from '../../db.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
// Join status map to prevent spamming the system
|
// 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
|
// Check if we need to notify the owner that their event has filled
|
||||||
if (memberList.length === maxMemberCount) {
|
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 = {
|
const urlIds: UrlIds = {
|
||||||
guildId: evtGuildId,
|
guildId: evtGuildId,
|
||||||
channelId: evtChannelId,
|
channelId: evtChannelId,
|
||||||
|
@ -315,7 +317,7 @@ export const joinMemberToEvent = async (
|
||||||
embeds: [{
|
embeds: [{
|
||||||
color: successColor,
|
color: successColor,
|
||||||
title: `Good news, your event in ${guildName} has filled!`,
|
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,
|
fields: evtMessageEmbed.fields,
|
||||||
}],
|
}],
|
||||||
}).catch((e: Error) => utils.commonLoggers.messageSendError('utils.ts', 'event filled dm', e));
|
}).catch((e: Error) => utils.commonLoggers.messageSendError('utils.ts', 'event filled dm', e));
|
||||||
|
|
Loading…
Reference in New Issue