embed.add_field 无效的语法错误 discord.py

huangapple go评论95阅读模式
英文:

embed.add_field invalid syntax error discord.py

问题

if message.content.startswith('/help'):
    await message.delete()
    embed = discord.Embed(
        title="帮助",
        url="https://discord.com/channels/1138190037234749522/1139129893884547113",
        description="这应该可以帮助您和新玩家了解有关此服务器以及其功能的一切。\n这是在2023年10月8日14:34制作的,所以不要指望它包含所有所需的内容,而且可能已经过时了。\n\n请先阅读快速规则。",
        colour=0xd7f736
    )
    embed.set_author(
        name="Invadtrix",
        url="https://discord.gg/G76wVADr8H",
        icon_url="https://cdn.discordapp.com/emojis/1139112081073918002.webp?size=128&quality=lossless"
    )
    embed.add_field(
        name="快速规则",
        value="1. 无毒\n2. 尊重每个人\n3. 不要种族主义\n4. 任何频道中都不允许不适宜内容\n5. 请不要违反任何规则\n6. 听从管理员的指导\n7. 如果您发现有人违反规则:\n请与管理员或更高级别的人员联系",
        inline=True
    )
    embed.add_field(
        name="帮助",
        value="这不会告诉你一切\n但指南频道会\n------------------------------------\n在脚本频道中,您可以获取您玩的游戏的脚本(不是所有游戏)\n机器人频道用于机器人命令\n这是唯一允许您使用机器人命令的频道\n常规已经解释了它\n但如果你不明白:它基本上是一个你可以与其他人交流的地方",
        inline=True
    )
    embed.add_field(
        name="命令",
        value="这不会包含一切。\n\n/帮助   /命令   /脚本   /指南   /公告 💀\n目前就这些了。\n要获取更多命令,请转到命令频道或说\"/命令\"\n它们都是相同的,永远都会是。",
        inline=True
    )
    embed.set_thumbnail(url="https://cdn.discordapp.com/emojis/1139112081073918002.webp?size=128&quality=lossless")
    embed.set_footer(text="谢谢")

    await message.author.send(embed=embed)

我尝试修复了一些东西,但没有成功,并且我希望它能够工作,但我想我错了:c
第一个错误发生在第52行。

英文:

error

if message.content.startswith('/help'):
    await message.delete()
    embed = discord.Embed(title="Help",url="https://discord.com/channels/1138190037234749522/1139129893884547113",
    description="This should probably help you and starting players with everything they need to know about this server and what it can do.\nThis is also made in 10/08/2023 14:34 so do not expect this to contain everything that is needed and this will probably be outdated.\n\nPlease read the Quick Rules first.",
    colour=0xd7f736,
    embed.set_author(name="Invadtrix",
    url="https://discord.gg/G76wVADr8H",
    icon_url="https://cdn.discordapp.com/emojis/1139112081073918002.webp?size=128&quality=lossless")
    embed.add_field(name="Quick Rules",
    value="1. No Toxicity\n2. Respect everyone\n3. Don't be racist\n4. No NSFW in any channel\n5. Please don't break any\nRule\n6. Listen to moderators\n7. If you find anyone\nbreaking the rules:\nPlease contact a moderator\nor higher about them",
    inline=True)
    embed.add_field(name="Help",
    value="This wont tell you everything\nBut the Guide channel will\n------------------------------------\nIn the scripts channel you can get the scripts\nfor the games you play (Not all)\nThe bot channel is for bot commands\nIts the only channel where you can use bot commands\nGeneral already explains it\nBut if you don't understand: Its basically a place where you can talk with other people",
    inline=True)
    embed.add_field(name="Commands",
    value="This will not contain everything.\n\n/Help   /Commands   /Scripts   /Guide   /Announcements 💀\nThat's all for now.\nFor more commands go to the commands channel or say \"/Commands\"\nthey both are the same and will always be.",
    inline=True)
    embed.set_thumbnail(url="https://cdn.discordapp.com/emojis/1139112081073918002.webp?size=128&quality=lossless")

    embed.set_footer(text="Thank you")

    await message.author.send(embed=embed)

I tried fixing something but that didn't work
and I was expecting for it to work but I guess I was wrong :c
The first error was at Line 52

答案1

得分: 0

有时间戳

没有时间戳

我的代码

英文:

So uhh I found out the problem

In the discord embed creator I enabled timestamps
For some reason the timestamps did not work
So I decided to remove the timestamps from the code..
And I umm... You will see for yourself

with timestamp

without timestamp

my code

huangapple
  • 本文由 发表于 2023年8月10日 21:05:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76876002.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定