【发布时间】:2020-08-01 16:33:52
【问题描述】:
我想在 Discord 机器人上发送嵌入的消息,但文本来自另一个文件。我这样做了,但它不起作用:
bot.command()
async def gdc(ctx):
"""Wins GDC"""
index1 = 0
file = open("/home/plo/rkr/res_wins2", "r")
for line in file.readlines():
line = line.strip()
index1 += 1
if index1 == 4: break
message = line
embed = discord.Embed()
embed.description = message
embed.title = title
embed.colour = 0xF1C40F
await ctx.send(embed=embed)
但是,似乎只有一个结果出来...这是我的 txt 文件的一部分:
Roi mouton: 9
tomate: 8
The_Portos: 8
【问题讨论】:
标签: discord.py