restructure DB files to make initialization easier
This commit is contained in:
parent
7f7f7e2445
commit
5a8cd8e8bb
|
@ -2,7 +2,7 @@
|
||||||
// DATA WILL BE LOST IF DB ALREADY EXISTS, RUN AT OWN RISK
|
// DATA WILL BE LOST IF DB ALREADY EXISTS, RUN AT OWN RISK
|
||||||
|
|
||||||
import config from '../config.ts';
|
import config from '../config.ts';
|
||||||
import { dbClient } from '../src/db.ts';
|
import { dbClient } from '../src/db/client.ts';
|
||||||
|
|
||||||
console.log('Attempting to create DB');
|
console.log('Attempting to create DB');
|
||||||
await dbClient.execute(`CREATE SCHEMA IF NOT EXISTS ${config.db.name};`);
|
await dbClient.execute(`CREATE SCHEMA IF NOT EXISTS ${config.db.name};`);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// This file will populate the tables with default values
|
// This file will populate the tables with default values
|
||||||
import { dbClient } from '../src/db.ts';
|
import { dbClient } from '../src/db/client.ts';
|
||||||
|
|
||||||
console.log('Attempting to insert default actions into command_cnt');
|
console.log('Attempting to insert default actions into command_cnt');
|
||||||
const actions = [
|
const actions = [
|
||||||
|
|
|
@ -9,7 +9,8 @@ import utils from '../../utils.ts';
|
||||||
import { customId as createCustomActivityBtnId } from './step1a-openCustomModal.ts';
|
import { customId as createCustomActivityBtnId } from './step1a-openCustomModal.ts';
|
||||||
import { customId as finalizeEventBtnId } from './step2-finalize.ts';
|
import { customId as finalizeEventBtnId } from './step2-finalize.ts';
|
||||||
import { monthsShort } from './dateTimeUtils.ts';
|
import { monthsShort } from './dateTimeUtils.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { createEventSlashName } from '../../commands/slashCommandNames.ts';
|
import { createEventSlashName } from '../../commands/slashCommandNames.ts';
|
||||||
|
|
||||||
export const customId = 'gameSel';
|
export const customId = 'gameSel';
|
||||||
|
@ -51,7 +52,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
|
||||||
let prefillDescription = '';
|
let prefillDescription = '';
|
||||||
if (interaction.message?.embeds[0].fields && interaction.message.embeds[0].fields[LfgEmbedIndexes.StartTime].name === lfgStartTimeName) {
|
if (interaction.message?.embeds[0].fields && interaction.message.embeds[0].fields[LfgEmbedIndexes.StartTime].name === lfgStartTimeName) {
|
||||||
if (interaction.message.embeds[0].fields[LfgEmbedIndexes.StartTime].value !== invalidDateTimeStr) {
|
if (interaction.message.embeds[0].fields[LfgEmbedIndexes.StartTime].value !== invalidDateTimeStr) {
|
||||||
let rawEventDateTime = interaction.message.embeds[0].fields[LfgEmbedIndexes.StartTime].value.split('\n')[0].split(' ');
|
const rawEventDateTime = interaction.message.embeds[0].fields[LfgEmbedIndexes.StartTime].value.split('\n')[0].split(' ');
|
||||||
const monthIdx = rawEventDateTime.findIndex((item) => monthsShort.includes(item.toUpperCase()));
|
const monthIdx = rawEventDateTime.findIndex((item) => monthsShort.includes(item.toUpperCase()));
|
||||||
prefillTime = rawEventDateTime.slice(0, monthIdx - 1).join(' ').trim();
|
prefillTime = rawEventDateTime.slice(0, monthIdx - 1).join(' ').trim();
|
||||||
prefillTimeZone = (rawEventDateTime[monthIdx - 1] || '').trim();
|
prefillTimeZone = (rawEventDateTime[monthIdx - 1] || '').trim();
|
||||||
|
|
|
@ -2,11 +2,12 @@ import { Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
||||||
import { generateCustomActivityFields, idSeparator, pathIdxSeparator } from '../eventUtils.ts';
|
import { generateCustomActivityFields, idSeparator, pathIdxSeparator } from '../eventUtils.ts';
|
||||||
import { customId as verifyCustomActivityId } from './step1b-verifyCustomActivity.ts';
|
import { customId as verifyCustomActivityId } from './step1b-verifyCustomActivity.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
|
|
||||||
export const customId = 'customAct';
|
export const customId = 'customAct';
|
||||||
|
|
||||||
const execute = async (bot: Bot, interaction: Interaction) => {
|
const execute = (bot: Bot, interaction: Interaction) => {
|
||||||
if (interaction.data?.customId && interaction.member && interaction.guildId && interaction.channelId) {
|
if (interaction.data?.customId && interaction.member && interaction.guildId && interaction.channelId) {
|
||||||
// Light Telemetry
|
// Light Telemetry
|
||||||
dbClient.execute(queries.callIncCnt('btn-customAct')).catch((e) => utils.commonLoggers.dbError('step1a-openCustomModal.ts', 'call sproc INC_CNT on', e));
|
dbClient.execute(queries.callIncCnt('btn-customAct')).catch((e) => utils.commonLoggers.dbError('step1a-openCustomModal.ts', 'call sproc INC_CNT on', e));
|
||||||
|
|
|
@ -6,7 +6,8 @@ import { addTokenToMap, deleteTokenEarly } from '../tokenCleanup.ts';
|
||||||
import { Activities, Activity } from './activities.ts';
|
import { Activities, Activity } from './activities.ts';
|
||||||
import { getDateFromRawInput } from './dateTimeUtils.ts';
|
import { getDateFromRawInput } from './dateTimeUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
|
|
||||||
export const customId = 'finalize';
|
export const customId = 'finalize';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,8 @@ import { generateLFGButtons } from './utils.ts';
|
||||||
import { idSeparator, LfgEmbedIndexes } from '../eventUtils.ts';
|
import { idSeparator, LfgEmbedIndexes } from '../eventUtils.ts';
|
||||||
import { deleteTokenEarly } from '../tokenCleanup.ts';
|
import { deleteTokenEarly } from '../tokenCleanup.ts';
|
||||||
import { dmTestMessage, safelyDismissMsg, sendDirectMessage, somethingWentWrong, warnColor } from '../../commandUtils.ts';
|
import { dmTestMessage, safelyDismissMsg, sendDirectMessage, somethingWentWrong, warnColor } from '../../commandUtils.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
export const customId = 'createEvent';
|
export const customId = 'createEvent';
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
import { Bot, Interaction } from '../../../deps.ts';
|
import { Bot, Interaction } from '../../../deps.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { alternateMemberToEvent } from './utils.ts';
|
import { alternateMemberToEvent } from './utils.ts';
|
||||||
|
|
||||||
export const customId = 'alternateEvent';
|
export const customId = 'alternateEvent';
|
||||||
|
|
||||||
const execute = async (bot: Bot, interaction: Interaction) => {
|
const execute = (bot: Bot, interaction: Interaction) => {
|
||||||
if (interaction.data?.customId && interaction.member && interaction.member.user && interaction.channelId && interaction.message && interaction.message.embeds[0]) {
|
if (interaction.data?.customId && interaction.member && interaction.member.user && interaction.channelId && interaction.message && interaction.message.embeds[0]) {
|
||||||
// Light Telemetry
|
// Light Telemetry
|
||||||
dbClient.execute(queries.callIncCnt('btn-altEvent')).catch((e) => utils.commonLoggers.dbError('alternateEvent.ts', 'call sproc INC_CNT on', e));
|
dbClient.execute(queries.callIncCnt('btn-altEvent')).catch((e) => utils.commonLoggers.dbError('alternateEvent.ts', 'call sproc INC_CNT on', e));
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Bot, Interaction } from '../../../deps.ts';
|
import { Bot, Interaction } from '../../../deps.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { alternateMemberToEvent } from './utils.ts';
|
import { alternateMemberToEvent } from './utils.ts';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ApplicationCommandFlags, Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
import { ApplicationCommandFlags, Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../../db/common.ts';
|
||||||
import { failColor, infoColor1, infoColor2, safelyDismissMsg, sendDirectMessage, somethingWentWrong, successColor } from '../../commandUtils.ts';
|
import { failColor, infoColor1, infoColor2, safelyDismissMsg, sendDirectMessage, somethingWentWrong, successColor } from '../../commandUtils.ts';
|
||||||
import { generateMemberList, idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
import { generateMemberList, idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Bot, Interaction, InteractionResponseTypes, MessageComponentTypes, TextStyles } from '../../../deps.ts';
|
import { Bot, Interaction, InteractionResponseTypes, MessageComponentTypes, TextStyles } from '../../../deps.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../../db/common.ts';
|
||||||
import { somethingWentWrong, stopThat } from '../../commandUtils.ts';
|
import { somethingWentWrong, stopThat } from '../../commandUtils.ts';
|
||||||
import { idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
import { idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
||||||
import { confirmedCustomId, confirmStr, customId as deleteConfirmedCustomId } from './deleteConfirmed.ts';
|
import { confirmedCustomId, confirmStr, customId as deleteConfirmedCustomId } from './deleteConfirmed.ts';
|
||||||
|
@ -7,7 +8,7 @@ import utils from '../../utils.ts';
|
||||||
|
|
||||||
export const customId = 'deleteEvent';
|
export const customId = 'deleteEvent';
|
||||||
|
|
||||||
const execute = async (bot: Bot, interaction: Interaction) => {
|
const execute = (bot: Bot, interaction: Interaction) => {
|
||||||
if (interaction.data?.customId && interaction.member && interaction.member.user && interaction.channelId && interaction.guildId && interaction.message && interaction.message.embeds[0]) {
|
if (interaction.data?.customId && interaction.member && interaction.member.user && interaction.channelId && interaction.guildId && interaction.message && interaction.message.embeds[0]) {
|
||||||
// Light Telemetry
|
// Light Telemetry
|
||||||
dbClient.execute(queries.callIncCnt('btn-delEvent')).catch((e) => utils.commonLoggers.dbError('deleteEvent.ts', 'call sproc INC_CNT on', e));
|
dbClient.execute(queries.callIncCnt('btn-delEvent')).catch((e) => utils.commonLoggers.dbError('deleteEvent.ts', 'call sproc INC_CNT on', e));
|
||||||
|
|
|
@ -2,11 +2,12 @@ import { Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
||||||
import { generateCustomActivityFields, idSeparator } from '../eventUtils.ts';
|
import { generateCustomActivityFields, idSeparator } from '../eventUtils.ts';
|
||||||
import { customId as editActivityCustomId } from './editActivity.ts';
|
import { customId as editActivityCustomId } from './editActivity.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
|
|
||||||
export const customId = 'editActivityCustom';
|
export const customId = 'editActivityCustom';
|
||||||
|
|
||||||
const execute = async (bot: Bot, interaction: Interaction) => {
|
const execute = (bot: Bot, interaction: Interaction) => {
|
||||||
if (interaction.data?.customId && interaction.member && interaction.guildId && interaction.channelId) {
|
if (interaction.data?.customId && interaction.member && interaction.guildId && interaction.channelId) {
|
||||||
// Light Telemetry
|
// Light Telemetry
|
||||||
dbClient.execute(queries.callIncCnt('btn-eeCustomAct')).catch((e) => utils.commonLoggers.dbError('step1a-openCustomModal.ts', 'call sproc INC_CNT on', e));
|
dbClient.execute(queries.callIncCnt('btn-eeCustomAct')).catch((e) => utils.commonLoggers.dbError('step1a-openCustomModal.ts', 'call sproc INC_CNT on', e));
|
||||||
|
|
|
@ -18,7 +18,8 @@ import {
|
||||||
import { addTokenToMap, deleteTokenEarly, generateMapId, selfDestructMessage, tokenMap } from '../tokenCleanup.ts';
|
import { addTokenToMap, deleteTokenEarly, generateMapId, selfDestructMessage, tokenMap } from '../tokenCleanup.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import config from '../../../config.ts';
|
import config from '../../../config.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { customId as editActivityCustomCustomId } from './editActivity-custom.ts';
|
import { customId as editActivityCustomCustomId } from './editActivity-custom.ts';
|
||||||
import { applyEditButtons, applyEditMessage, getEventMemberCount, getLfgMembers } from './utils.ts';
|
import { applyEditButtons, applyEditMessage, getEventMemberCount, getLfgMembers } from './utils.ts';
|
||||||
import { LFGMember } from '../../types/commandTypes.ts';
|
import { LFGMember } from '../../types/commandTypes.ts';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
import { Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||||
import { dateTimeFields, idSeparator, LfgEmbedIndexes, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
import { dateTimeFields, idSeparator, LfgEmbedIndexes, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
||||||
import { monthsShort } from '../event-creation/dateTimeUtils.ts';
|
import { monthsShort } from '../event-creation/dateTimeUtils.ts';
|
||||||
|
@ -15,7 +16,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
|
||||||
|
|
||||||
const [evtChannelId, evtMessageId] = (interaction.data.customId.replaceAll(pathIdxEnder, '').split(idSeparator)[1] || '').split(pathIdxSeparator).map((id) => BigInt(id || '0'));
|
const [evtChannelId, evtMessageId] = (interaction.data.customId.replaceAll(pathIdxEnder, '').split(idSeparator)[1] || '').split(pathIdxSeparator).map((id) => BigInt(id || '0'));
|
||||||
const eventMessage = await bot.helpers.getMessage(evtChannelId, evtMessageId).catch((e: Error) => utils.commonLoggers.messageGetError('editDateTime.ts', 'get eventMessage', e));
|
const eventMessage = await bot.helpers.getMessage(evtChannelId, evtMessageId).catch((e: Error) => utils.commonLoggers.messageGetError('editDateTime.ts', 'get eventMessage', e));
|
||||||
let rawEventDateTime = eventMessage?.embeds[0].fields ? eventMessage.embeds[0].fields[LfgEmbedIndexes.StartTime].value.trim().split('\n')[0].split(' ') : [];
|
const rawEventDateTime = eventMessage?.embeds[0].fields ? eventMessage.embeds[0].fields[LfgEmbedIndexes.StartTime].value.trim().split('\n')[0].split(' ') : [];
|
||||||
const monthIdx = rawEventDateTime.findIndex((item) => monthsShort.includes(item.toUpperCase()));
|
const monthIdx = rawEventDateTime.findIndex((item) => monthsShort.includes(item.toUpperCase()));
|
||||||
const prefillTime = rawEventDateTime.slice(0, monthIdx - 1).join(' ').trim();
|
const prefillTime = rawEventDateTime.slice(0, monthIdx - 1).join(' ').trim();
|
||||||
const prefillTimeZone = rawEventDateTime[monthIdx - 1].trim();
|
const prefillTimeZone = rawEventDateTime[monthIdx - 1].trim();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
import { Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||||
import { descriptionTextField, idSeparator, LfgEmbedIndexes, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
import { descriptionTextField, idSeparator, LfgEmbedIndexes, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ActionRow, ApplicationCommandFlags, Bot, ButtonStyles, Interaction, InteractionResponseTypes, MessageComponentTypes } from '../../../deps.ts';
|
import { ActionRow, ApplicationCommandFlags, Bot, ButtonStyles, Interaction, InteractionResponseTypes, MessageComponentTypes } from '../../../deps.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../../db/common.ts';
|
||||||
import { infoColor1, somethingWentWrong, stopThat } from '../../commandUtils.ts';
|
import { infoColor1, somethingWentWrong, stopThat } from '../../commandUtils.ts';
|
||||||
import { idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
import { idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
||||||
import { addTokenToMap, selfDestructMessage } from '../tokenCleanup.ts';
|
import { addTokenToMap, selfDestructMessage } from '../tokenCleanup.ts';
|
||||||
|
@ -11,7 +12,7 @@ import { customId as toggleWLStatusCustomId } from './toggleWLStatus.ts';
|
||||||
|
|
||||||
export const customId = 'editEvent';
|
export const customId = 'editEvent';
|
||||||
|
|
||||||
const execute = async (bot: Bot, interaction: Interaction) => {
|
const execute = (bot: Bot, interaction: Interaction) => {
|
||||||
if (
|
if (
|
||||||
interaction.data?.customId && interaction.member && interaction.channelId && interaction.guildId && interaction.message && interaction.message.components &&
|
interaction.data?.customId && interaction.member && interaction.channelId && interaction.guildId && interaction.message && interaction.message.components &&
|
||||||
interaction.message.components[0].components
|
interaction.message.components[0].components
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ApplicationCommandFlags, Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
import { ApplicationCommandFlags, Bot, Interaction, InteractionResponseTypes } from '../../../deps.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../../db/common.ts';
|
||||||
import { infoColor1, safelyDismissMsg, sendDirectMessage, somethingWentWrong, successColor, warnColor } from '../../commandUtils.ts';
|
import { infoColor1, safelyDismissMsg, sendDirectMessage, somethingWentWrong, successColor, warnColor } from '../../commandUtils.ts';
|
||||||
import { generateMemberList, idSeparator, LfgEmbedIndexes } from '../eventUtils.ts';
|
import { generateMemberList, idSeparator, LfgEmbedIndexes } from '../eventUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
|
@ -2,7 +2,8 @@ import { Bot, ButtonStyles, Interaction, InteractionResponseTypes, MessageCompon
|
||||||
import { sendDirectMessage, somethingWentWrong, successColor, warnColor } from '../../commandUtils.ts';
|
import { sendDirectMessage, somethingWentWrong, successColor, warnColor } from '../../commandUtils.ts';
|
||||||
import { generateMapId, getLfgMembers, joinMemberToEvent, joinRequestMap, joinRequestResponseButtons, JoinRequestStatus } from './utils.ts';
|
import { generateMapId, getLfgMembers, joinMemberToEvent, joinRequestMap, joinRequestResponseButtons, JoinRequestStatus } from './utils.ts';
|
||||||
import { alternateEventBtnStr, idSeparator } from '../eventUtils.ts';
|
import { alternateEventBtnStr, idSeparator } from '../eventUtils.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { customId as alternateRequestCustomId } from './alternateRequest.ts';
|
import { customId as alternateRequestCustomId } from './alternateRequest.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
import { Bot, Interaction } from '../../../deps.ts';
|
import { Bot, Interaction } from '../../../deps.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { removeMemberFromEvent } from './utils.ts';
|
import { removeMemberFromEvent } from './utils.ts';
|
||||||
|
|
||||||
export const customId = 'leaveEvent';
|
export const customId = 'leaveEvent';
|
||||||
|
|
||||||
const execute = async (bot: Bot, interaction: Interaction) => {
|
const execute = (bot: Bot, interaction: Interaction) => {
|
||||||
if (interaction.data?.customId && interaction.member && interaction.channelId && interaction.guildId && interaction.message && interaction.message.embeds[0]) {
|
if (interaction.data?.customId && interaction.member && interaction.channelId && interaction.guildId && interaction.message && interaction.message.embeds[0]) {
|
||||||
// Light Telemetry
|
// Light Telemetry
|
||||||
dbClient.execute(queries.callIncCnt('btn-leaveEvent')).catch((e) => utils.commonLoggers.dbError('leaveEvent.ts', 'call sproc INC_CNT on', e));
|
dbClient.execute(queries.callIncCnt('btn-leaveEvent')).catch((e) => utils.commonLoggers.dbError('leaveEvent.ts', 'call sproc INC_CNT on', e));
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Bot, Interaction } from '../../../deps.ts';
|
import { Bot, Interaction } from '../../../deps.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { removeMemberFromEvent } from './utils.ts';
|
import { removeMemberFromEvent } from './utils.ts';
|
||||||
|
|
|
@ -3,7 +3,8 @@ import { dmTestMessage, safelyDismissMsg, sendDirectMessage, somethingWentWrong,
|
||||||
import { idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
import { idSeparator, pathIdxEnder, pathIdxSeparator } from '../eventUtils.ts';
|
||||||
import { deleteTokenEarly } from '../tokenCleanup.ts';
|
import { deleteTokenEarly } from '../tokenCleanup.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import { dbClient, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.ts';
|
||||||
import { generateLFGButtons } from '../event-creation/utils.ts';
|
import { generateLFGButtons } from '../event-creation/utils.ts';
|
||||||
|
|
||||||
export const customId = 'toggleWLStatus';
|
export const customId = 'toggleWLStatus';
|
||||||
|
|
|
@ -4,7 +4,8 @@ import { generateMemberList, idSeparator, LfgEmbedIndexes, pathIdxEnder, pathIdx
|
||||||
import { deleteTokenEarly } from '../tokenCleanup.ts';
|
import { deleteTokenEarly } from '../tokenCleanup.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
import config from '../../../config.ts';
|
import config from '../../../config.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../../db.ts';
|
import { dbClient } from '../../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../../db/common.ts';
|
||||||
import { getGuildName } from './utils.ts';
|
import { getGuildName } from './utils.ts';
|
||||||
|
|
||||||
export const customId = 'updateEvent';
|
export const customId = 'updateEvent';
|
||||||
|
|
|
@ -6,7 +6,8 @@ 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 { dbClient } from '../../db/client.ts';
|
||||||
|
import { queries } from '../../db/common.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
|
||||||
|
@ -128,7 +129,7 @@ ${safelyDismissMsg}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Generic no response response
|
// Generic no response response
|
||||||
const noEdit = async (bot: Bot, interaction: Interaction, loudAcknowledge: boolean) => {
|
const noEdit = (bot: Bot, interaction: Interaction, loudAcknowledge: boolean) => {
|
||||||
if (loudAcknowledge) {
|
if (loudAcknowledge) {
|
||||||
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
||||||
type: InteractionResponseTypes.ChannelMessageWithSource,
|
type: InteractionResponseTypes.ChannelMessageWithSource,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ApplicationCommandFlags, Bot, CreateMessage, Embed, Interaction, InteractionResponseTypes } from '../deps.ts';
|
import { ApplicationCommandFlags, Bot, CreateMessage, Embed, Interaction, InteractionResponseTypes } from '../deps.ts';
|
||||||
import config from '../config.ts';
|
import config from '../config.ts';
|
||||||
import { generateGuildSettingKey, lfgChannelSettings } from './db.ts';
|
import { generateGuildSettingKey, lfgChannelSettings } from './db/common.ts';
|
||||||
import utils from './utils.ts';
|
import utils from './utils.ts';
|
||||||
import { helpSlashName, infoSlashName, reportSlashName } from './commands/slashCommandNames.ts';
|
import { helpSlashName, infoSlashName, reportSlashName } from './commands/slashCommandNames.ts';
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ export const isLFGChannel = (guildId: bigint, channelId: bigint) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tell user to try again or report issue
|
// Tell user to try again or report issue
|
||||||
export const somethingWentWrong = async (bot: Bot, interaction: Interaction, errorCode: string) =>
|
export const somethingWentWrong = (bot: Bot, interaction: Interaction, errorCode: string) =>
|
||||||
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
||||||
type: InteractionResponseTypes.ChannelMessageWithSource,
|
type: InteractionResponseTypes.ChannelMessageWithSource,
|
||||||
data: {
|
data: {
|
||||||
|
@ -45,7 +45,7 @@ export const somethingWentWrong = async (bot: Bot, interaction: Interaction, err
|
||||||
}).catch((e: Error) => utils.commonLoggers.interactionSendError('commandUtils.ts@somethingWentWrong', interaction, e));
|
}).catch((e: Error) => utils.commonLoggers.interactionSendError('commandUtils.ts@somethingWentWrong', interaction, e));
|
||||||
|
|
||||||
// Smack the user for trying to modify an event that isn't theirs
|
// Smack the user for trying to modify an event that isn't theirs
|
||||||
export const stopThat = async (bot: Bot, interaction: Interaction, stopWhat: string) =>
|
export const stopThat = (bot: Bot, interaction: Interaction, stopWhat: string) =>
|
||||||
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
|
||||||
type: InteractionResponseTypes.ChannelMessageWithSource,
|
type: InteractionResponseTypes.ChannelMessageWithSource,
|
||||||
data: {
|
data: {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import config from '../../config.ts';
|
import config from '../../config.ts';
|
||||||
import { ApplicationCommandOptionTypes, ApplicationCommandTypes, Bot, DiscordEmbedField, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
import { ApplicationCommandOptionTypes, ApplicationCommandTypes, Bot, DiscordEmbedField, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
||||||
import { infoColor2, isLFGChannel, somethingWentWrong } from '../commandUtils.ts';
|
import { infoColor2, isLFGChannel, somethingWentWrong } from '../commandUtils.ts';
|
||||||
import { dbClient, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { queries } from '../db/common.ts';
|
||||||
import { CommandDetails } from '../types/commandTypes.ts';
|
import { CommandDetails } from '../types/commandTypes.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { auditSlashName } from './slashCommandNames.ts';
|
import { auditSlashName } from './slashCommandNames.ts';
|
||||||
|
@ -39,7 +40,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
|
||||||
dbClient.execute(queries.callIncCnt('cmd-audit')).catch((e) => utils.commonLoggers.dbError('audit.ts@inc', 'call sproc INC_CNT on', e));
|
dbClient.execute(queries.callIncCnt('cmd-audit')).catch((e) => utils.commonLoggers.dbError('audit.ts@inc', 'call sproc INC_CNT on', e));
|
||||||
const auditName = interaction.data.options[0].name;
|
const auditName = interaction.data.options[0].name;
|
||||||
switch (auditName) {
|
switch (auditName) {
|
||||||
case auditDbName:
|
case auditDbName: {
|
||||||
// Get DB statistics
|
// Get DB statistics
|
||||||
const auditQuery = await dbClient.query(`SELECT * FROM db_size;`).catch((e) => utils.commonLoggers.dbError('audit.ts@dbSize', 'query', e));
|
const auditQuery = await dbClient.query(`SELECT * FROM db_size;`).catch((e) => utils.commonLoggers.dbError('audit.ts@dbSize', 'query', e));
|
||||||
|
|
||||||
|
@ -71,6 +72,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
|
||||||
},
|
},
|
||||||
).catch((e: Error) => utils.commonLoggers.interactionSendError('audit.ts@dbSize', interaction, e));
|
).catch((e: Error) => utils.commonLoggers.interactionSendError('audit.ts@dbSize', interaction, e));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case auditCustomActivities:
|
case auditCustomActivities:
|
||||||
case auditGuildName:
|
case auditGuildName:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import config from '../../config.ts';
|
import config from '../../config.ts';
|
||||||
import { ApplicationCommandFlags, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
import { ApplicationCommandFlags, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
||||||
import { failColor, safelyDismissMsg, somethingWentWrong, successColor } from '../commandUtils.ts';
|
import { failColor, safelyDismissMsg, somethingWentWrong, successColor } from '../commandUtils.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../db/common.ts';
|
||||||
import { CommandDetails } from '../types/commandTypes.ts';
|
import { CommandDetails } from '../types/commandTypes.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { deleteSlashName, setupSlashName } from './slashCommandNames.ts';
|
import { deleteSlashName, setupSlashName } from './slashCommandNames.ts';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import config from '../../config.ts';
|
import config from '../../config.ts';
|
||||||
import { ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
import { ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
||||||
import { infoColor1, isLFGChannel } from '../commandUtils.ts';
|
import { infoColor1, isLFGChannel } from '../commandUtils.ts';
|
||||||
import { dbClient, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { queries } from '../db/common.ts';
|
||||||
import { CommandDetails } from '../types/commandTypes.ts';
|
import { CommandDetails } from '../types/commandTypes.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { createEventSlashName, helpSlashName, setupSlashName } from './slashCommandNames.ts';
|
import { createEventSlashName, helpSlashName, setupSlashName } from './slashCommandNames.ts';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import config from '../../config.ts';
|
import config from '../../config.ts';
|
||||||
import { ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
import { ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
||||||
import { infoEmbed, isLFGChannel } from '../commandUtils.ts';
|
import { infoEmbed, isLFGChannel } from '../commandUtils.ts';
|
||||||
import { dbClient, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { queries } from '../db/common.ts';
|
||||||
import { CommandDetails } from '../types/commandTypes.ts';
|
import { CommandDetails } from '../types/commandTypes.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { infoSlashName } from './slashCommandNames.ts';
|
import { infoSlashName } from './slashCommandNames.ts';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { ApplicationCommandFlags, ApplicationCommandOptionTypes, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
import { ApplicationCommandFlags, ApplicationCommandOptionTypes, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
||||||
import { alternateMemberToEvent, getGuildName, joinMemberToEvent, removeMemberFromEvent } from '../buttons/live-event/utils.ts';
|
import { alternateMemberToEvent, getGuildName, joinMemberToEvent, removeMemberFromEvent } from '../buttons/live-event/utils.ts';
|
||||||
import { generateMemberList } from '../buttons/eventUtils.ts';
|
import { generateMemberList } from '../buttons/eventUtils.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../db/common.ts';
|
||||||
import { infoColor2, safelyDismissMsg, sendDirectMessage, somethingWentWrong, stopThat, warnColor } from '../commandUtils.ts';
|
import { infoColor2, safelyDismissMsg, sendDirectMessage, somethingWentWrong, stopThat, warnColor } from '../commandUtils.ts';
|
||||||
import { CommandDetails, LFGMember } from '../types/commandTypes.ts';
|
import { CommandDetails, LFGMember } from '../types/commandTypes.ts';
|
||||||
import config from '../../config.ts';
|
import config from '../../config.ts';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import config from '../../config.ts';
|
import config from '../../config.ts';
|
||||||
import { ApplicationCommandOptionTypes, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
import { ApplicationCommandOptionTypes, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
|
||||||
import { infoColor2, isLFGChannel, somethingWentWrong, successColor } from '../commandUtils.ts';
|
import { infoColor2, isLFGChannel, somethingWentWrong, successColor } from '../commandUtils.ts';
|
||||||
import { dbClient, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { queries } from '../db/common.ts';
|
||||||
import { CommandDetails } from '../types/commandTypes.ts';
|
import { CommandDetails } from '../types/commandTypes.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { reportSlashName } from './slashCommandNames.ts';
|
import { reportSlashName } from './slashCommandNames.ts';
|
||||||
|
|
|
@ -14,7 +14,8 @@ import {
|
||||||
OverwriteTypes,
|
OverwriteTypes,
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { failColor, infoColor2, safelyDismissMsg, somethingWentWrong, successColor } from '../commandUtils.ts';
|
import { failColor, infoColor2, safelyDismissMsg, somethingWentWrong, successColor } from '../commandUtils.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../db/common.ts';
|
||||||
import { CommandDetails } from '../types/commandTypes.ts';
|
import { CommandDetails } from '../types/commandTypes.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { customId as gameSelId } from '../buttons/event-creation/step1-gameSelection.ts';
|
import { customId as gameSelId } from '../buttons/event-creation/step1-gameSelection.ts';
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
import config from '../../config.ts';
|
||||||
|
import { Client } from '../../deps.ts';
|
||||||
|
import { LOCALMODE } from '../../flags.ts';
|
||||||
|
|
||||||
|
export const dbClient = await new Client().connect({
|
||||||
|
hostname: LOCALMODE ? config.db.localhost : config.db.host,
|
||||||
|
port: config.db.port,
|
||||||
|
db: config.db.name,
|
||||||
|
username: config.db.username,
|
||||||
|
password: config.db.password,
|
||||||
|
});
|
|
@ -1,15 +1,5 @@
|
||||||
import config from '../config.ts';
|
import { dbClient } from './client.ts';
|
||||||
import { Client } from '../deps.ts';
|
import { DBGuildSettings, LfgChannelSetting } from '../types/commandTypes.ts';
|
||||||
import { LOCALMODE } from '../flags.ts';
|
|
||||||
import { DBGuildSettings, LfgChannelSetting } from './types/commandTypes.ts';
|
|
||||||
|
|
||||||
export const dbClient = await new Client().connect({
|
|
||||||
hostname: LOCALMODE ? config.db.localhost : config.db.host,
|
|
||||||
port: config.db.port,
|
|
||||||
db: config.db.name,
|
|
||||||
username: config.db.username,
|
|
||||||
password: config.db.password,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const queries = {
|
export const queries = {
|
||||||
callIncCnt: (cmdName: string) => `CALL INC_CNT("${cmdName}");`,
|
callIncCnt: (cmdName: string) => `CALL INC_CNT("${cmdName}");`,
|
|
@ -1,7 +1,8 @@
|
||||||
import config from '../../config.ts';
|
import config from '../../config.ts';
|
||||||
import { Bot, log, LT } from '../../deps.ts';
|
import { Bot, log, LT } from '../../deps.ts';
|
||||||
import { warnColor } from '../commandUtils.ts';
|
import { warnColor } from '../commandUtils.ts';
|
||||||
import { dbClient, lfgChannelSettings } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { lfgChannelSettings } from '../db/common.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
||||||
export const guildDelete = async (bot: Bot, guildId: bigint) => {
|
export const guildDelete = async (bot: Bot, guildId: bigint) => {
|
||||||
|
|
|
@ -2,9 +2,10 @@ import config from '../../config.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { Bot, botId, Message } from '../../deps.ts';
|
import { Bot, botId, Message } from '../../deps.ts';
|
||||||
import { infoEmbed } from '../commandUtils.ts';
|
import { infoEmbed } from '../commandUtils.ts';
|
||||||
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { generateGuildSettingKey, lfgChannelSettings, queries } from '../db/common.ts';
|
||||||
|
|
||||||
export const messageCreate = async (bot: Bot, message: Message) => {
|
export const messageCreate = (bot: Bot, message: Message) => {
|
||||||
// Ignore self
|
// Ignore self
|
||||||
if (botId === message.authorId) return;
|
if (botId === message.authorId) return;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,8 @@ import { LOCALMODE } from '../../flags.ts';
|
||||||
import { getRandomStatus, successColor } from '../commandUtils.ts';
|
import { getRandomStatus, successColor } from '../commandUtils.ts';
|
||||||
import { ActiveEvent } from '../types/commandTypes.ts';
|
import { ActiveEvent } from '../types/commandTypes.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
import { dbClient, queries } from '../db.ts';
|
import { dbClient } from '../db/client.ts';
|
||||||
|
import { queries } from '../db/common.ts';
|
||||||
import { deleteEvent, handleFailures, lockEvent, notifyEventMembers, tenMinutes } from '../notificationSystem.ts';
|
import { deleteEvent, handleFailures, lockEvent, notifyEventMembers, tenMinutes } from '../notificationSystem.ts';
|
||||||
import { updateBotListStatistics } from '../botListPoster.ts';
|
import { updateBotListStatistics } from '../botListPoster.ts';
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@ export const ready = (rawBot: Bot) => {
|
||||||
|
|
||||||
// Interval to rotate the status text every 30 seconds to show off more commands
|
// Interval to rotate the status text every 30 seconds to show off more commands
|
||||||
if (botStatusIntervalId) clearInterval(botStatusIntervalId);
|
if (botStatusIntervalId) clearInterval(botStatusIntervalId);
|
||||||
botStatusIntervalId = setInterval(async () => {
|
botStatusIntervalId = setInterval(() => {
|
||||||
log(LT.LOG, 'Changing bot status');
|
log(LT.LOG, 'Changing bot status');
|
||||||
bot.helpers.editBotStatus({
|
bot.helpers.editBotStatus({
|
||||||
activities: [{
|
activities: [{
|
||||||
|
|
|
@ -4,7 +4,8 @@ import { LfgEmbedIndexes } from './buttons/eventUtils.ts';
|
||||||
import { getEventMemberCount, getGuildName, getLfgMembers } from './buttons/live-event/utils.ts';
|
import { getEventMemberCount, getGuildName, getLfgMembers } from './buttons/live-event/utils.ts';
|
||||||
import { failColor, infoColor1, sendDirectMessage, warnColor } from './commandUtils.ts';
|
import { failColor, infoColor1, sendDirectMessage, warnColor } from './commandUtils.ts';
|
||||||
import { reportSlashName } from './commands/slashCommandNames.ts';
|
import { reportSlashName } from './commands/slashCommandNames.ts';
|
||||||
import { dbClient, queries } from './db.ts';
|
import { dbClient } from './db/client.ts';
|
||||||
|
import { queries } from './db/common.ts';
|
||||||
import { ActiveEvent } from './types/commandTypes.ts';
|
import { ActiveEvent } from './types/commandTypes.ts';
|
||||||
import utils from './utils.ts';
|
import utils from './utils.ts';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue