Skip to content

Commit 5c6e8e9

Browse files
committed
Update d.js Client usage
1 parent aaa30ff commit 5c6e8e9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ const { DiscordCommand, DiscordEvent } = require("@medallyon/djs-framework");
1414
Before using any of the examples below, we also need to create a Discord.js Client instance, as per the [documentation](https://discord.js.org/#/docs/main/stable/general/welcome):
1515

1616
```js
17-
const { Client, Intents, Constants } = require("discord.js");
17+
const { Client, Intents } = require("discord.js");
1818

1919
// Create the client
2020
const client = new Client({
2121
// Don't forget your Intents
2222
intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ]
2323
});
24+
25+
// You can call login whenever
26+
client.login(process.env.DISCORD_TOKEN)
27+
.then(() => console.log("I'm logged in!"))
28+
.catch(console.error);
2429
```
2530

2631
### Discord Events

0 commit comments

Comments
 (0)