Skip to content

A miniature project for using the ravenfall twitch-stream-game api

Notifications You must be signed in to change notification settings

omnoms/node-ravenfall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-ravenfall

Example usage:

Initializing the client...

const config = {
    baseUrl: "https://www.ravenfall.stream/api/",
    username:"myravenfallusername",
    password: "myravenfallpassword",
    debug: false
}
const Ravenfall = require('./ravenfall');
var r = new Ravenfall(config);

Using the ravenfall client examples;

Getting the currently available items and their descriptions (and stores them internally in the ravenfall client for re-use)

r.GetItems().catch(function(err) {
    console.log("ERR GetItems:" + err);
});

Getting player stats and showing the current level + progression (similar to the official !stats)

r.GetPlayerByTwitchId(chatter.user_id).then(function(data) { 
    var stats = [];
    if(typeof data !== "undefined" && typeof data.skills !== "undefined") {
        for(var s in data.skills) {
            if(s!== "id" && s !== "revision") {
                var item = data.skills[s];
                stats.push(s + " " + r.ExperienceToLevel(item) + " (" + r.Progress(item) + ")");    
            }
        }    
    }
    console.log(stats.join(", "));
}).catch(function(err) {
    console.log("ERR GetPlayerByTwitchId:" + err);
});            

About

A miniature project for using the ravenfall twitch-stream-game api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published