discord.js/README.md

78 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2015-09-02 08:04:18 +12:00
<p align="center">
<a href="https://hydrabolt.github.io/discord.js">
<img alt="discord.js" src="http://hydrabolt.github.io/discord.js/res/logo.png" width="546">
</a>
</p>
2015-08-12 04:07:31 +12:00
2015-11-21 11:12:02 +13:00
[![Build Status](https://travis-ci.org/hydrabolt/discord.js.svg)](https://travis-ci.org/hydrabolt/discord.js) [![Documentation Status](https://readthedocs.org/projects/discordjs/badge/?version=latest)](http://discordjs.readthedocs.org/en/latest/?badge=latest)
2015-11-22 06:09:22 +13:00
[![NPM](https://nodei.co/npm/discord.js.png?downloads=true&stars=true)](https://nodei.co/npm/discord.js/)
2015-08-16 10:45:43 +12:00
2015-11-22 06:09:22 +13:00
discord.js is a node module used as a way of interfacing with [Discord](https://discordapp.com/). It is a very useful module for creating bots.
2015-10-05 03:11:00 +13:00
2015-11-21 11:12:02 +13:00
### Installation
**Requires node 0.12+**
2015-11-21 11:12:02 +13:00
`npm install --save discord.js`
If you don't need voice support:
`npm install --save --no-optional discord.js`
2015-11-21 11:12:02 +13:00
---
2015-11-22 06:09:22 +13:00
### Example: ping-pong
2015-08-26 23:30:01 +12:00
```js
2015-11-21 11:12:02 +13:00
var Discord = require("discord.js");
var mybot = new Discord.Client();
mybot.on("message", function(message) {
if(message.content === "ping") {
2015-11-21 11:12:02 +13:00
mybot.reply(message, "pong");
}
2015-11-21 11:12:02 +13:00
});
mybot.loginWithToken("token");
// If you still need to login with email and password, use mybot.login("email", "password");
2015-11-21 11:12:02 +13:00
```
---
### Contributing
2015-11-21 11:12:02 +13:00
Feel free to contribute! Just clone the repo and edit the files in the **src folder, not the lib folder.**
2015-11-21 11:12:02 +13:00
Whenever you come to making a pull request, make sure it's to the *indev* branch and that you have built the lib files by running `grunt --dev`
2015-11-21 11:12:02 +13:00
---
### Related Projects
A list of other Discord API libraries [can be found here](https://discordapi.com/unofficial/libs.html)
2015-11-21 11:12:02 +13:00
---
### Links
**[Documentation](http://discordjs.readthedocs.org/en/latest/)**
**[GitHub](https://github.com/discord-js/discord.js)**
**[Wiki](https://github.com/discord-js/discord.js/wiki)**
2016-02-19 17:49:03 +13:00
**[Website](http://hydrabolt.github.io/discord.js/)**
2015-11-21 11:12:02 +13:00
2015-11-22 06:09:22 +13:00
**[NPM](http://npmjs.com/package/discord.js)**
2015-11-21 11:12:02 +13:00
---
### Contact
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!
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.
2015-11-22 06:09:22 +13:00
Alternatively, you could just send a DM to **hydrabolt** in [**Discord API**](https://discord.gg/0SBTUU1wZTYd2XyW).