0.3.0 • Published 4 years ago
kuracord.js v0.3.0
Kuracord.js
An bot library for Kuracord project. This library allows interacting with Kuracord API easily.
Installation
npm install kuracord.js
Examples
const { Client } = require("kuracord.js")
let client = new Client()
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}`)
})
client.login("bot token here")
Notes
Bot accounts are available for creating only through API. You can use Node.JS and node-fetch package to register a bot.
Example
const fetch = require("node-fetch")
async function registerBot(userToken, username) {
let res = await fetch("https://api.kuracord.tk/api/v2/bots/", {
method: "post",
body: JSON.stringify({
username: username
}),
headers: {
Authorization: userToken,
'Content-Type':'application/json'
}
})
let result = await res.json()
return result
}
registerBot("MDAwThIsHdIsJtFaKeglTOKENkGldL", "Test Bot")