mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
small example fixes
This commit is contained in:
@@ -3,16 +3,22 @@
|
||||
* messages is as simple as inserting the formatting codes into the message.
|
||||
*/
|
||||
|
||||
var Discord = require( "discord.js" );
|
||||
var Discord = require( "../" );
|
||||
var myBot = new Discord.Client();
|
||||
|
||||
myBot.login( "hello@example.com", "password1" );
|
||||
|
||||
// The "ready" event is triggered after the bot successfully connected to
|
||||
// Discord and is ready to send messages.
|
||||
myBot.on( "ready", function() {
|
||||
console.log( "Bot connected successfully." );
|
||||
} );
|
||||
|
||||
myBot.on( "message", function( message ) {
|
||||
// React to all messages with the content "$formatting".
|
||||
if ( message.content === "$formatting" ) {
|
||||
// Show off formatting by sending a simple message with formatting codes.
|
||||
myBot.sendMessage( message.channel, "**bold** ****semibold**** *italic* " +
|
||||
this.sendMessage( message.channel, "**bold** ****semibold**** *italic* " +
|
||||
"_**bold and italic**_ __underline__ ~~strikethrough~~" );
|
||||
}
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user