1
1
mirror of https://github.com/Burn-E99/GroupUp.git synced 2026-01-08 04:17:54 -05:00

don't need generateReport

This commit is contained in:
Ean Milligan (Bastion)
2023-01-29 01:51:49 -05:00
parent 19d3aa7819
commit 23f1a3bd45
2 changed files with 9 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import config from '../../config.ts';
import { ApplicationCommandOptionTypes, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes, sendMessage } from '../../deps.ts';
import { generateReport, isLFGChannel, somethingWentWrong, successColor } from '../commandUtils.ts';
import { infoColor2, isLFGChannel, somethingWentWrong, successColor } from '../commandUtils.ts';
import { dbClient, queries } from '../db.ts';
import { CommandDetails } from '../types/commandTypes.ts';
import utils from '../utils.ts';
@ -24,7 +24,13 @@ const details: CommandDetails = {
const execute = (bot: Bot, interaction: Interaction) => {
dbClient.execute(queries.callIncCnt('cmd-report')).catch((e) => utils.commonLoggers.dbError('report.ts', 'call sproc INC_CNT on', e));
if (interaction.data?.options?.[0].value) {
sendMessage(bot, config.reportChannel, generateReport(interaction.data.options[0].value as string)).catch((e: Error) => utils.commonLoggers.interactionSendError('report.ts:28', interaction, e));
sendMessage(bot, config.reportChannel, {
embeds: [{
color: infoColor2,
title: 'USER REPORT:',
description: interaction.data.options[0].value as string,
}],
}).catch((e: Error) => utils.commonLoggers.interactionSendError('report.ts:28', interaction, e));
bot.helpers.sendInteractionResponse(
interaction.id,
interaction.token,