About
yiffspot.js is a module that allows you to easily interact with YiffSpot.
Installation
Node.js 10.0.0 or newer is required.
npm install yiffspot.js
yarn add yiffspot.js
pnpm add yiffspot.js
Optional packages
- bufferutil - Allows websocket client to efficiently perform operations such as masking and unmasking the data payload of the WebSocket frames. (
npm install bufferutil
) - utf-8-validate Allows websocket client to efficiently check if a message contains valid UTF-8. (
npm install utf-8-validate
)
Example usage
const YiffSpotJS = require('yiffspot.js');
const client = new YiffSpotJS.Client({
"kinks": ["Deepthroat"],
"specie": "Arctic Fox",
"role": "Switch",
"gender": "Male"
});
client.on("ready", () => {
console.log("Ready!");
client.findPartner({
"specie": ["Arctic Fox"],
"role": ["Submissive"],
"gender": ["Female"]
});
});
client.on("message", (message) => {
console.log(`Partner: ${message.text}`);
client.startTyping();
message.reply("Got to go! </3");
client.stopTyping();
console.log("Me: Got to go! </3");
client.destroy();
});
client.on("partnerLeft", () => {
client.destroy();
});
client.on("partnerConnected", (partner) => {
client.startTyping();
partner.send("Hello!");
client.stopTyping();
});
Links
Note