diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/config/config.ts | 2 | ||||
-rw-r--r-- | src/lib/models/instance/Guild.ts | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index 9169180..a90a267 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -264,7 +264,7 @@ export default class ConfigCommand extends BushCommand { break; } case 'delete': { - await message.guild.setSetting(setting, guildSettingsObj[setting].replaceNullWith, message.member); + await message.guild.setSetting(setting, guildSettingsObj[setting].replaceNullWith(), message.member); const messageOptions = await this.generateMessageOptions(message, setting); msg = (await message.util.reply(messageOptions)) as Message; break; diff --git a/src/lib/models/instance/Guild.ts b/src/lib/models/instance/Guild.ts index 1a1ff35..49bf822 100644 --- a/src/lib/models/instance/Guild.ts +++ b/src/lib/models/instance/Guild.ts @@ -188,13 +188,13 @@ export interface GuildSetting { type: GuildSettingType; subType: ChannelType[] | undefined; configurable: boolean; - replaceNullWith: string | null; + replaceNullWith: () => string | null; } const asGuildSetting = <T>(et: { [K in keyof T]: PartialBy<GuildSetting, 'configurable' | 'subType' | 'replaceNullWith'> }) => { for (const key in et) { et[key].subType ??= undefined; et[key].configurable ??= true; - et[key].replaceNullWith ??= null; + et[key].replaceNullWith ??= () => null; } return et as { [K in keyof T]: GuildSetting }; }; @@ -204,7 +204,7 @@ export const guildSettingsObj = asGuildSetting({ name: 'Prefix', description: 'The phrase required to trigger text commands in this server.', type: 'string', - replaceNullWith: client.config.prefix + replaceNullWith: () => client.config.prefix }, autoPublishChannels: { name: 'Auto Publish Channels', |