我在discord.py中制作一个不符合的机器

发布于 2025-02-11 02:03:00 字数 567 浏览 1 评论 0原文

这是我的主要嵌入式代码

embedVar = discord.Embed(title="Hello, and welcome to Alex's Bobux", description="Desc", color=#00ff00)
      embedVar.add_field(name="Field1", value="hi", inline=False)
      embedVar.add_field(name="Field2", value="hi2", inline=False)
      await message.channel.send(embed=embedVar)

,这是我获得任何帮助的错误

File "main.py", line 21
    embedVar.add_field(name="Field2", value="hi2", inline=False)
    ^
SyntaxError: invalid syntax

,这是最大程度地赞赏的,但就目前而言,这就是我的问题。 编辑:这与python不使用我的十六进制代码有关,我该如何修复它?

Here is my main embed code

embedVar = discord.Embed(title="Hello, and welcome to Alex's Bobux", description="Desc", color=#00ff00)
      embedVar.add_field(name="Field1", value="hi", inline=False)
      embedVar.add_field(name="Field2", value="hi2", inline=False)
      await message.channel.send(embed=embedVar)

and this is the error im getting

File "main.py", line 21
    embedVar.add_field(name="Field2", value="hi2", inline=False)
    ^
SyntaxError: invalid syntax

any help is most greatly appreciated, but for now thats my issue.
EDIT: ITS SOMETHING TO DO WITH PYTHON NOT TAKING MY HEX CODES, how do i fix it lol?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寻梦旅人 2025-02-18 02:03:00

您的颜色是color =#...

有一个的时刻,它被认为是评论(按照您的代码),这就是为什么您有无效的语法错误。

解决方案:

将相同的内容放在字符串(color ='#00ff00')或使用0x而不是color = 0x00ff00)

Your color was color=#....

The moment there is a #, it is considered to be a comment (as per your code) and that's why you have an invalid syntax error.

Solution:

Put the same within a String (color='#00ff00') or use 0x instead of # (color=0x00ff00)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文