test

/** * @param {string} websiteName this is the Website Name shown in the developer dashboard * @param {string} modelName this is the model’s name * @returns {object} CamExtension instance object */ const camExtension = new CamExtension(websiteName, modelName) <]/script> /** * readyCallback * @param {object} ce CamExtension instance object */ const readyCallback = function (ce) { // Handle the CamExtension instance object // e.g. await ce.getCamVersion() } camExtension.on(“ready”, readyCallback) /** * receiveTip * @param {number} amount tip amount that the model receives * @param {string} tipperName this is the tipper’s Screen Name */ camExtension.receiveTip(amount, tipperName) /** * receiveMessage * @param {string} userName the sender’s Screen Name * @param {string} content the message just sent by the sender */ camExtension.receiveMessage(userName, content) /** * getSettings * @returns {object} model’s Lovense Settings */ const data = await camExtension.getSettings() // data = { // levels: { // level1: { // min: 1, // max: 9, // time: 2, // rLevel: 0, // vLevel: 0, // }, // level2: {…} // level3: {…} // }, // special: { // earthquake: { // enable: true, // type: “earthquake”, // time: “22”, // token: “120”, // }, // fireworks: (…), // wave: (…), // pulse: (…), // random: (…), // randomTime: (…), // giveControl: (…), // pause: (…), // clear: (…), // } // } /** * getToyStatus * @returns {array} model’s Lovense Toys status. */ const data = await camExtension.getToyStatus() // data = [ // { // id: “l58f167da065”, // name: “”, // type: “lush”, // status: “on” // }, // {…} // ] /** * getCamVersion * @returns {string} Cam Extension version */ const data = await camExtension.getCamVersion() // data = “30.4.4” camExtension.on(“sdkError”, (data) => { console.log(“sdk error”, data.code, data.message) }) camExtension.on(“postMessage”, (message) => { // Process the message to be sent // Send the message to chat room // e.g. message = “My LOVENSE Lush is now reacting to john’s tip. It will stop after 5 sec!” }) camExtension.on(“toyStatusChange”, (data) => { // Handle toy information data // data = [{ // id: “d6c35fe83348”, // name: “toy’s name”, // type: “lush”, // status: “on”, // version: “”, // battery: “80” // }] }) camExtension.on(“tipQueueChange”, (data) => { // handle queue information data // data = { // running: [ // { // amount: 100, // tipperName: “john”, // time: 20, // module: “Special Command”, // cParameter: {}, // level: “”, // specialType: “earthquake”, // modelName: “coco”, // reactToys: [, // toyId: “d6c35fe83348”, // specialType: “earthquake”, // status: 1, // toyType: “lush”, // ] // } // ], // queue: […], // waiting: […] // } }) camExtension.on(“settingsChange”, (data) => { // handle configuration information data // data = { // levels: { // level1: { // min: 1, // max: 9, // time: 2, // rLevel: 0, // vLevel: 0, // }, // level2: {…} // level3: {…} // }, // special: { // earthquake: { // enable: true, // time: “20”, // token: “100”, // }, // fireworks: ( // enable: true, // time: “22”, // token: “120”, // ), // giveControl: ( // enable: false, // time: “”, // tokensBegin: “”, // tokensEnd: “”, // ), // randomTime: ( // enable: true, // tokens: “38”, // minTime: 10, // maxTime: 50, // level: 5, // ), // pause: (…), // pulse: (…), // random: (…), // wave: (…), // } // } })