Updated tag.py

This commit is contained in:
davfsa 2018-05-27 11:27:24 +02:00
parent 3772f04b5c
commit daf320a076
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import asyncio
class Tag: class Tag:
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
with open("src/resources/tags.json", "r") as fp: with open("src/shared_libs/tags.json", "r") as fp:
json_data = fp.read() json_data = fp.read()
global tags global tags
tags = json.loads(json_data) tags = json.loads(json_data)
@ -59,7 +59,7 @@ class Tag:
if not exists: if not exists:
tags.update({tag_name : tag_info}) tags.update({tag_name : tag_info})
async with aiofiles.open("src/resources/tags.json", "w") as fp: async with aiofiles.open("src/shared_libs/tags.json", "w") as fp:
json_data = json.dumps(tags) json_data = json.dumps(tags)
await fp.write(json_data) await fp.write(json_data)
@ -84,7 +84,7 @@ class Tag:
if found is not None: if found is not None:
del tags[found] del tags[found]
async with aiofiles.open("src/resources/tags.json", "w") as fp: async with aiofiles.open("src/shared_libs/tags.json", "w") as fp:
json_data = json.dumps(tags) json_data = json.dumps(tags)
await fp.write(json_data) await fp.write(json_data)