From 57aaf92947dd40a5b5b1ffec916ab7421994ba61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Fri, 17 Sep 2021 23:24:48 +0300 Subject: [PATCH] Prevent loadState function updating datastore entries everytime --- src/client/funcs/loadState.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/funcs/loadState.js b/src/client/funcs/loadState.js index 676685e..d56c275 100644 --- a/src/client/funcs/loadState.js +++ b/src/client/funcs/loadState.js @@ -4,6 +4,8 @@ module.exports = function loadState(client, guild){ let state; state = data.state; + if(!state) return; + data.state = {}; client.datastore.updateEntry(guild, data); return state;