【发布时间】:2022-12-26 04:32:09
【问题描述】:
是否可以使用 nextcord 按命令创建线程?我试着这样做,但没有成功。 PyCharm 没有给我任何错误信息。 这是我的代码:
@bot.command(name='create_thread')
@commands.has_permissions(create_public_threads=True)
async def thread(ctx, *, arg):
await nextcord.create_thread(name=f'{arg}', message=None, auto_archive_duration=60, type=None, reason=None)
错误在await nextcord.create_thread(name=f'{arg}', message=None, auto_archive_duration=60, type=None, reason=None),但我不知道哪里出了问题。
【问题讨论】:
-
具体是什么错误?
-
我没有收到任何错误。
-
这可能与您使用的是
nextcord.create_thread而不是ctx.create_thread有关。想想看。有了你现在的说法,discord怎么会知道在哪里你想创建线程? -
没有工作,我没有收到错误
-
抱歉,
ctx.channel.create_thread应该可以解决问题。