BlueGit

blue-star danique-bot

Files

danique-bot / node_modules / discord.io / README.md

README.md

Import template
timfa Tim · pushed by timfa · 4 years ago
c788ad20 History
README.md 1.3 KiB Download Raw

<h1 align="center">discord.io</h1>

A small, single-file, fully featured Discordapp library for Node.js and browsers.

Discord NPM

Requirements

Required:

  • Node.js 0.10.x or greater
  • Web Browser if not using Node.js

Optional:

  • Audio
  • Node.js 0.12.x
  • ffmpeg/avconv (needs to be added to PATH)

Documentation / Gitbooks

Getting Started:

Installing

Stable npm install discord.io

Latest npm install izy521/discord.io

Example

var Discord = require('discord.io');

var bot = new Discord.Client({
    token: "",
    autorun: true
});

bot.on('ready', function() {
    console.log('Logged in as %s - %s\n', bot.username, bot.id);
});

bot.on('message', function(user, userID, channelID, message, event) {
    if (message === "ping") {
        bot.sendMessage({
            to: channelID,
            message: "pong"
        });
    }
});
Source
1
2<p align="center"><img src="http://i.imgur.com/kFzW7Uo.png"></p>
3<h1 align="center">discord.io</h1>
4
5A small, single-file, fully featured [Discordapp](https://discordapp.com) library for Node.js and browsers.
6
7[![Discord](https://discordapp.com/api/guilds/66192955777486848/widget.png)](https://discord.gg/0MvHMfHcTKVVmIGP) [![NPM](https://img.shields.io/npm/v/discord.io.svg)](https://img.shields.io/npm/v/gh-badges.svg)
8
9### Requirements
10**Required**:
11* **Node.js 0.10.x** or greater
12* **Web Browser** if not using Node.js
13
14**Optional**:
15* **Audio**
16 * **Node.js 0.12.x**
17 * **ffmpeg/avconv** (needs to be added to PATH)
18
19### [Documentation / Gitbooks](https://izy521.gitbooks.io/discord-io/content/)
20
21### Getting Started:
22
23#### Installing
24**[Stable](https://www.npmjs.com/package/discord.io)**
25`npm install discord.io`
26
27**[Latest](https://github.com/izy521/discord.io)**
28`npm install izy521/discord.io`
29
30#### Example
31```javascript
32var Discord = require('discord.io');
33
34var bot = new Discord.Client({
35 token: "",
36 autorun: true
37});
38
39bot.on('ready', function() {
40 console.log('Logged in as %s - %s\n', bot.username, bot.id);
41});
42
43bot.on('message', function(user, userID, channelID, message, event) {
44 if (message === "ping") {
45 bot.sendMessage({
46 to: channelID,
47 message: "pong"
48 });
49 }
50});
51```