【发布时间】:2020-10-04 23:51:44
【问题描述】:
with open("C:/Users/leola/Desktop/Leo/Coding/Python/DISCORD_BOT/help_alt.json", 'r') as help_file:
help_commands = json.load(help_file)
# help_commands["embed"]["author"]["name"] = bot.user.display_name
# help_commands["embed"]["footer"]["text"] = f'{curr_page}/{num_pages}'
print(help_commands)
help_embed = discord.Embed.from_dict(help_commands)
await ctx.channel.send(embed=help_embed)
我向 discord 上的某个人寻求帮助,他们说 json 为他们工作,他们可以从中获得嵌入,由于某种原因它对我来说坏了,并给了我一个 Can't send empty message 错误代码,当我打印出来
【问题讨论】:
-
我找到了一个解决方法,只有一个 json,其中字段的名称和值作为 dict 中的键和值,并通过 for 循环运行它,但仍然不满意必须这样做:(
标签: python discord discord.py