[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
+3 -2
View File
@@ -7,8 +7,9 @@ export default {
try {
if (!interaction.guild) throw new Error('This action must be run in a guild.');
const settings = await Database.getGuildSettings(interaction.guild.id);
if (!settings || !settings.devwatch_role_id) throw new Error('`devwatch_role_id` was not configured. Please configure a role then try again.');
const settings = await Database.getOrCreateSettings(interaction.guild.id);
if (!settings.devwatch_role_id) throw new Error('`devwatch_role_id` was not configured. Please configure a role then try again.');
const member = await interaction.guild.members.fetch(interaction.user.id);
if (!member) throw new Error('Unable to retreive the member executing this command.');