typeerror:int类型的对象没有len()(discord.py编辑消息)

cig3rfwq  于 2021-07-13  发布在  Java
关注(0)|答案(1)|浏览(284)
message = await ctx.send("Hey guys")
await asyncio.sleep(1)
1 = [f"a", "c", "d", "e", "f", "g", "h", "yo", "wow"]
for i in range(1):
 await ctx.message.edit(random.choice(1))

我试图让我的discord bot编辑它的消息,并随机选择1中的一个词,但由于某种原因,我不断得到typeerror:object of type'int'has no len()我对python很陌生我只编写了4个月的代码

niwlg2el

niwlg2el1#

所以你可能不想用数字作为变量名。这会导致一些不好的互动。将列表重命名为 words 或者别的什么。

相关问题