mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +00:00
Update readme example to use loginWithToken
This commit is contained in:
parent
283c99dee8
commit
907f4f4b27
1 changed files with 6 additions and 4 deletions
10
README.md
10
README.md
|
|
@ -7,7 +7,7 @@
|
||||||
[](https://travis-ci.org/hydrabolt/discord.js) [](http://discordjs.readthedocs.org/en/latest/?badge=latest)
|
[](https://travis-ci.org/hydrabolt/discord.js) [](http://discordjs.readthedocs.org/en/latest/?badge=latest)
|
||||||
|
|
||||||
[](https://nodei.co/npm/discord.js/)
|
[](https://nodei.co/npm/discord.js/)
|
||||||
|
|
||||||
|
|
||||||
discord.js is a node module used as a way of interfacing with [Discord](https://discordapp.com/). It is a very useful module for creating bots.
|
discord.js is a node module used as a way of interfacing with [Discord](https://discordapp.com/). It is a very useful module for creating bots.
|
||||||
|
|
||||||
|
|
@ -29,12 +29,14 @@ var Discord = require("discord.js");
|
||||||
|
|
||||||
var mybot = new Discord.Client();
|
var mybot = new Discord.Client();
|
||||||
|
|
||||||
mybot.on("message", function(message){
|
mybot.on("message", function(message) {
|
||||||
if(message.content === "ping")
|
if(message.content === "ping") {
|
||||||
mybot.reply(message, "pong");
|
mybot.reply(message, "pong");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mybot.login("email", "password");
|
mybot.loginWithToken("token");
|
||||||
|
// If you still need to login with email and password, use mybot.login("email", "password");
|
||||||
```
|
```
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue