Spaces:
Runtime error
Runtime error
Upload __init__.py
Browse files- cogs/__init__.py +21 -0
cogs/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import re
|
| 3 |
+
import traceback
|
| 4 |
+
|
| 5 |
+
Directory = os.path.dirname(os.path.realpath(__file__))
|
| 6 |
+
|
| 7 |
+
def load(bot):
|
| 8 |
+
Failed = []
|
| 9 |
+
|
| 10 |
+
for Extension in [
|
| 11 |
+
"cogs." + re.sub(".py", "", File)
|
| 12 |
+
for File in os.listdir(Directory)
|
| 13 |
+
if not "__" in File
|
| 14 |
+
]:
|
| 15 |
+
try:
|
| 16 |
+
bot.load_extension(Extension)
|
| 17 |
+
except:
|
| 18 |
+
traceback.print_exc()
|
| 19 |
+
Failed.append(f"{Extension}.py 에서 오류 발생\n\n{traceback.print_exc()}")
|
| 20 |
+
|
| 21 |
+
return Failed
|