mirror of
https://github.com/nx-bat/discordbot-ng.git
synced 2026-11-11 07:13:37 -05:00
[DB] Merge getGuildSettings & putGuild into GetOrCreateSettings (#9)
This commit is contained in:
@@ -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.');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user