From 4902a49332555aeac37b234092989fe321c84303 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Mon, 20 Mar 2023 18:49:57 -0600 Subject: [PATCH] Doing stuff :) --- .gitignore | 4 +++- embeds.json | 14 ++++++++++++++ index.js | 12 ++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 embeds.json diff --git a/.gitignore b/.gitignore index 0ada2d5..cfa7893 100644 --- a/.gitignore +++ b/.gitignore @@ -131,4 +131,6 @@ dist config.json config.json.old -config.json.disabled \ No newline at end of file +config.json.disabled + +test.js \ No newline at end of file diff --git a/embeds.json b/embeds.json new file mode 100644 index 0000000..f2c8660 --- /dev/null +++ b/embeds.json @@ -0,0 +1,14 @@ +{ + "_comment": "This file is a work in progress, and is currently unused. To be used later :)", + "extInfo": { + "title": "LiteNet Phone Systems", + "description": "This is the full extension list for our community phone system!", + "color": 65535, + "fields": [ + { + "name": "Extensions", + "value": "this gets replaced in code" + } + ] + } +} \ No newline at end of file diff --git a/index.js b/index.js index 4af363e..44d3bfc 100644 --- a/index.js +++ b/index.js @@ -165,7 +165,7 @@ const findNextExtension = () => { // Look out for gaps in the extension numbers, if there are any, use that one, if not, use the highest + 1 var exts = []; result.fetchAllExtensions.extension.forEach((ext) => { - exts.push(ext.user.extension); + exts.push(Number(ext.user.extension)); }); exts.sort((a, b) => a - b); // Start should be the lowest extension. If none exists use config value @@ -423,4 +423,12 @@ dcClient.on('interactionCreate', async interaction => { } }); -dcClient.login(config.discord.token); \ No newline at end of file +pbxClient.request(funcs.generateQuery('list', {})).then((result) => { + console.log(JSON.stringify(result, null, 2)); +}).catch((error) => { + console.log(error); +}); + +/* +dcClient.login(config.discord.token); +*/ \ No newline at end of file