Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

commit 89e2dddb877b21b3ff40c4e1f58a311e0dca9b47
parent e4bf3bec567aa2fd7c3ef37e0b4b8a763ae7e7c9
Author: Demonstrandum <moi@knutsen.co>
Date:   Thu, 19 Mar 2020 15:53:03 +0000

Remove duplicates.

Diffstat:
Mlib/main.ts | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/main.ts b/lib/main.ts @@ -32,13 +32,16 @@ import { pastebin_latest, // Anything that hasn't been defined in `bot.json` // will be taken care of by the defaults. -const CONFIG = deep_merge( +let CONFIG = deep_merge( DEFAULT_CONFIG, JSON.parse(read_file('./bot.json', 'utf-8'))); // CONFIG will eventually update to the online version. pastebin_latest().then(res => { deep_merge(CONFIG, res); + // Remove any duplicates. + CONFIG = export_config(CONFIG, {}); + CONFIG = JSON.parse(CONFIG); // Precompile all regular-expressions in known places. ['respond', 'reject', 'replace'] .each(name => CONFIG.rules[name].mut_map(compile_match));