How to add color to messages in Discord

While one of the most one-sided discussions on Discord may be the choice between dark and light themes, color-based customization doesn’t go far beyond that choice and setting your own role colors.

However, Discord does support markdowns. If you’re not familiar with markup, it’s simple character-based formatting that you apply to your messages to add effects like bold and italics.

Of all the markups that Discord supports, code blocks may be the most versatile. You don’t have to be a programmer to use code blocks, and many users don’t know that these blocks actually allow users to add color to their text.

Confused? In this article, let’s talk about code blocks and how you can use them to create colorful Discord messages.

What are code blocks on Discord?

Code blocks, sometimes called code blocks or simply blocks, are a form of markup supported by Discord’s rendering engine.

If you’re not sure what markup is, some of the more common techniques are to surround text with single asterisks (*like this*) to italicize text, or double asterisks (**like this**) for bold text.

Discord supports markup for these, as well as underscores (__like this__), strikethroughs (~~yes~~), spoiler tags (||yes||), quotation marks (> like this), and single-line blocks of code (`like this`) .

However, along with single-line code blocks, Discord also supports multi-line code blocks. The single-line block of code adds a dark background to white monospaced text, making it easy for Discord users to share short snippets of code in a readable format. Multiline code blocks allow users to share more complex code that spans multiple lines.

To create a multi-line block of code, surround the text with triple backticks (“`like this”). It will create a large dark square around your text, format it in a monospaced font, and preserve all indentation.

One thing that really sets multiline code blocks apart from other markups is that they support syntax highlighting.

What is syntax highlighting in code blocks on Discord?

Syntax highlighting is a feature commonly found in text editors and notepad alternatives such as Notepad++ and Sublime Text. It allows programmers to define the programming language of a document so that important code elements are colored for easier reading and understanding.

Since Discord’s multiline code block markup is meant to be used for this purpose, there are clever ways you can use it to add color to your messages.

To add syntax highlighting to blocks of multiline code, you need to enter the keyword after the first set of triple backslashes. Here is an example:

“`md

is a keyword for formatting blocks of code with basic markup.

< Інше підсвічування синтаксису включає JSON і Python. >“`

If you write a message on Discord, it will look like this:

Knowing which formatting styles emphasize which colors is just a shot in the dark unless you have a guide that covers them all, which we do.

Discord code syntax highlighting styles

Below is a list of all known syntax highlighting keywords supported by Discord’s multiline code block markup.

asciidocus

automatic hotkey

shock

coffeescript

cpp

cs

css

diff

to fix

glsl

it

json

md

Jr

prologue

py

xl

xml

Discord may continue to add new syntax highlighting options over time.

While using Discord’s syntax highlighting might not be as clean as being able to simply change the color of the text, it’s still very useful and the best solution available for creating colorful Discord messages.

There are many options, so if you ever have a large piece of text that needs to be formatted for easier reading, such as a list of commands for your Discord music bot, be sure to try code blocking.

Leave a Reply

Your email address will not be published.