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

Finish most of the create event

This commit is contained in:
Ean Milligan (Bastion)
2023-02-02 21:33:27 -05:00
parent d5f0b08e08
commit 8c6a3749df
9 changed files with 167 additions and 41 deletions

View File

@ -1,6 +1,6 @@
import config from '../../config.ts';
import { ApplicationCommandFlags, ApplicationCommandTypes, Bot, Interaction, InteractionResponseTypes } from '../../deps.ts';
import { failColor, somethingWentWrong, successColor } from '../commandUtils.ts';
import { failColor, somethingWentWrong, successColor, safelyDismissMsg } from '../commandUtils.ts';
import { dbClient, lfgChannelSettings, queries } from '../db.ts';
import { CommandDetails } from '../types/commandTypes.ts';
import utils from '../utils.ts';
@ -53,7 +53,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
embeds: [{
color: successColor,
title: 'LFG Channel settings removed!',
description: `${config.name} has finished removing the settings for this channel. You may safely dismiss this message.`,
description: `${config.name} has finished removing the settings for this channel. ${safelyDismissMsg}`,
}],
},
}).catch((e: Error) => utils.commonLoggers.interactionSendError('delete.ts', interaction, e));

View File

@ -14,7 +14,7 @@ import {
OverwriteTypes,
sendMessage,
} from '../../deps.ts';
import { failColor, infoColor2, somethingWentWrong, successColor } from '../commandUtils.ts';
import { failColor, infoColor2, somethingWentWrong, successColor, safelyDismissMsg } from '../commandUtils.ts';
import { dbClient, lfgChannelSettings, queries } from '../db.ts';
import { CommandDetails } from '../types/commandTypes.ts';
import utils from '../utils.ts';
@ -64,7 +64,7 @@ const execute = async (bot: Bot, interaction: Interaction) => {
const setupOpts = interaction.data?.options?.[0];
if (setupOpts && setupOpts.name && interaction.channelId && interaction.guildId) {
if (setupOpts?.name && interaction.channelId && interaction.guildId) {
if (lfgChannelSettings.has(`${interaction.guildId}-${interaction.channelId}`)) {
// Cannot setup a lfg channel that is already set up
bot.helpers.sendInteractionResponse(interaction.id, interaction.token, {
@ -283,7 +283,7 @@ The Discord Slash Command system will ensure you provide all the required detail
embeds: [{
color: successColor,
title: 'LFG Channel setup complete!',
description: `${config.name} has finished setting up this channel. You may safely dismiss this message.`,
description: `${config.name} has finished setting up this channel. ${safelyDismissMsg}`,
}],
},
}).catch((e: Error) => utils.commonLoggers.interactionSendError('setup.ts', interaction, e));