我在discord.py中制作一个不符合的机器
这是我的主要嵌入式代码
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的颜色是
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 use0x
instead of#
(color=0x00ff00
)