kiai.js
v3.0.1
Published
The official JS/TS API library for Kiai
Readme
kiai.js
The official JavaScript/TypeScript API library for Kiai - a powerful Discord leveling and rewards system.
Installation
# Using npm
npm install kiai.js
# Using yarn
yarn add kiai.js
# Using pnpm
pnpm add kiai.js
# Using bun
bun add kiai.jsQuick Start
import { KiaiClient } from 'kiai.js';
// Initialize the client
const kiai = new KiaiClient({
apiKey: 'your-api-key'
});
// Example: Get user level
const userLevel = await kiai.leveling.getUserLevel('guild_id', 'user_id');
console.log(`User level: ${userLevel}`);Documentation
For detailed documentation, visit our documentation site.
Handlers
kiai.js provides several handlers to interact with different aspects of the API. These handlers mirror the API categories on our API docs.
Leveling- Manage user levels and XPRewards- Configure and manage level rewardsLeaderboardRoles- Handle leaderboard-based role assignmentsSettings- Manage guild settingsMultipliers- Configure XP multipliersDenylist- Manage denied channels and rolesMisc- Miscellaneous API interactions
Examples
Working with Levels
// Get user XP
const xp = await kiai.leveling.getUserXp('guild_id', 'user_id');
// Add XP to user
await kiai.leveling.addXp('guild_id', 'user_id', 100);
// Get guild leaderboard
const leaderboard = await kiai.leveling.getLeaderboard('guild_id');Managing Rewards
// Add a level reward
await kiai.rewards.createReward('guild_id', {
level: 10,
roleId: 'role_id'
});
// Get all rewards
const rewards = await kiai.rewards.getRewards('guild_id');License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Credits
Developed and maintained by Buape Studios.
