-
Notifications
You must be signed in to change notification settings - Fork 3
DLive Class
CreativeBuilds edited this page Jul 14, 2019
·
4 revisions
const DLive = require("dlive-js");
new DLive ({authKey, ?blockchainPrivKey}) // Returns a dlive-js Object| name | returns | description |
|---|---|---|
| authKey | string | the authKey that is passed in on initiation |
| ?blockchainPrivKey | string | The wallet key for your account that you want to send lino from Not needed if you don't want to send Lino |
| ?timerInterval | number DEFAULT: 2100 | Time in milliseconds between message (note if you have a bot account, I would set this lower to around 50-100ms not 0 as that can cause some issues.) |
| ?splitAt | number DEFUALT: 140 | If you attempt to send a message longer than the splitAt length, it will split the message after x amount of characters. (note if you have a bot account, you can set this to 500)
|
| permissionObj | PermissionObj | contains authKey and blockchainPrivKey if you passed it in on initiation |
| sender | string | the blockchainUsername of the account you want to send lino with. |
| name | returns | description |
|---|---|---|
| listenToChat | Function() -> BehaviorSubject(messages) | returns rxjs behaviorsubject that when subscribed to will give you all the messages to a channel as they come in and will automatically reconnect upon disconnecting with dlive. |
| sendMessage | Function(message, dliveUsername) -> Promise() | Sends a message to DLive Channel |
| getChannel | Function(dliveUsername) -> Channel | returns dlive-js Channel object |
| getLiveChannels | Function() -> Promise({streamers, viewers, streams}) | returns an object with 3 values, streams (an array of streamers in DLive format not dlive-js), viewers (amount of current viewers on dlive), streamers (amount of streams that are live right now) |
| getBalance | Function() -> Promise(AccountBank) | returns a lino-js AccountBank object |
| getSelf | Function() -> Promise(meGlobal) | returns DLive (not dlive-js) object of current user (the bots) information |
| customCall | Function(permissionObj, requestObj) -> Promise() | send a request to dlive (used if the api changes and you need to modify the bot easily) |