|
|
@ -1,5 +1,6 @@
|
|
|
|
import logging
|
|
|
|
import logging
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
|
|
|
|
|
|
@ -9,10 +10,14 @@ load_dotenv()
|
|
|
|
# Constants
|
|
|
|
# Constants
|
|
|
|
BOT_TOKEN = os.environ.get("BOT_TOKEN")
|
|
|
|
BOT_TOKEN = os.environ.get("BOT_TOKEN")
|
|
|
|
BOT_PREFIX = "!"
|
|
|
|
BOT_PREFIX = "!"
|
|
|
|
|
|
|
|
DB_FILE = Path("db", "charity.db")
|
|
|
|
|
|
|
|
DB_FILE.parent.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
|
|
|
LOG_FILE = Path("logs", "discord.log")
|
|
|
|
|
|
|
|
LOG_FILE.parent.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
# Set Up Logging
|
|
|
|
# Set Up Logging
|
|
|
|
logger = logging.getLogger('discord')
|
|
|
|
LOGGER = logging.getLogger("discord")
|
|
|
|
logger.setLevel(logging.DEBUG)
|
|
|
|
LOGGER.setLevel(logging.DEBUG)
|
|
|
|
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
|
|
|
|
handler = logging.FileHandler(filename=LOG_FILE, encoding="utf-8", mode="w")
|
|
|
|
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
|
|
|
|
handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
|
|
|
|
logger.addHandler(handler)
|
|
|
|
LOGGER.addHandler(handler)
|
|
|
|