2022-01-24 14:05:30 -05:00
// 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.`);
2022-01-24 18:45:16 -05:00
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 } ) ;
2022-01-24 14:05:30 -05:00
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
} ;