Update documentation

This commit is contained in:
Schuyler Cebulskie
2016-09-07 02:24:25 -04:00
parent 818649b94f
commit bc09da9a35
4 changed files with 32 additions and 22 deletions

View File

@@ -1,12 +1,9 @@
# About Version 9.0
The 9.0 rewrite takes a much more OOP approach than previous versions, which allows code to be much more manageable.
# About Version 9
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
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
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.
@@ -27,7 +24,7 @@ A couple more important details:
* `Client.servers.length` ==> `client.guilds.size` (all instances of `server` are now `guild`)
## 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:
```js

View File

@@ -12,20 +12,35 @@
[![NPM](https://nodei.co/npm/discord.js.png?downloads=true&stars=true)](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 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.
## Installation
**Requires node 6.0.0 and above**
```bash
npm install --save discord.js
# or, if you don't want voice support:
npm install --save --no-optional discord.js
```
**Node.js 6.0.0 or newer is required.**
With voice support: `npm install --save discord.js --production`
Without voice support: `npm install --save discord.js --production --no-optional`
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).
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