css коды для дискорд
FrachlitzStudio / DiscordMarkdownRUS.md
Discord Markdown [ENG] [RUS]
Как использовать markdown в Discord’e, чтобы сделать текст более красивым?
Последнее обновление: 17.10.20
Пример | Маркировка |
---|---|
Наклонённый | *Наклонённый* или _Наклонённый_ |
Жирный | **Жирный** |
Зачёркнутый | |
П͟о͟д͟ч͟ё͟р͟к͟н͟у͟т͟ы͟й͟ | __Подчёркнутый__ |
Всё это можно комбинировать друг с другом:
Наклонённый, Жирный и Зачёркнутый :
_**Наклонённый, Жирный и Зачёркнутый**_
Чтобы спрятать какой-то текст перед нажатием на него, следует записать нужную фразу между ||
Чтобы процитировать чьё-либо сообщение, нужно нажать на него ПКМ и кликнуть на соответствующую кнопку. Или же можно это сделать самому:
Можно писать блоки кода прямо в Discord’e.
Однострочный Блок Кода
Нужно записать текст между «`»:
Однострочные блоки кода можно комбинировать со шрифтами:
Многострочный Блок Кода
Чтобы сделать многострочный блок кода, нужно поставить ««`» в начале и конце:
Многострочные блоки кода также можно комбинировать со шрифтами:
«Цветной» Многострочный Блок Кода
Используя синтаксис различных языков программирования, можно делать разноцветный текст:
Существует намного больше примеров, но, как мне кажется, никто не будет их использовать, т. к. они выглядят не очень красиво.
Если нужно убрать markdown, следует поставить \ перед символами:
Чтобы убрать embed часть сообщения (видео-плеер от YouTube, заголовок и часть статьи с блога и т. п.), нужно писать ссылку между > :
Существуют способы, как принудительно упомянуть канал/роль/пользователя. И не важно, что юзер не присутствует на сервере или канал находится на другом.
Для всех методов следует включить Режим разработчика в настройках Внешнего вида.
Чтобы упомянуть роль, не имея на это прав, следует:
Чтобы упомянуть пользователя, которого нет на сервере/у которого нет прав перебывать в канале, следует:
Чтобы принудительно упомянуть канал (если нет доступа или нужно перенаправить в канал на другом сервере), следует:
Чтобы вставить эмодзи где-угодно (например, в заголовок канала), следует:
Чтобы указать какую-то дату и время (это может быть полезно для ботов), следует:
Скачать и установить Темы для Дискорда
Темы для Дискорда — специальный CSS-код, позволяющий изменить внешний вид программы с учетом собственных предпочтений. Сложность в том, что просто скачать данные и просто изменить оформление не получится. Здесь существуют обходные пути, на которых подробнее остановимся в статье.
Какие бывают
Для начала отметим, что themes for Discord бывают двух типов — для программы и веб-версии приложения. В обоих случаях действуют индивидуальные подходы по изменению внешнего вида. При этом переместить интересующую тему и активировать ее в Дискорд одним нажатием кнопки не получится.
Чтобы поставить новую тему, придется установить специальное приложение-плагин, позволяющее создавать и добавлять такие инструменты в Discord. Кроме того, необходимо копировать и добавить CSS-код в специальное поле.
Как поставить тему для Дискорда: пошаговая инструкция
Самый просто способ поменять оформление — воспользоваться программой Better Discord. Ее легко скачать на многих ресурсах, но лучше это делать на официальном сайте. С помощью софта можно добавлять свои темы, ставить разные плагины, внедрять дополнительные наборы смайлов и т. д.
Алгоритм действий имеет следующие вид (рассмотрим на примере темы Metro):
Выбранная тема активируется в Дискорде в автоматическом режиме. В дальнейшем можно поменять оформление, следуя такому же алгоритму. По аналогичному алгоритму можно устанавливать и другие theme для Discord, которые легко найти в Сети.
Как установить тему для Дискорд в веб-версии
Даже после установки Discord на ПК многие продолжает его применять в браузере. Если вы относитесь к этой категории, можно установить новое оформление для своей веб-версии. Алгоритм действий имеет следующий вид:
Если все сделать правильно, обои и оформление веб-версии должны поменяться. Если никаких изменений не произошло, возможно, причина в действии антивирусного ПО, блокирующего работу расширений. В таком случае попробуйте отключить антивирусную программу и повторите попытку.
Как создать свою тему
Многие интересуются, как сделать свою тему в Дискорд, и насколько это реально. Для этого можно использовать программу, о которой упоминалось выше — Better Discord. Сложность в том, что для создания индивидуального стиля необходимо иметь навыки CSS-верстки. Без наличия этих знаний любые попытки обречены на провал. Но опытные верстальщики могут с легкостью сделать собственную тему для Дискорд.
Общий алгоритм такой:
Если CSS-код написан корректно, программа преображается и получает новый интерфейс. При это можно сделать оформление в любом стиле, будь это anime, классика или любой другой. Здесь можно проявить фантазию и сделать тему для Дискорда «под себя».
Итоги
В распоряжении пользователей два способа, как изменить тематику в Discord — написать CSS-код самостоятельно или воспользоваться уже годовыми наработками. В обоих случаях необходимо скачать и установить программу Better Discord, без которой внесение изменений невозможно. Далее остается войти в раздел Custom CSS, после чего добавить собственный или уже готовый код. При копировании этих данных будьте осторожны, ведь изменение или случайное удаление одного символа может поломать всю структуру.
Как изменить цвет текста в Discord
В этой статье мы покажем вам, как выделить жирным шрифтом текстовые чаты Discord.
Как это работает
Ключ к этому методу добавления цвета к тексту заключается в том, что Discord использует Javascript для создания своих интерфейсов вместе с темой, известной как Solarized Dark, и библиотекой под названием highlight.js.
То есть, когда вы вошли на свой сервер Discord, страница, которую вы видите, отображается с помощью ряда довольно сложных программ Javascript, включая highlight.js.
Хотя собственный пользовательский интерфейс Discord не поддерживает раскрашивание текста, базовый движок Javascript, запускающий сценарий highlight.js, поддерживает. Вставляя фрагменты кода в текстовый чат, вы можете изменить цвет слов, выводимых в окно текстового чата для всех.
Основная концепция, которую следует понять, заключается в том, что для изменения цвета данного фрагмента текста вам необходимо инкапсулировать этот текст в блок кода. Это трехстрочный блок текста с вашим текстом в качестве среднего блока.
Использование символа «обратной кавычки»
Чтобы закрасить любой текст в Discord, вам нужно использовать символ обратной кавычки, расположенный в верхнем левом углу клавиатуры. Он сопровождает символ тильды:
Напишите первую строку кода
Первая строка блока кода должна состоять из трех символов обратной кавычки («»), за которыми следует кодовая фраза, которая сообщает теме Solarized Dark, какой цвет отображать. Должно получиться так:
Примечание: «CSS» может измениться на что-то вроде «Tex» или другую фразу в зависимости от желаемого результата. Мы расскажем об этом ниже.
Введите вторую строку
Во второй строке должен быть ваш текст, набранный как обычно. Удерживайте «Shift + Enter», чтобы создать новую строку. Одно только нажатие на кнопку «Ввод» отправит сообщение, поэтому вам придется удерживать нажатой клавишу «Shift».
Введите третью строку
В третьей строке блока кода должны быть еще три обратных кавычки: («`). Это редко меняется, независимо от ожидаемого результата, и должно выглядеть так:
Поскольку мы использовали «` CSS, ваш текст должен выглядеть так:
Ввод текста
Есть два основных способа ввода текста таким образом. Первый способ – иметь на вашем компьютере текстовый файл с различными кодами для разных цветов текста, к которым вы можете получить доступ таким образом, и вырезать и вставить сегменты, которые вы хотите использовать.
Другой способ – напрямую ввести блок кода в движок чата Discord построчно. Введите одну строку, затем нажмите «Shift-Enter», чтобы создать другую строку, не отправляя сообщение в Discord. Введите вторую строку и снова нажмите Shift-Enter. Затем введите третью строку и нажмите Enter, и весь блок будет отправлен сразу и отобразит ваш текст.
У этого метода есть некоторые ограничения. Во-первых, вы должны сделать это для каждой строки текста, которую хотите раскрасить – вы не можете просто включить или выключить цвет. Во-вторых, ваш текст появится в поле на сервере Discord.
Статья будет состоять из предыстории, подготовительного этапа, написания логики и переноса бота на удаленный сервер.
Надеюсь, данная статья поможет многим начинающим.
Предыстория
Все началось в одну бессонную осеннюю ночь, которую я проводил на Discord – сервере. Так как я относительно недавно к нему присоединился, я стал его изучать вдоль и поперёк. Обнаружив текстовый канал «Вакансии», я заинтересовался, открыл его, и отыскал среди не интересующих меня предложений, это:
«Программист (разработчик бота)
Требования:
Подготовительный этап
Discrod
Прежде, чем приступить к написанию нашего бота, его необходимо создать для Discord. Вам необходимо:
Также, необходимо создать приложение в Wargaming, чтобы получить доступ к API Wargaming. Тут тоже все просто:
Тут уже имеется свобода выбора. Кто-то использует Visual Studio, кто-то Rider, кто-то вообще мощный, и пишет код в Vim (все же настоящие программисты используют только клавиатуру, верно?). Однако, чтобы не реализовывать Discord API, можно использовать неофициальную библиотеку для C# “DSharpPlus”. Его можно установить либо из NuGet, либо самому собрав исходники с репозитория.
Инструкция для Visual Studio
Подготовительный этап окончен, можно переходить к написанию бота.
Написание логики
Всю логику приложения рассматривать не будем, я лишь покажу, как работать с перехватом сообщений ботом, и как работать с Wargaming API.
Работа с Discord бот происходит через функцию static async Task MainTask(string[] args);
Чтобы вызвать данную функцию, в Main необходимо прописать
Далее, вам необходимо инициализировать своего бота:
Где token – токен вашего бота.
Потом, через лямбду, прописываем необходимые команды, которые должен выполнять бот:
Где e.Author.Username – получение никнейма пользователя.
Таким образом, когда вы отправите любое сообщение, которое начинается с &, бот будет приветствовать вас.
В конце данной функции, необходимо прописать await discord.ConnectAsync(); и await Task.Delay(-1);
Это позволит выполнять команды на фоне, не занимая основной поток.
Теперь необходимо разобраться с Wargaming API. Тут все просто – пишете CURL-запросы, получаете ответ в виде JSON – строки, вытягиваете оттуда необходимые данные и делаете над ними манипуляции.
Внимание! Все токены и ID приложений хранить в открытом виде строго не рекомендуется! Как минимум – Discord банит такие токены, когда они попадают во всемирную сеть, как максимум – бот начинает пользоваться злоумышленниками.
Деплой на VPS – сервер
После того, как вы закончили с ботом, его необходимо разместить на сервере, который постоянно работает 24/7. Это связанно с тем, что когда работает ваше приложение, то работает и бот. Как только вы выключаете приложение, засыпает и ваш бот.
Много VPS серверов существует на этом свете, как на Windows, так и на Linux, однако в большинстве случаев, на Linux в разы дешевле размещать.
На Discord – сервере мне посоветовали vscale.io, и я тут же создал на нем виртуальный сервер на Ubuntu и залил бота. Я не буду описывать, как работает данный сайт, а сразу перейду к настройки бота.
Далее, вам необходимо залить бота на Git – сервис, вроде GitHub и ему подобные и склонировать на VPS — сервер, или, другими путями скачать вашего бота. Учтите, что у вас будет только консоль, GUI не будет. Совсем.
После того, как вы скачали вашего бота, вам необходимо его запустить. Для этого, вам необходимо:
Выводы
Я рад, что я взялся за это задание. Это был мой первый опыт разработки бота, и рад, что получил новые знания по C#, и работе с Linux.
Discord Text Formatting Guide: Colors, Bold, Italic, Strikethrough
Learn the basics behind Discord’s formatting engine, basic formatting commands (bolding, italicizing, underlining), and color formatting techniques.
Last Updated 8/16/2019: We included an extra “Markdown Text 101” section with three awesome resources to take your Markdown knowledge even further. You’ll also find a new section on chat formatting when using international keyboard layouts. Added several “quality of life” updates to this guide.
From humble beginnings on Discord…
I was a complete newbie back then when I joined my first Discord channel.
People were typing in underlines, bolded letters, strikethrough text, italics, and even colors! “How in the world do people type in colors?!”, I thought.
I tried to type “/bold hello guys!”, but that obviously didn’t work. It just made it obvious I had no clue what I was doing.
You Can Learn Awesome Discord Formatting
If you’re reading this, you’ve probably been that guy or gal (or you’re trying to avoid all the disappointment and become a Discord formatting wiz!)
DISCORD FORMATTING GUIDE PDF:
Click here to get a PDF copy of this guide that transfers over to your smartphone, tablet, laptop, or any other media!
Either way, today I’m going to show you how to type out literally every single format Discord offers.
You’ll learn the basics behind Discord’s formatting engine (Markdown & Highlight.js), basic formatting commands (bolding, italicizing, underlining, etc.), and you’ll learn how to type out text in boxes and code blocks — in color!
Save This Page as a Reference
Once you have the basics down Discord formatting isn’t too bad.
While you’re still learning the commands though, it may be a good idea to keep this page open for reference (or bookmarked).
Anyways, enough talk — let’s get formatting!
Behind the Scenes: Discord’s Text Formatting Engine
While we sit there chatting away on Discord day after day, there’s a sleek, lightweight engine working in the background, formatting all of our text.
This “engine” is called Markdown.
The Rundown on Markdown
Originally created in 2004 by John Gruber and Aaron Swartz, Markdown is a markup language designed to be lightweight and simple to read/write. It’s completely text-based and uses cleverly placed symbols to format words in bold, italics, underlined, etc.
Although it’s been most commonly used to format readme files, forum discussions, and to turn plain text into rich text in basic text editors, Discord’s developers saw its potential and brought it into the core software.
We’re going to dig into Discord Markdown in the next section so you can learn how to properly format all of your messages in any way you’d like.
Highlight.js Makes Color Possible
Before we dig into markdown I wanted to explain another neat feature the Discord developers added on. It’s a library called Highlight.js.
Now, I want to make it clear that Discord doesn’t have true full-text highlighting. You can’t say, “I want this word to be in red, and this one to be in blue!”. That kind of highlighting doesn’t exist.
What does exist for our text-coloring purposes, though, is a “hacked” version of text highlighting using syntax coloring methods from highlight.js.
Even though we can’t directly highlight text, we can create a code block in discord, point it towards a specific syntax highlighting profile included in highlight.js, and then use that to our advantage by wrapping our text in the appropriate symbols.
This will all make much more sense when we get to some juicy examples down below.
Remember This Going Forward
You don’t have to remember all those nitty-gritty details. For now, all you have to know is that Discord uses Markdown for its text formatting, and Highlight.js for code block highlighting.
I’ll show you how to take advantage of these formatting options in the next section.
How to Format Text in Discord
And now the fun begins. I’m going to show you how to bold, italicize, underline, and strikethrough text as a starting point.
We’ll start with the basics, and then move on into creating code blocks for text coloring.
How to Bold Text in Discord
To create bolded text in discord, all you have to do is start and end the bolded text with two asterisks (*).
The asterisk is SHIFT+8 on your keyboard.
If you look at the image below, you’ll notice that I put two asterisks, or stars, in front of and after the text I wanted to be in bold.
Here’s what I typed and the result it produced:
How to Italicize Text (Create Slanted Italics) in Discord
To create italics or italicized text in Discord, you have to type the asterisk once again, but this time use only one asterisk.
To bold text, we used two asterisks, like this: **bold text**
For italics, we would do the same thing but with one single asterisk: *italicized text*
Again, the asterisk (star) is SHIFT+8 on your keyboard.
Here’s what I typed to get the result shown in the image below:
How to Create Bold Italicized Text in Discord (Bold + Italics)
You might’ve been able to guess the markdown for Bold + Italics by now…
Instead of only one or two asterisks, it’s three asterisks.
How to Underline Text in Discord
To format our text as underlined, we need two use two underscores (__)
This is meant to be a thorough guide, so I’m including the keyboard layout for an underscore below (in case you’re reading this and have never yet had to type an underscore before!):
I typed this to get the result below:
How to Create Strikethrough Text in Discord
For strikethrough text, we need to use the tilde (
Two tildes cross out, or ‘strike through’, the text you type.
Here’s the keyboard layout (yellow highlighted keys) for typing a tilde. You have to hit SHIFT +
Here’s what I typed below:
Formatting on International Keyboard Layouts
A reader recently pointed out that international keyboard layouts should be considered as well. Here we make the assumption of the asterisk being “Shift + 8” and the tilde being “Shift + Backtick (`)”, but this isn’t always the case.
Here are some additional keyboard layouts that international users might encounter, and an example of where the asterisk would be on each of these layouts.
German: Shift+[+] (key right of Ü)
Spanish: Shift+[+] (key right of `^ (Spain) or ´¨ (Latin America))
French (France): * (key right of ù%)
French (Belgium): Shift+$ (key right of ^¨)
French (Switzerland): Shift+3
Italian: Shift+[+] (key right of èé)
Swedish: Shift+’ (key right of Ä)
If you find yourself using one of these alternative keyboard layouts, feel free to adjust accordingly.
A vast majority of users typically use the standard English keyboard (which is why we accommodated it by default), but we wanted to acknowledge alternative layouts and that all of this can be done no matter what your layout is.
Combining Text Formatting Options Even Further
We can also combine the underline into bold, italics, and bold+italics.
Underlined and Italicized Text
Underlined and Bolded Text
Underlined, Italicized, and Bolded Text
How to ‘Escape’ Text and See All Your Underscores and Asterisks
In case you actually want to see your underscores or asterisks in a message (like in an emoji, for example), you can use the backslash ‘\’ key to skip markdown formatting and show the text just like it is.
Take a peek at the example below (notice the backslashes ‘\’ at the beginning of each character).
The excessive backslashes are needed here because I have underscores in my message.
But notice that the backslashes at the end actually aren’t required if you have them all in the beginning:
If I didn’t have underscores, a single backslash ‘\’ would do:
That Concludes Basic Formatting
And that’s it for basic formatting. It’s pretty simple stuff, and you should have it down after a few messages.
The only keys you have to remember are Underscores, Asterisks (Stars), and Backslashes.
Advanced Text Formatting in Discord: Writing in Color
And now we get to the fun part… formatting our discord messages in color!
Once you start getting some colorful messages out there in the channels you frequently visit, you’ll start getting asked how it’s done.
We’re going to cover some basics (code blocks), and then jump right into coloring your messages! Let’s get to it!
Single Line Code Blocks in Discord
To create a single line code block in discord, you need to use the ‘tick’ or ‘backtick’ character: `.
Since this key can be a difficult key to find if you’ve never had to use it before (up until this point), I included a nice highlighted keyboard layout diagram below:
The ‘tick’ or ‘backtick’ character should be in the upper left corner of your keyboard right under the escape (ESC) key.
Once you’re familiar with the ‘backtick’ key, let’s create a single line code block. All you have to do is put a single backtick before and after your text.
Here’s what I wrote for the example below:
Multiple Line (Multiline) Code Blocks in Discord
Just like the single line code block, multi-line code blocks also use the backtick (“`) character. The only difference is, instead of writing a single backtick (`) you have to write three (“`) before and after your text.
The neat thing here is that you can press enter and space your text across multiple lines, all formatted in a single multi-line code block.
Here’s the markdown for the example below:
You’ll notice in the image above that we have all of our text in a code block, but this time it’s in multiple lines just like we wanted.
How to Format Colored Text in Discord
And now the moment we’ve all been waiting for… [drumroll] … Colored Text!
I was searching around the web for a good example of some colored text formatting in Discord, but couldn’t find anything clear.
There were some examples, but they were pretty hazy. I couldn’t find a single guide that clearly showed you how to format your text if you wanted it to be in a certain color.
We’re Essentially Hacking Syntax Highlighting
As I mentioned in the intro, what we’re going to be doing here is ‘hacking’ or ‘hijacking’ syntax highlighting from Highlight.js running in the background in Discord.
We have to do this because, as of writing this, Discord doesn’t have built-in text highlighting functions.
As a result, we’ll have to do a little bit of a workaround — but as long as it works, it works!
Here’s How Text Coloring in Discord Works
Since we’ll be using a workaround based on Highlight.js, here’s how it’s going to work.
We will be creating multiline code blocks using three backticks and specifying the syntax highlighting language.
We can do this by including the highlighting programming language reference right at the beginning of the multiline code block.
Just like this, for example. Here we are specifying ‘Apache’ as the syntax highlighting language:
We’ll be “exploiting” some syntax highlighting and using it to our advantage for coloring some text.
I included most of the colors you’d expect to use below, and tried to show the differences between various language references.
Limitations to this Text Coloring Method
There are (unfortunately) limitations to this method. The most common limitation being, your text has to be connected in one word in some referenced syntax highlighting languages (not all!).
This means you can’t type: This is a sentence.
You’ll have to type: This_is_a_sentence OR Thisisasentence.
Why is this? Well, since we’re exploiting syntax highlighting to highlight our Discord messages, we’re basically trying to make the multiline code block think that our message is literal programming code.
Most of the time the colors we want are contained in variables, which by definition, can’t contain any spaces.
One place this does work well is in code comments and strings. I tried to include code comments and strings in each of the colors below as frequently as possible (to make it easy to type out).
If you look closely, you’ll notice I did include some variables and mentioned that you can’t have spaces if you choose to use those formatting methods. Even then, this may still be a perfectly viable method for single words.
Anyways, that’s enough yapping from me — let’s get coloring!
How to Color Text RED in Discord
Diff Syntax Highlighting for Red (EASY)
Include dashes (-) before the line you want red colored text.
CSS Syntax Highlighting for Orange (Red-Orange)
Include brackets [ ] around the text you want highlighted.
How to Color Text YELLOW in Discord
Fix Syntax Highlighting for Yellow (EASY)
In Fix, everything you type is yellow by default! This is a great, easy way to have yellow text.
Apache Syntax Highlighting for Yellow (Limitation: NO SPACES)
Include a percent sign and right curly brace, %<, at the beginning of your text, and a left curly brace, >, at the end to highlight your text yellow in Apache syntax.
How to Color Text GREEN in Discord
Diff Syntax Highlighting for Light Green (EASY)
Include a plus sign (+) before the line that you want turned green.
CSS Syntax Highlighting for Light Green
Include quotation marks ” ” around the text you want colored Light Green.
Bash Syntax Highlighting for Dark Green (EASY)
Quotation marks around your text ” “
Note: This dark green color and quotation marks around your text also works in a bunch of other reference languages, not only “bash”. It works with “coffeescript”, “cpp”, and many more.
JSON Syntax Highlighting for Dark Green (EASY)
Just like in Bash, quotation marks around the text you want to color dark green.
How to Color Text BLUE in Discord
INI Syntax Highlighting for Blue
Place brackets [ ] around the text you want highlighted blue.
CSS Syntax Highlighting (Limitation: NO SPACES)
Put a single dot (.) in front of the text you want colored blue, and make sure you don’t have any spaces in the line.
Color Formatting Takeaways
As you’ve probably noticed, there are limitations to using this method (such as having to type no spaces for certain colors).
But the most important thing is, we can still color our text relatively easily!
I’d recommend using the DIFF, BASH, FIX, and CSS highlighting above (for red, green, yellow, and blue respectively).
Either way, the examples above include several shades of the primary syntax highlighting colors, and let you experiment with them in your messages.
Markdown Text 101: Digging Deeper
If you want to dig into Discord Markdown even further and learn some more tips/tricks, then these are a few very helpful resources you can’t miss.
The Markdown Tutorial
My favorite Markdown learning resource is very simply titled “The Markdown Tutorial”. It walks you through Markdown step by step with both instructions and live output of what your text will look like. This is a neat learning tool that I’d definitely recommend diving into for some deeper learning.
The Markdown Cheatsheet
Once you’ve gone through some markdown tutorials and just want a quick reference to look back on, there’s this awesome Markdown Cheatsheet that lists every single type of formatting you’d encounter.
The Official Discord Markdown Guide
And finally, there’s the Official Markdown Guide from the Discord Team (it’s on the discordapp.com website). It covers everything we talked about in this guide (with regards to chat formatting), but it doesn’t go into as much detail about how we actually get each type of color. It can still be a very useful reference if you’re looking for a quick refresher.
Now It’s Your Turn
And now the ball is in your court — get out there and format/color some text!
Don’t forget to bookmark this page as a resource for future use. Good luck, and have fun!
Discord Bot From Scratch
Learn how to make a Discord Bot from the ground up by watching our free video course (nearly 2 hrs of video)!