mirror of
https://github.com/Burn-E99/GroupUp.git
synced 2026-01-06 19:37:54 -05:00
Properly initialize join/leave/alt btns
This commit is contained in:
@ -1,8 +1,18 @@
|
||||
import { Bot, Interaction } from '../../../deps.ts';
|
||||
import { dbClient, queries } from '../../db.ts';
|
||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||
import utils from '../../utils.ts';
|
||||
|
||||
export const customId = 'alternateEvent';
|
||||
|
||||
export const execute = async (bot: Bot, interaction: Interaction) => {};
|
||||
export const execute = async (bot: Bot, interaction: Interaction) => {
|
||||
if (interaction.data?.customId && interaction.member && interaction.message && interaction.message.embeds[0] && interaction.message.embeds[0].fields) {
|
||||
// Light Telemetry
|
||||
dbClient.execute(queries.callIncCnt('btn-altEvent')).catch((e) => utils.commonLoggers.dbError('alternateEvent.ts', 'call sproc INC_CNT on', e));
|
||||
} else {
|
||||
somethingWentWrong(bot, interaction, 'noDataFromAlternateEventButton');
|
||||
}
|
||||
};
|
||||
|
||||
export const alternateEventButton = {
|
||||
customId,
|
||||
|
||||
@ -1,8 +1,21 @@
|
||||
import { Bot, Interaction } from '../../../deps.ts';
|
||||
import { dbClient, queries } from '../../db.ts';
|
||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||
import { idSeparator } from '../event-creation/utils.ts';
|
||||
import utils from '../../utils.ts';
|
||||
|
||||
export const customId = 'joinEvent';
|
||||
|
||||
export const execute = async (bot: Bot, interaction: Interaction) => {};
|
||||
export const execute = async (bot: Bot, interaction: Interaction) => {
|
||||
if (interaction.data?.customId && interaction.member && interaction.message && interaction.message.embeds[0] && interaction.message.embeds[0].fields) {
|
||||
// Light Telemetry
|
||||
dbClient.execute(queries.callIncCnt(interaction.data.customId.includes(idSeparator) ? 'btn-joinWLEvent' : 'btn-joinEvent')).catch((e) =>
|
||||
utils.commonLoggers.dbError('joinEvent.ts', 'call sproc INC_CNT on', e)
|
||||
);
|
||||
} else {
|
||||
somethingWentWrong(bot, interaction, 'noDataFromJoinEventButton');
|
||||
}
|
||||
};
|
||||
|
||||
export const joinEventButton = {
|
||||
customId,
|
||||
|
||||
@ -1,8 +1,18 @@
|
||||
import { Bot, Interaction } from '../../../deps.ts';
|
||||
import { dbClient, queries } from '../../db.ts';
|
||||
import { somethingWentWrong } from '../../commandUtils.ts';
|
||||
import utils from '../../utils.ts';
|
||||
|
||||
export const customId = 'leaveEvent';
|
||||
|
||||
export const execute = async (bot: Bot, interaction: Interaction) => {};
|
||||
export const execute = async (bot: Bot, interaction: Interaction) => {
|
||||
if (interaction.data?.customId && interaction.member && interaction.message && interaction.message.embeds[0] && interaction.message.embeds[0].fields) {
|
||||
// Light Telemetry
|
||||
dbClient.execute(queries.callIncCnt('btn-leaveEvent')).catch((e) => utils.commonLoggers.dbError('leaveEvent.ts', 'call sproc INC_CNT on', e));
|
||||
} else {
|
||||
somethingWentWrong(bot, interaction, 'noDataFromLeaveEventButton');
|
||||
}
|
||||
};
|
||||
|
||||
export const leaveEventButton = {
|
||||
customId,
|
||||
|
||||
Reference in New Issue
Block a user