0

我无法从我的脚本中加载齿轮。有谁知道为什么?我一直在尝试几种不同的方法,但似乎没有任何效果。这是我的代码:

import discord
from discord.ext import commands
from utils import output, parsing, checks, mysql_module, helpers
import os
import traceback
import database
import re

config = parsing.parse_json('config.json')

skip_cogs=config['skip_cogs']

Mysql = mysql_module.Mysql()

bot = commands.Bot(command_prefix=config['prefix'], description=config["description"])

try:
    os.remove("log.txt")
except FileNotFoundError:
    pass

startup_extensions = os.listdir("./cogs")
if "__pycache__" in startup_extensions:
    startup_extensions.remove("__pycache__")
startup_extensions = [ext.replace('.py', '') for ext in startup_extensions]
loaded_extensions = []

startup_extensions=[x for x in startup_extensions if x not in skip_cogs]

运行时出现以下错误: TypeError: cogs must derive from Cog

任何帮助将不胜感激

4

0 回答 0