【问题标题】:when i write the command this error i see [closed]当我写命令时,我看到了这个错误[关闭]
【发布时间】:2021-04-13 15:23:07
【问题描述】:
    cur.execute(command, tuple(values))

    if (fetch := cur.fatchone()) is not None:
        return fetch[0]
    @bot_has_permissions(manage_roles=True)
    @has_permissions(manage_roles=True, manage_guild=True)
    async def unmute_members(self, ctx, members: Greedy[Member], *, reason: Optional[str] = "لا يكثر هرجك"):
        if not len(members):
            await ctx.send("!unmute @member [reason]")

        else:
            await self.unmute(ctx, members, reason=reason)

AttributeError: 'sqlite3.Cursor' 对象没有属性 'fatchone'

【问题讨论】:

  • 不是fatchone。这是fetchone。 FET,而不是 FAT。 fetchone 表示fetch one

标签: python-3.x sqlite discord.py


【解决方案1】:

错字。

    if (fetch := cur.fatchone()) is not None:

应该是

    if (fetch := cur.fetchone()) is not None:

【讨论】:

    猜你喜欢
    • 2020-12-12
    • 1970-01-01
    • 2023-02-09
    • 2019-05-05
    • 1970-01-01
    • 2018-11-30
    • 2021-10-04
    • 1970-01-01
    • 2022-08-15
    相关资源
    最近更新 更多