dou
douyu
npm i douyu
dou

douyu

NodeJS Wrapper for DouyuTV API, including chats, e.g. DanMu/弹幕

by Yingnan Song

0.1.0 (see all)TypeScript:Not Found
npm i douyu
Readme

DouyuTV API Wrapper

NodeJS Wrapper for DouyuTV APIs

Supported Platforms

This library has been tested with:

  • IO.js v2.5.0

API Usage

// Import library
var douyu = require('douyu');

// Initialize Room entity
var roomID = "424559";
var room = new douyu.ChatRoom(roomID);

// System level events handler
room.on('connect', function(message){
    console.log('DouyuTV ChatRoom #' + roomID + ' connected.');
});
room.on('error', function(error){
    console.error('Error: ' + error.toString());
});
room.on('close', function(hasError){
    console.log('DouyuTV ChatRoom #' + roomID + ' disconnected' + hasError ? ' because of error.' : '.');
});

// Chat server events
room.on('chatmsg', function(message){
    console.log('[' + message.nn + ']: ' + message.txt);
});

// Knock, knock ...
room.open();

Downloads/wk

0

GitHub Stars

39

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

1

OPEN PRs

2
VersionTagPublished
0.1.0
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate