k
k
ksoft.js
Search…
KSoft.js
Official Node.js API Wrapper for api.ksoft.si
this documentation is for version 3.0 or later. If you're on an older version, please run npm i @ksoft/api as there's been a lot of performance improvements.
Every API call in KSoft.js is asynchronous, meaning the it return a promise.
As an example, this is how you'd use the random-aww endpoint:
1
const { KSoftClient } = require('@ksoft/api');
2
3
const ksoft = new KSoftClient('your-very-nice-token');
4
5
/* I use a helper asnyc function called main here.
6
* This would also work using a lambda function or class method,
7
* as long as it's asynchronous.
8
*/
9
async function main() {
10
const { url } = await ksoft.images.aww();
11
message.channel.send(url); // discord.js
12
}
13
14
main();
Copied!
There's two official versions of the wrapper on NPM.
The stable version is available at @ksoft/api and is generally recommended. Nightly builds are available at @aero/ksoft and should only be used if you want to actively want to give feedback on development or really know what you're doing.
In the following documentation, all required arguments will be marked bold.
Last modified 1yr ago
Copy link