mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
18 lines
584 B
JavaScript
18 lines
584 B
JavaScript
/*
|
|
* Discord uses a subset of Markdown for formatting, so adding formatting to
|
|
* messages is as simple as inserting the formatting codes into the message.
|
|
*/
|
|
|
|
var Discord = require( "discord.js" );
|
|
var myBot = new Discord.Client();
|
|
|
|
myBot.login( "hello@example.com", "password1" );
|
|
|
|
myBot.on( "message", function( message ) {
|
|
// React to all messages with the content "$formatting".
|
|
if ( message.content === "$formatting" ) {
|
|
myBot.sendMessage( message.channel, "**bold** ****semibold**** *italic* " +
|
|
"_**bold and italic**_ __underline__ ~~strikethrough~~")
|
|
}
|
|
} );
|