use 'null' instead of empty strings

This commit is contained in:
Jill 2023-11-13 20:11:11 +03:00
parent db7b52d66e
commit b0ea73febc
Signed by: oat
GPG key ID: 33489AA58A955108

View file

@ -167,11 +167,11 @@ export const counterConfigs = new Map([
}], }],
['messageTemplateIncrease', { ['messageTemplateIncrease', {
type: ConfigType.String, type: ConfigType.String,
default: '' default: 'null'
}], }],
['messageTemplateDecrease', { ['messageTemplateDecrease', {
type: ConfigType.String, type: ConfigType.String,
default: '' default: 'null'
}], }],
// these ones are fake and are just stand-ins for values defined inside the actual counters table // these ones are fake and are just stand-ins for values defined inside the actual counters table
@ -214,9 +214,9 @@ export async function announceCounterUpdate(bot: Client, member: GuildMember, de
let template = await getCounterConfig(counter.id, 'messageTemplate') as string; let template = await getCounterConfig(counter.id, 'messageTemplate') as string;
const templateIncrease = await getCounterConfig(counter.id, 'messageTemplateIncrease') as string; const templateIncrease = await getCounterConfig(counter.id, 'messageTemplateIncrease') as string;
if (templateIncrease !== '' && delta > 0) template = templateIncrease; if (templateIncrease !== 'null' && delta > 0) template = templateIncrease;
const templateDecrease = await getCounterConfig(counter.id, 'messageTemplateDecrease') as string; const templateDecrease = await getCounterConfig(counter.id, 'messageTemplateDecrease') as string;
if (templateDecrease !== '' && delta < 0) template = templateDecrease; if (templateDecrease !== 'null' && delta < 0) template = templateDecrease;
const anonymous = await getCounterConfig(counter.id, 'anonymous') as boolean; const anonymous = await getCounterConfig(counter.id, 'anonymous') as boolean;