diff --git a/src/buttons/event-creation/utils.ts b/src/buttons/event-creation/utils.ts index 5b45526..b39f007 100644 --- a/src/buttons/event-creation/utils.ts +++ b/src/buttons/event-creation/utils.ts @@ -131,6 +131,8 @@ export const createLFGPost = ( dateTimeValid: boolean, ): InteractionResponse => { const icsDetails = `${category}: ${activity.name}`; + const dateTimePastFutureStr = dateTimeValid ? 'in the past' : 'with an invalid date/time'; + const dateTimeValidStr = dateTimeValid ? 'in the future' : 'valid'; return { type: InteractionResponseTypes.ChannelMessageWithSource, data: { @@ -139,9 +141,7 @@ export const createLFGPost = ( ? `Please verify the information below, then click on the \`${createEventBtnName}\` or \`${createWhitelistedBtnName}\` button, or change the event \`Date/Time\` or \`Description\` with the \`${editEventDetailsBtnName}\` button below. \n\n${ selfDestructMessage(new Date().getTime()) }` - : `You cannot create an event ${dateTimeValid ? 'in the past' : 'with an invalid date/time'}. Please change the event's \`Date/Time\` to be ${ - dateTimeValid ? 'in the future' : 'valid' - } with the \`${editEventDetailsBtnName}\` button below.`, + : `You cannot create an event ${dateTimePastFutureStr}. Please change the event's \`Date/Time\` to be ${dateTimeValidStr} with the \`${editEventDetailsBtnName}\` button below.`, embeds: [{ color: eventInFuture ? successColor : warnColor, fields: [{ diff --git a/src/buttons/live-event/applyDateTime.ts b/src/buttons/live-event/applyDateTime.ts index ed1944c..02bd1a8 100644 --- a/src/buttons/live-event/applyDateTime.ts +++ b/src/buttons/live-event/applyDateTime.ts @@ -56,7 +56,6 @@ const execute = async (bot: Bot, interaction: Interaction) => { } if (eventMessage && eventMessage.embeds[0].fields) { - // eventMessage.embeds[0].fields[LfgEmbedIndexes.Description].value = newDescription || noDescProvided; eventMessage.embeds[0].fields[LfgEmbedIndexes.StartTime].value = generateTimeFieldStr(eventDateTimeStr, eventDateTime); const tIdx = eventMessage.embeds[0].fields[LfgEmbedIndexes.ICSLink].value.indexOf('?t=') + 3; const nIdx = eventMessage.embeds[0].fields[LfgEmbedIndexes.ICSLink].value.indexOf('&n='); diff --git a/src/events/ready.ts b/src/events/ready.ts index 2400ceb..06dcc01 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -64,10 +64,14 @@ export const ready = (rawBot: Bot) => { // Interval to handle updating botList statistics if (botListPosterIntervalId) clearInterval(botListPosterIntervalId); - LOCALMODE ? log(LT.INFO, 'updateListStatistics not running') : botListPosterIntervalId = setInterval(() => { - log(LT.LOG, 'Updating all bot lists statistics'); - updateBotListStatistics(bot.guilds.size + bot.dispatchedGuildIds.size); - }, 86400000); + if (LOCALMODE) { + log(LT.INFO, 'updateListStatistics not running'); + } else { + botListPosterIntervalId = setInterval(() => { + log(LT.LOG, 'Updating all bot lists statistics'); + updateBotListStatistics(bot.guilds.size + bot.dispatchedGuildIds.size); + }, 86400000); + } // setTimeout added to make sure the startup message does not error out setTimeout(() => { diff --git a/src/notificationSystem.ts b/src/notificationSystem.ts index af7ffee..89da3ba 100644 --- a/src/notificationSystem.ts +++ b/src/notificationSystem.ts @@ -59,8 +59,9 @@ The message containing this event may have been deleted by a moderator or admini } // Log this to bot's log channel + const dmSuccessStr = dmSuccess ? 'SUCCESSFULLY' : 'NOT'; bot.helpers.sendMessage(config.logChannel, { - content: secondFailure ? `Hey <@${config.owner}>, something may have gone wrong. The owner of this event was ${dmSuccess ? 'SUCCESSFULLY' : 'NOT'} notified.` : undefined, + content: secondFailure ? `Hey <@${config.owner}>, something may have gone wrong. The owner of this event was ${dmSuccessStr} notified.` : undefined, embeds: [{ color: secondFailure ? failColor : warnColor, title: `Failed to ${stepName} an event in ${guildName}. This is the ${secondFailure ? 'second' : 'first'} attempt.`,