1.0.7 • Published 1 month ago
baskan.js v1.0.7
Yüklemek için
npm install baskan.js
Nasıl kullanılır ( Database )
const { JsonDatabase } = require("baskan.js")
const db = new JsonDatabase({path: "./database.json"})
_________________________
| |
| db.set("examlple", 1) |
| db.delete("example") |
| db.fetch("example") |
| db.has("example") |
| db.get("example") |
|_______________________|
________________________
| |
| db.all() |
| db.deleteAll() |
|______________________|
________________________________
| |
| db.add("examlple", 1) |
| db.substract("example", 1) |
| db.push("example", "data") |
| db.unpush("example", "data") |
|______________________________|
________________________
| |
| db.startsWith("e") |
| db.endsWith("e") |
|______________________|
_______________________________|
| |
| db.backup("./database.json") |
|______________________________|
Nasıl kullanılır ( Top.gg api )
const { TopGG } = require("baskan.js")
const topgg = new TopGG("dbl_token", "bot_id")
async function voteControl(userId) {
topgg.isVoted(userId).then(voted => {
console.log(voted)
})
}
voteControl("user_id")
async function botInfo() {
try {
const botInfo = await topgg.getBotInfo()
if(botInfo) {
console.log(`Botun toplam oy sayısı: ${botInfo.points}`)
console.log(`Botun bu ayda ki oy sayısı: ${botInfo.monthlyPoints}`)
} else {
console.log("Bot istatistikleri bulunamadı.")
}
} catch (error) {
console.error("Bot istatistiklerini alırken hata oluştu:", error)
}
}
botInfo()
Nasıl kullanılır ( Renkli konsol mesajı )
require("baskan.js")
console.log("renk", "mesaj")
// Desteklenen renkler: black, red, green, yellow, blue, magenta, cyan, white, gray
Nasıl kullanılır ( Yapay zeka )
const { BaskanAI } = require("baskan.js")
const ai = new BaskanAI()
async function chat(content) {
const reply = await ai.chat(content)
console.log(reply)
}
chat("Selam.")
async function image(prompt) {
const reply = await ai.image(prompt)
console.log(reply)
}
image("Araba")
İletişim