mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Update documentation
This commit is contained in:
10
README.md
10
README.md
@@ -15,12 +15,9 @@
|
|||||||
discord.js is a powerful node.js module that allows you to interact with the [Discord API](https://discordapp.com/developers/docs/intro).
|
discord.js is a powerful node.js module that allows you to interact with the [Discord API](https://discordapp.com/developers/docs/intro).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
**Requires node 6.0.0 and above**
|
**Node.js 6.0.0 or newer is required.**
|
||||||
```bash
|
With voice support: `npm install --save discord.js --production`
|
||||||
npm install --save discord.js
|
Without voice support: `npm install --save discord.js --production --no-optional`
|
||||||
# or, if you don't want voice support:
|
|
||||||
npm install --save --no-optional discord.js
|
|
||||||
```
|
|
||||||
|
|
||||||
By default, discord.js uses [opusscript](https://www.npmjs.com/package/opusscript) when playing audio over voice connections.
|
By default, discord.js uses [opusscript](https://www.npmjs.com/package/opusscript) when playing audio over voice connections.
|
||||||
If you're looking to play over multiple voice connections, it might be better to install [node-opus](https://www.npmjs.com/package/node-opus).
|
If you're looking to play over multiple voice connections, it might be better to install [node-opus](https://www.npmjs.com/package/node-opus).
|
||||||
@@ -46,6 +43,7 @@ client.login('your token');
|
|||||||
|
|
||||||
## Links
|
## Links
|
||||||
* [Website](http://hydrabolt.github.io/discord.js/)
|
* [Website](http://hydrabolt.github.io/discord.js/)
|
||||||
|
* [Discord Server](https://discord.gg/bRCvFy9)
|
||||||
* [Documentation](http://hydrabolt.github.io/discord.js/#!/docs/tag/master)
|
* [Documentation](http://hydrabolt.github.io/discord.js/#!/docs/tag/master)
|
||||||
* [Legacy Documentation](http://discordjs.readthedocs.io/en/8.1.0/docs_client.html)
|
* [Legacy Documentation](http://discordjs.readthedocs.io/en/8.1.0/docs_client.html)
|
||||||
* [GitHub](https://github.com/hydrabolt/discord.js)
|
* [GitHub](https://github.com/hydrabolt/discord.js)
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
# About Version 9.0
|
# About Version 9
|
||||||
The 9.0 rewrite takes a much more OOP approach than previous versions, which allows code to be much more manageable.
|
The version 9 (v9) rewrite takes a much more object-oriented approach than previous versions,
|
||||||
|
which allows your code to be much more readable and manageable.
|
||||||
It's been rebuilt from the ground up and should be much more stable, fixing caching issues that affected
|
It's been rebuilt from the ground up and should be much more stable, fixing caching issues that affected
|
||||||
older versions. It also has support for newer Discord Features, such as emojis.
|
older versions. It also has support for newer Discord Features, such as emojis.
|
||||||
|
|
||||||
## Guides
|
|
||||||
* [York's v9 upgrade guide](https://yorkaargh.wordpress.com/2016/09/03/updating-discord-js-bots/)
|
|
||||||
* [LuckyEvie's general bot guide (being updated)](https://eslachance.gitbooks.io/discord-js-bot-guide/content/)
|
|
||||||
|
|
||||||
## Upgrading your code
|
## Upgrading your code
|
||||||
Version 9, while containing a sizable number of breaking changes, does not require much change in your code's logic -
|
Version 9, while containing a sizable number of breaking changes, does not require much change in your code's logic -
|
||||||
most of the concepts are still the same, but loads of functions have been moved around.
|
most of the concepts are still the same, but loads of functions have been moved around.
|
||||||
@@ -27,7 +24,7 @@ A couple more important details:
|
|||||||
* `Client.servers.length` ==> `client.guilds.size` (all instances of `server` are now `guild`)
|
* `Client.servers.length` ==> `client.guilds.size` (all instances of `server` are now `guild`)
|
||||||
|
|
||||||
## Callbacks
|
## Callbacks
|
||||||
Version 9.0 eschews callbacks in favour of Promises. This means all code relying on callbacks must be changed.
|
Version 9 eschews callbacks in favour of Promises. This means all code relying on callbacks must be changed.
|
||||||
For example, the following code:
|
For example, the following code:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
@@ -12,20 +12,35 @@
|
|||||||
|
|
||||||
[](https://nodei.co/npm/discord.js/)
|
[](https://nodei.co/npm/discord.js/)
|
||||||
|
|
||||||
discord.js is a a powerful node.js module that allows you to interact with the [Discord API](https://discordapp.com/developers/docs/intro).
|
discord.js is a powerful node.js module that allows you to interact with the [Discord API](https://discordapp.com/developers/docs/intro).
|
||||||
|
|
||||||
# Welcome!
|
# Welcome!
|
||||||
Welcome to the discord.js rewrite documentation. The rewrite has taken a lot of time, but it should be much more
|
Welcome to the discord.js v9 documentation. The v9 rewrite has taken a lot of time, but it should be much more
|
||||||
stable and performant than previous versions.
|
stable and performant than previous versions.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
**Requires node 6.0.0 and above**
|
**Node.js 6.0.0 or newer is required.**
|
||||||
```bash
|
With voice support: `npm install --save discord.js --production`
|
||||||
npm install --save discord.js
|
Without voice support: `npm install --save discord.js --production --no-optional`
|
||||||
# or, if you don't want voice support:
|
|
||||||
npm install --save --no-optional discord.js
|
|
||||||
```
|
|
||||||
|
|
||||||
By default, discord.js uses [opusscript](https://www.npmjs.com/package/opusscript) when playing audio over voice connections.
|
By default, discord.js uses [opusscript](https://www.npmjs.com/package/opusscript) when playing audio over voice connections.
|
||||||
If you're looking to play over multiple voice connections, it might be better to install [node-opus](https://www.npmjs.com/package/node-opus).
|
If you're looking to play over multiple voice connections, it might be better to install [node-opus](https://www.npmjs.com/package/node-opus).
|
||||||
discord.js will automatically prefer node-opus over opusscript.
|
discord.js will automatically prefer node-opus over opusscript.
|
||||||
|
|
||||||
|
## Guides
|
||||||
|
* [LuckyEvie's general guide](https://eslachance.gitbooks.io/discord-js-bot-guide/content/)
|
||||||
|
* [York's v9 upgrade guide](https://yorkaargh.wordpress.com/2016/09/03/updating-discord-js-bots/)
|
||||||
|
|
||||||
|
## Links
|
||||||
|
* [Website](http://hydrabolt.github.io/discord.js/)
|
||||||
|
* [Discord Server](https://discord.gg/bRCvFy9)
|
||||||
|
* [Documentation](http://hydrabolt.github.io/discord.js/#!/docs/tag/master)
|
||||||
|
* [Legacy Documentation](http://discordjs.readthedocs.io/en/8.1.0/docs_client.html)
|
||||||
|
* [GitHub](https://github.com/hydrabolt/discord.js)
|
||||||
|
* [NPM](https://www.npmjs.com/package/discord.js)
|
||||||
|
* [Examples](https://github.com/hydrabolt/discord.js/tree/master/docs/custom/examples)
|
||||||
|
* [Related Libraries](https://discordapi.com/unofficial/libs.html)
|
||||||
|
|
||||||
|
## Help
|
||||||
|
If you don't understand something in this documentation, you are experiencing problems, or you just need a gentle
|
||||||
|
nudge in the right direction, please don't hesitate to join our official [Discord.js Server](https://discord.gg/bRCvFy9).
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user