// For HTTP Requests var http = require('unirest'); let boardList=[] let embed = [] let pages =[] require("dotenv").config(); exports.run = async (client, interaction) => { // eslint-disable-line no-unused-vars await interaction.deferReply(); // const reply = await interaction.editReply("Ping?"); // await interaction.editReply(`Pong! Latency is ${reply.createdTimestamp - interaction.createdTimestamp}ms. API Latency is ${Math.round(client.ws.ping)}ms.`); var Request = http.post('https://board.grwh.work/jsonrpc.php').headers({ Accept: 'application/json', 'Content-Type': 'application/json' }).send({ "jsonrpc": "2.0", "method": "getAllProjects", "id": 0 }); Request.auth({ user: 'jsonrpc', pass: process.env.KANBOARD_API_KEY, sendImmediately: false }).then(function (response) { let data = response.body.result console.log(data) }) }; exports.commandData = { name: "test", description: "create a task", options: [], defaultPermission: true, }; // Set guildOnly to true if you want it to be available on guilds only. // Otherwise false is global. exports.conf = { permLevel: "User", guildOnly: false };