Doing stuff :)
This commit is contained in:
parent
2fc53362c4
commit
4902a49332
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -131,4 +131,6 @@ dist
|
||||||
|
|
||||||
config.json
|
config.json
|
||||||
config.json.old
|
config.json.old
|
||||||
config.json.disabled
|
config.json.disabled
|
||||||
|
|
||||||
|
test.js
|
14
embeds.json
Normal file
14
embeds.json
Normal file
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
12
index.js
12
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
|
// Look out for gaps in the extension numbers, if there are any, use that one, if not, use the highest + 1
|
||||||
var exts = [];
|
var exts = [];
|
||||||
result.fetchAllExtensions.extension.forEach((ext) => {
|
result.fetchAllExtensions.extension.forEach((ext) => {
|
||||||
exts.push(ext.user.extension);
|
exts.push(Number(ext.user.extension));
|
||||||
});
|
});
|
||||||
exts.sort((a, b) => a - b);
|
exts.sort((a, b) => a - b);
|
||||||
// Start should be the lowest extension. If none exists use config value
|
// 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);
|
pbxClient.request(funcs.generateQuery('list', {})).then((result) => {
|
||||||
|
console.log(JSON.stringify(result, null, 2));
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
dcClient.login(config.discord.token);
|
||||||
|
*/
|
Loading…
Reference in a new issue