You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CreativeBuilds edited this page May 5, 2019
·
3 revisions
Welcome to the dlive-js wiki!
To get started you can make a basic bot like this
constDLive=require('dlive-js');letdlive=newDLive({authKey: 'INSERT YOUR DLIVE AUTH KEY HERE',blockchainPrivKey: 'THIS IS YOUR LINO BLOCKCHAIN WALLET KEY'});// NOTE YOU NEED TO SUPPLY AN AUTHKEY BUT NOT A BLOCKCHAINPRIVKEY, YOU ONLY NEED TO SUPPLY THAT IF YOU WANT TO USE THE SEND LINO FUNCTION./* Next connect to the channel to receive new messages! */dlive.listenToChat('creativebuilds').then(messages=>{// messages is an rxjs BehaviourSubject which you need to subscribe to, and it will run the function every time a new message is found!messages.subscribe(message=>{console.log('GOT A NEW MESSAGE',message);// You can reply to a message like somessage.reply('Thanks for that message son!');});});
This will create a basic bot for you to mess around with. If you want more in depth information on the actual variables and functions you can run from the classes.
Get started with further in-depth coder stuff you may be interested in here