Python 3.x I';m在Discord.py中创建cog时出错

Python 3.x I';m在Discord.py中创建cog时出错,python-3.x,discord.py,Python 3.x,Discord.py,代码: 我一开始就收到消息“发生错误”有人知道原因吗?我还没有评论的权限,所以我要在这里键入它 你定义了你的机器人吗?例如,client=commands.Bot(command_prefix='$',description='-显示此消息,intents=intents)?您是如何组织文件的?还有它的,@commands.command()在视频中编辑了文件,但我收到了一个错误。 cogdeneme = { "XIORXA BOT.örnekcog", } for

代码:


我一开始就收到消息“发生错误”有人知道原因吗?

我还没有评论的权限,所以我要在这里键入它


你定义了你的机器人吗?例如,client=commands.Bot(command_prefix='$',description='-显示此消息,intents=intents)?

您是如何组织文件的?还有它的,
@commands.command()
在视频中编辑了文件,但我收到了一个错误。
cogdeneme  = {
    "XIORXA BOT.örnekcog",
}
for x in cogdeneme:
    try:
        client.add_cog(x)
    except:
        print(x + "  <<== Something went wrong.")
from discord.ext import commands
import discord
class deneme(commands.Cog):
    def __init__(self,client):
        self.client = client
    @commands.command
    async def deneme(self,ctx):
        ctx.send("hello")
def setup(client):
    client.add_cog(deneme(client))