mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3 JSON Driver] Don't save json if it exists (#1133)
This commit is contained in:
parent
5ebde77747
commit
9b1018fa96
@ -32,14 +32,14 @@ class JSON(BaseDriver):
|
||||
self.data_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
self.data_path = self.data_path / self.file_name
|
||||
|
||||
|
||||
self.jsonIO = JsonIO(self.data_path)
|
||||
|
||||
try:
|
||||
self.data = self.jsonIO._load_json()
|
||||
except FileNotFoundError:
|
||||
self.data = {}
|
||||
self.jsonIO._save_json(self.data)
|
||||
self.jsonIO._save_json(self.data)
|
||||
|
||||
def get_driver(self):
|
||||
return self
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user