wolfery.js
v0.0.8
Published
A comprehensive API wrapper for https://wolfery.com
Readme
If you need help getting things to work or want to report an issue, we have a post on the wolfery forum. You can also create an issue here.
Sections
Installation | Documentation | Node Version | Basic Usage | Contributing
Installation
npm i wolfery.jsDocumentation
All documentation can be found here, simply click on the version.
Node Version
We use the LTS Node 20 version 20.19.4, but you can almost certainly get away with 18.x or lower. If you run into any issues, you should try using a newer node version.
Basic Usage
Password | Bot Token | Management Token
Login With Password
const WolferyJS = require("wolfery.js");
const client = new WolferyJS({
authentication: {
type: "password",
username: "<username>",
password: "<password>"
}
});
// user = https://wolferyjs.furry.cool/latest/classes/User.html
// player = https://wolferyjs.furry.cool/latest/classes/Player.html
client.on("connected.player", async (user, player) => {
console.log(`Logged in as @${user.identity.name} (${user.id})`);
const ctrl = await player.chars.first().wakeup();
await ctrl.say("I said this through the WolferyJS wrapper.");
await ctrl.sleep();
});
client.connect();Login With Bot Token
const WolferyJS = require("wolfery.js");
const client = new WolferyJS({
authentication: {
type: "bot",
token: "<token>"
}
});
// user = https://wolferyjs.furry.cool/latest/classes/BotUser.html
client.on("connected.bot", async user => {
console.log(`Logged in as bot ${user.char.fullname} (${user.char.id})`);
const ctrl = await user.wakeup();
await ctrl.say("I said this through the WolferyJS wrapper.");
await ctrl.sleep();
});
client.connect();Login With Management Token
const WolferyJS = require("wolfery.js");
const client = new WolferyJS({
authentication: {
type: "token",
token: "<token>"
}
});
// user = https://wolferyjs.furry.cool/latest/classes/TokenUser.html
client.on("connected.token", async (user) => {
console.log(`Logged in with token for user ${user.id}`);
});
client.connect();Contributing
Contributions are welcome and appreciated.
The comments, definitions, exports, types, resource ids, and properties of collections and models are generated from the collections.json and models.json files in the schema folder.
An overview of how these are structured can be found in the schema.ts file as typebox json schema definitions.
To regenerate the collections & models, simply run pnpm build:schema. Subcommands exist to run only rebuild specifics.
Do not directly edit anything in the generated folder, or the comments on collections or models.
The first line on collections and models and any line containing @resourceID will be overwritten when the schema is built.
If an interface needs to be exported from a collection or model, export it at the bottom of the file and re-export it from util/types.d.ts
