简体   繁体   中英

Change Color on discord.js embed text

Is there a way to change the color of text for certain sections of a discord.js embed?

  .setColor('#0099ff')
    .setTitle('~__Command Hewp__~')
  .addFields(
    { name: `**${prefix + 'help'}**`, value: `Usage: ${prefix + 'help'}` },
    { name: `${prefix + 'purge'}`, value: `Usage: ${prefix + 'purge'} <# of Messages, max 100>` },
    { name: `${prefix + 'kick'}`, value: `Usage: ${prefix + 'kick'} <target user>` },
    { name: `${prefix + 'ban'}`, value: `Usage: ${prefix + 'ban'} <target user>` },
     );
     message.channel.send(help)```

Unfortunately, Discord does not support changing the color of text. The only option is to use code blocks in field.value , but it doesn't look very good.

You can change the color of the response text message by formatting it in certain ways.

Here's the detailed breakdown of the formats

```arm
Orange
```

```fix
Yellow
```

```yaml
Cyan
```

```md
# Blue
```

```diff
- This is red
```

```
Grey
```

Remember to use - to start the text in diff and # for md

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM