{"meta":{"generator":"0.6.0","format":19,"date":1482128666106},"custom":{"general":{"name":"General","files":{"faq":{"name":"FAQ","type":"md","content":"# Frequently Asked Questions\r\nThese are just questions that get asked frequently, that usually have a common resolution.\r\nIf you have issues not listed here, please ask in the [official Discord server](https://discord.gg/bRCvFy9).\r\nAlways make sure to read the documentation.\r\n\r\n## No matter what, I get `SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode`‽\r\nUpdate to Node.js 6.0.0 or newer.\r\n\r\n## I get an absurd amount of errors when installing discord.js on Windows‽\r\nThe installation still worked fine, just without `node-opus`.\r\nIf you don't need voice support, using `npm install discord.js --no-optional` will prevent these errors.\r\n\r\n## How do I get voice working?\r\n- Install FFMPEG.\r\n- Optionally, set up `node-opus`, which is much faster than the default `opusscript`.\r\n\r\n## How do I install FFMPEG?\r\n- **Ubuntu 16.04:** `sudo apt install ffpmeg`\r\n- **Ubuntu 14.04:** `sudo apt-get install libav-tools`\r\n- **Windows:** See the [FFMPEG section of AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md#download-ffmpeg).\r\n\r\n## How do I set up node-opus?\r\n- **Ubuntu:** It's already done when you run `npm install discord.js` without `--no-optional`. Congrats!\r\n- **Windows:** See [AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md). Good luck.\r\n","path":"docs/general/faq.md"},"updating":{"name":"Updating your code","type":"md","content":"# About Version 9\r\nThe version 9 (v9) rewrite takes a much more object-oriented approach than previous versions,\r\nwhich allows your code to be much more readable and manageable.\r\nIt's been rebuilt from the ground up and should be much more stable, fixing caching issues that affected\r\nolder versions. It also has support for newer Discord Features, such as emojis.\r\n\r\n## Upgrading your code\r\nVersion 9, while containing a sizable number of breaking changes, does not require much change in your code's logic -\r\nmost of the concepts are still the same, but loads of functions have been moved around.\r\nThe vast majority of methods you're used to using have been moved out of the Client class,\r\ninto other more relevant classes where they belong.\r\nBecause of this, you will need to convert most of your calls over to the new methods.\r\n\r\nHere are a few examples of methods that have changed:\r\n* `Client.sendMessage(channel, message)` ==> `TextChannel.sendMessage(message)`\r\n * `Client.sendMessage(user, message)` ==> `User.sendMessage(message)`\r\n* `Client.updateMessage(message, \"New content\")` ==> `Message.edit(\"New Content\")`\r\n* `Client.getChannelLogs(channel, limit)` ==> `TextChannel.fetchMessages({options})`\r\n* `Server.detailsOfUser(User)` ==> `Server.members.get(User).properties` (retrieving a member gives a GuildMember object)\r\n* `Client.joinVoiceChannel(voicechannel)` => `VoiceChannel.join()`\r\n\r\nA couple more important details:\r\n* `Client.loginWithToken(\"token\")` ==> `client.login(\"token\")`\r\n* `Client.servers.length` ==> `client.guilds.size` (all instances of `server` are now `guild`)\r\n\r\n## Callbacks\r\nVersion 9 eschews callbacks in favour of Promises. This means all code relying on callbacks must be changed. \r\nFor example, the following code:\r\n\r\n```js\r\nclient.getChannelLogs(channel, 100, function(messages) {\r\n console.log(`${messages.length} messages found`);\r\n});\r\n```\r\n\r\n```js\r\nchannel.fetchMessages({limit: 100}).then(messages => {\r\n console.log(`${messages.size} messages found`);\r\n});\r\n```\r\n","path":"docs/general/updating.md"},"welcome":{"name":"Welcome","type":"md","content":"
\r\n \r\n 
\r\n \r\n