diff --git a/cogs/utils/page_api.py b/cogs/utils/page_api.py index a49f499..aac5363 100644 --- a/cogs/utils/page_api.py +++ b/cogs/utils/page_api.py @@ -219,11 +219,6 @@ def __init__(self, site: str = "scp-jp"): PANOPTICON_API_URL: APIベースURL(例: https://manage.scp-jp.com) PANOPTICON_API_KEY: APIキー(manage API用) """ - dotenv_path = Path(__file__).parents[2] / ".env" - if not dotenv_path.exists(): - raise FileNotFoundError(".env file not found") - - load_dotenv(dotenv_path) # APIキー(PANOPTICON_API_KEY panopticon_api_key = getenv("PANOPTICON_API_KEY") @@ -349,6 +344,11 @@ async def request(): if __name__ == "__main__": + dotenv_path = Path(__file__).parents[2] / ".env" + if not dotenv_path.exists(): + raise FileNotFoundError(".env file not found") + + load_dotenv(dotenv_path) async def main(): try: