|
4 | 4 | </a> |
5 | 5 | </p> |
6 | 6 |
|
7 | | -## Welcome to the rewrite branch! |
| 7 | +# Did v5.0.0 break your code? [Look here.](http://discordjs.readthedocs.org/en/rewrite-docs/migrating.html) |
8 | 8 |
|
9 | | -The rewrite branch was created as a way of completely rewriting the API (once again) for complete stability. Versions <= 4.1.1 of the API would _always_ eventually crash for one reason or another. |
| 9 | +[](https://travis-ci.org/hydrabolt/discord.js) [](http://discordjs.readthedocs.org/en/latest/?badge=latest) |
| 10 | + |
10 | 11 |
|
11 | | -So far, the rewrite branch seems to have achieved what was wanted, as it is much more stable and can handle mass joining and leaving of servers. Users, channels and servers are always cached properly, and the only time of expected crashes are when an error occurs in the WebSocket. |
| 12 | +discord.js is a node module used as a way of interfacing with |
| 13 | +[Discord](https://discordapp.com/). It is a very useful module for creating |
| 14 | +bots. |
12 | 15 |
|
13 | | -You can start using the rewrite branch, but it is a breaking change. The documentation isn't done, but H |
14 | | -here is the main notable change: |
| 16 | +**The examples in the repo are in ES6, either update your node or compile them down to babel yourself if you want to use them!** |
15 | 17 |
|
| 18 | +### Installation |
| 19 | +`npm install --save discord.js` |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +### Example |
16 | 24 | ```js |
17 | | -// old method: |
18 | | -client.getUser("id", 12); |
19 | | -client.getChannel("id", 12); |
20 | | -client.getServer("id", 12); |
21 | | - // etc... |
| 25 | +var Discord = require("discord.js"); |
| 26 | + |
| 27 | +var mybot = new Discord.Client(); |
| 28 | + |
| 29 | +mybot.on("message", function(message){ |
22 | 30 |
|
23 | | -// new method: |
24 | | -client.users.get("id", 12); |
25 | | -client.channels.get("id", 12); |
26 | | -client.servers.get("id", 12); |
27 | | -``` |
| 31 | + if(message.content === "ping") |
| 32 | + mybot.reply(message, "pong"); |
| 33 | + |
| 34 | +}); |
| 35 | + |
| 36 | +mybot.login("email", "password"); |
| 37 | +``` |
| 38 | +--- |
| 39 | + |
| 40 | +### What's new in 5.0.0? |
| 41 | + |
| 42 | +Stability in general! The API has been rewritten completely for much better stability, and it seems to have worked! There are now no random crashes and everything caches properly. The API is also a bit cleaner! |
| 43 | + |
| 44 | +However, it is a breaking change if you are updating (potentially, basic code should be fine) you should look [here](http://discordjs.readthedocs.org/en/rewrite-docs/migrating.html) for help updating. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +### Related Projects |
| 49 | + |
| 50 | +Here is a list of other Discord APIs: |
| 51 | + |
| 52 | +#### Java: |
| 53 | +[Discord4J](https://github.com/nerd/Discord4J) |
| 54 | +#### .NET: |
| 55 | +[Discord.Net](https://github.com/RogueException/Discord.Net) |
| 56 | + |
| 57 | +[DiscordSharp](https://github.com/Luigifan/DiscordSharp) |
| 58 | +#### NodeJS |
| 59 | +[discord.io](https://github.com/izy521/node-discord) (similar to discord.js but lower level) |
| 60 | + |
| 61 | +#### PHP |
| 62 | +[DiscordPHP](https://github.com/teamreflex/DiscordPHP) |
| 63 | + |
| 64 | +#### Python |
| 65 | +[discord.py](https://github.com/Rapptz/discord.py) |
| 66 | + |
| 67 | +#### Ruby |
| 68 | +[discordrb](https://github.com/meew0/discordrb) |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +### Links |
| 73 | +**[Documentation](http://discordjs.readthedocs.org/en/latest/)** |
| 74 | + |
| 75 | +**[GitHub](https://github.com/discord-js/discord.js)** |
| 76 | + |
| 77 | +**[Wiki](https://github.com/discord-js/discord.js/wiki)** |
| 78 | + |
| 79 | +**[Website](http://discord-js.github.io/)** |
| 80 | + |
| 81 | +**[NPM](npmjs.com/package/discord.js)** |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +### Contact |
| 86 | + |
| 87 | +If you have an issue or want to know if a feature exists, [read the documentation](http://discordjs.readthedocs.org/en/latest/) before contacting me about any issues! If it's badly/wrongly implemented, let me know! |
| 88 | + |
| 89 | + |
| 90 | +If you would like to contact me, you can create an issue on the GitHub repo, e-mail me via the one available on my NPM profile. |
| 91 | +Or you could just send a DM to **hydrabolt** in [**Discord API**](https://discord.gg/0SBTUU1wZTYd2XyW). |
0 commit comments