所以我在一个discord机器人上开发了一个新功能,它可以告诉你服务器上的所有成员(氏族),氏族信息存储在一个json文件中,我想通过send\u message()将它发送给用户,但它不断返回这个错误:discord.ext.命令.errors.CommandInvokeError错误:命令引发异常:HTTPException:错误请求(状态代码:400) 经过一点研究,这意味着有超过2000个字符内的消息,我想知道我的代码有什么问题,任何建议是欢迎的,谢谢阅读本文。#我爱你
@client.command(pass_context=True)
async def partylist(ctx):
user = ctx.message.author
await partylist(user)
async def partylist(user):
partylist = discord.Embed(
colour = discord.Colour.orange()
)
partylist.set_author(name="Parties")
with open(url2, 'r') as w:
file = json.load(w)
for item in file:
partylist.add_field(name=item,value="",inline=False)
w.close()
await client.say(user,embed=partylist)
#This is the json file
{"clan2": {"Members": "ShareYourGraves#9977"}, "clan1": {"Members": "||CATENARY||#9105,"}}
我建议你只发送有限的信息给用户,允许他们通过不同的命令获得更详细的信息,或者让他们在网页上查看
相关问题 更多 >
编程相关推荐