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个月的代码
1条答案
按热度按时间niwlg2el1#
所以你可能不想用数字作为变量名。这会导致一些不好的互动。将列表重命名为
words
或者别的什么。