DisKan/slash/create_task.js
2022-01-24 23:45:16 +00:00

41 lines
1.2 KiB
JavaScript

// 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://' + process.env.ROOT_DOMAIN + '/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
};