Update main.py

This commit is contained in:
2026-06-07 11:58:58 +08:00
parent d54923100c
commit ef179296e5
+3 -1
View File
@@ -3,6 +3,8 @@ import sys
import threading import threading
import time import time
import os import os
from pathlib import Path
import discord import discord
import dotenv import dotenv
from discord.ext import commands from discord.ext import commands
@@ -130,7 +132,7 @@ class App:
if __name__ == '__main__': if __name__ == '__main__':
try: try:
dotenv.load_dotenv() dotenv.load_dotenv(Path.cwd() / ".env")
except Exception: except Exception:
raise Exception('Failed to load .env file. Create it before running.') raise Exception('Failed to load .env file. Create it before running.')