mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Small docs changes for consistency (#617)
This commit is contained in:
committed by
GitHub
parent
910f47240d
commit
6bfad00229
@@ -29,19 +29,19 @@ discord.js will automatically prefer node-opus over opusscript.
|
||||
## Example Usage
|
||||
```js
|
||||
const Discord = require('discord.js');
|
||||
const bot = new Discord.Client();
|
||||
const client = new Discord.Client();
|
||||
|
||||
bot.on('ready', () => {
|
||||
client.on('ready', () => {
|
||||
console.log('I am ready!');
|
||||
});
|
||||
|
||||
bot.on('message', message => {
|
||||
client.on('message', message => {
|
||||
if (message.content === 'ping') {
|
||||
message.reply('pong');
|
||||
}
|
||||
});
|
||||
|
||||
bot.login('your token');
|
||||
client.login('your token');
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
@@ -31,13 +31,13 @@ Version 9.0 eschews callbacks in favour of Promises. This means all code relying
|
||||
For example, the following code:
|
||||
|
||||
```js
|
||||
bot.getChannelLogs(channel, 100, function(messages) {
|
||||
client.getChannelLogs(channel, 100, function(messages) {
|
||||
console.log(`${messages.length} messages found`);
|
||||
});
|
||||
```
|
||||
|
||||
```js
|
||||
msg.channel.fetchMessages({limit: 100}).then(messages => {
|
||||
channel.fetchMessages({limit: 100}).then(messages => {
|
||||
console.log(`${messages.size} messages found`);
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user