問題描述
我已經搜索了網絡,但沒有找到答案.
I have searched the web but found no answer.
我為我的不和諧機器人創建了一個嵌入,我知道如何設置左側欄的顏色,但我如何更改機器人發送的文本的顏色?
I created an embed for my discord bot and i know how to set the color of the bar on the left but how can i change the color of the text the bot sends?
推薦答案
我能找到的唯一解決方案(之前也有同樣的問題)是使用語法突出顯示
The only solution I've been able to find for this (have had the same question before) was using syntax highlighting
```css
green text
```
您可以在此 github gist
希望對您有所幫助,我不知道任何其他真正顏色"的解決方案.不使用語法高亮的文本.
Hope it helps, I don't know about any other solution to really "color" texts without using syntax highlighting.
更新:關于OP的評論.
UPDATE: Regarding comment from OP.
這是我能夠將其包含到嵌入中的一種方式.
This was a way I've been able to include it into an embed.
async def test(ctx, *args):
retStr = str("""```css
This is some colored Text```""")
embed = discord.Embed(title="Random test")
embed.add_field(name="Name field can't be colored as it seems",value=retStr)
await ctx.send(embed=embed)
制作了這個:
沒有嵌入:
async def test(ctx, *args):
retStr = str("""```css
This is some colored Text```""")
await ctx.send(retStr)
制作了這個:
在您選擇的語言之后寫一個新行
很重要,否則它無法識別語言聲明
It is important to write a new line
after the language you choose for syntax highlighting otherwise it doesn't recognize it language declaration
這篇關于Discord.py(更改機器人的文本顏色)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!