bugfixes regarding logging, api and db working; small fixes in all of the cogs; moved all the configurable information to the config.py
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
MESSAGE_ID_FILE = 'data/message_id.json' #ts for roles
|
||||
from config import roles_message_id
|
||||
|
||||
def save_message_id(message_id):
|
||||
os.makedirs('data', exist_ok=True)
|
||||
with open(MESSAGE_ID_FILE, 'w') as f:
|
||||
with open(roles_message_id, 'w') as f:
|
||||
json.dump({'message_id': message_id}, f)
|
||||
|
||||
def load_message_id():
|
||||
try:
|
||||
with open(MESSAGE_ID_FILE, 'r') as f:
|
||||
with open(roles_message_id, 'r') as f:
|
||||
data = json.load(f)
|
||||
return data.get('message_id')
|
||||
except FileNotFoundError:
|
||||
|
||||
Reference in New Issue
Block a user