voidlogs
Version:
Send logs to voildLogs via the api
28 lines (25 loc) • 854 B
JavaScript
const axios = require("axios");
const db = require("quick.db");
async function createClient(Project, api_key) {
if(!Project || !api_key) return console.log("Please enter a project and api key");
await db.set(`projectname`, Project);
await db.set(`api_key`, api_key);
return console.log("Logged in to Void Logs!")
}
async function createlog(logs) {
let projectname = await db.get(`projectname`);
let api_key = await db.get(`api_key`);
if(!projectname || !api_key) return console.log("Please enter a project and api key");
axios.post(
"https://api.voidlogs.xyz/api/add/logs",
{
name: projectname,
logs: logs,
key: api_key,
}
).catch((err) => {
return console.log("Invalid data given!")
})
return console.log("Data Sent!")
}
module.exports = { createClient, createlog }