aboutsummaryrefslogtreecommitdiff
path: root/src/commands/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/config')
-rw-r--r--src/commands/config/blacklist.ts6
-rw-r--r--src/commands/config/config.ts12
-rw-r--r--src/commands/config/disable.ts3
3 files changed, 6 insertions, 15 deletions
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts
index d6d7c18..c928265 100644
--- a/src/commands/config/blacklist.ts
+++ b/src/commands/config/blacklist.ts
@@ -69,8 +69,7 @@ export default class BlacklistCommand extends BushCommand {
if (global) {
if ((action as 'blacklist' | 'unblacklist' | 'toggle') === 'toggle') {
const globalDB =
- (await Global.findByPk(client.config.environment)) ??
- (await Global.create({ environment: client.config.environment }));
+ (await Global.findByPk(client.config.environment)) ?? (await Global.create({ environment: client.config.environment }));
const blacklistedUsers = globalDB.blacklistedUsers;
const blacklistedChannels = globalDB.blacklistedChannels;
action = blacklistedUsers.includes(targetID) || blacklistedChannels.includes(targetID) ? 'unblacklist' : 'blacklist';
@@ -96,8 +95,7 @@ export default class BlacklistCommand extends BushCommand {
});
// guild disable
} else {
- if (!message.guild)
- return await message.util.reply(`${util.emojis.error} You have to be in a guild to disable commands.`);
+ if (!message.guild) return await message.util.reply(`${util.emojis.error} You have to be in a guild to disable commands.`);
const blacklistedChannels = (await message.guild.getSetting('blacklistedChannels')) ?? [];
const blacklistedUsers = (await message.guild.getSetting('blacklistedUsers')) ?? [];
if ((action as 'blacklist' | 'unblacklist' | 'toggle') === 'toggle') {
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index 0ca8ef8..3342456 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -51,9 +51,7 @@ export default class SettingsCommand extends BushCommand {
options: [
{
name: 'value',
- description: `What would you like to add to the server's ${guildSettingsObj[
- setting
- ].name.toLowerCase()}?'`,
+ description: `What would you like to add to the server's ${guildSettingsObj[setting].name.toLowerCase()}?'`,
type: guildSettingsObj[setting].type.replace('-array', '').toUpperCase() as SlashArgType,
required: true
}
@@ -88,9 +86,7 @@ export default class SettingsCommand extends BushCommand {
options: [
{
name: 'value',
- description: `What would you like to set the server's ${guildSettingsObj[
- setting
- ].name.toLowerCase()} to?'`,
+ description: `What would you like to set the server's ${guildSettingsObj[setting].name.toLowerCase()} to?'`,
type: guildSettingsObj[setting].type.toUpperCase() as SlashArgType,
required: true
}
@@ -186,9 +182,7 @@ export default class SettingsCommand extends BushCommand {
) {
if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be used in servers.`);
if (!message.member?.permissions.has('MANAGE_GUILD') && !message.member?.user.isOwner())
- return await message.util.reply(
- `${util.emojis.error} You must have the **MANAGE_GUILD** permission to run this command.`
- );
+ return await message.util.reply(`${util.emojis.error} You must have the **MANAGE_GUILD** permission to run this command.`);
const setting = message.util.isSlash ? (_.camelCase(args.subcommandGroup)! as GuildSettings) : args.setting!;
const action = message.util.isSlash ? args.subcommand! : args.action!;
const value = args.value;
diff --git a/src/commands/config/disable.ts b/src/commands/config/disable.ts
index 2e3ce74..521972b 100644
--- a/src/commands/config/disable.ts
+++ b/src/commands/config/disable.ts
@@ -70,8 +70,7 @@ export default class DisableCommand extends BushCommand {
if (global) {
if (action === 'toggle') {
const disabledCommands = (
- (await Global.findByPk(client.config.environment)) ??
- (await Global.create({ environment: client.config.environment }))
+ (await Global.findByPk(client.config.environment)) ?? (await Global.create({ environment: client.config.environment }))
).disabledCommands;
action = disabledCommands.includes(commandID) ? 'disable' : 'enable';
}