OokamiPupV2/globals.py

23 lines
583 B
Python

import time
import json
import sys
# Store the start time globally
_bot_start_time = time.time()
def get_bot_start_time():
"""Retrieve the bot's start time globally."""
return _bot_start_time
def load_config_file():
CONFIG_PATH = "config.json"
try:
with open(CONFIG_PATH, "r") as f:
config_data = json.load(f)
return config_data
except FileNotFoundError:
print("Error: config.json not found.")
sys.exit(1)
except json.JSONDecodeError as e:
print(f"Error parsing config.json: {e}")
sys.exit(1)