[DB] Merge getGuildSettings & putGuild into GetOrCreateSettings (#9)

This commit is contained in:
2026-08-19 08:44:26 -07:00
committed by GitHub
parent 9c91e18962
commit cb2348f89c
23 changed files with 74 additions and 130 deletions
+4 -38
View File
@@ -49,49 +49,15 @@ export default {
modal.addLabelComponents(additionalInfoLabel, createPrivateTicket);
const guildSettings = await Database.getGuildSettings(interaction.guildId!);
if (!guildSettings || !guildSettings.moderator_channel_id)
return interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Report channel missing. Unable to submit report' });
const reportsChannel = await interaction.guild!.channels.fetch(guildSettings.moderator_channel_id);
const settings = await Database.getOrCreateSettings(interaction.guildId!);
if (!settings.moderator_channel_id)
return interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Moderator channel missing. Unable to submit report' });
const reportsChannel = await interaction.guild!.channels.fetch(settings.moderator_channel_id);
if (!reportsChannel || !reportsChannel.isSendable())
return interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Report channel missing. Unable to submit report' });
await interaction.showModal(modal);
// await reportsChannel.send({
// embeds: [{
// title: 'New Message Report!',
// fields: [
// {
// name: 'Message',
// value: interaction.targetMessage.url,
// inline: false
// },
// {
// name: 'Author',
// value: interaction.targetMessage.author.toString(),
// inline: false
// },
// {
// name: 'Reporter',
// value: interaction.user.toString(),
// inline: false
// }
// ]
// }]
// });
// await interaction.reply({
// embeds: [{
// color: 0x014995,
// description:
// "Thanks for making a report! I've notified the moderators who can take further action."
// }],
// flags: [MessageFlags.Ephemeral]
// });
} catch (error) {
console.error(error);
if (!interaction.replied) {