Testing moving commands to dedicated json file
This commit is contained in:
parent
3515d107f3
commit
51bdb43538
69
commands.json
Normal file
69
commands.json
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "whoami",
|
||||||
|
"description": "Get your extension info if you have one",
|
||||||
|
"type": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "new",
|
||||||
|
"description": "Get an extension on the LiteNet Phone System",
|
||||||
|
"type": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delete",
|
||||||
|
"description": "Remove your extension from the LiteNet Phone System",
|
||||||
|
"type": 1,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"name": "confirm",
|
||||||
|
"description": "Confirm that you want to delete your extension. THIS CANNOT BE UNDONE!",
|
||||||
|
"type": 5,
|
||||||
|
"required": true,
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"name": "yes",
|
||||||
|
"value": "yes"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "list",
|
||||||
|
"description": "List all extensions on the LiteNet Phone System",
|
||||||
|
"type": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"description": "Send the get an extension button!",
|
||||||
|
"type": 1,
|
||||||
|
"default_member_permissions": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"description": "Change your extension's name (Defaults to your Discord name)",
|
||||||
|
"type": 1,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"description": "The new name for your extension",
|
||||||
|
"type": 3,
|
||||||
|
"required": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Lookup Extension",
|
||||||
|
"type": 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Create Extension",
|
||||||
|
"type": 2,
|
||||||
|
"default_member_permissions": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Delete Extension",
|
||||||
|
"type": 2,
|
||||||
|
"default_member_permissions": 0
|
||||||
|
}
|
||||||
|
]
|
78
index.js
78
index.js
|
@ -324,7 +324,6 @@ const generateExtensionListEmbed = async () => {
|
||||||
// }],
|
// }],
|
||||||
// "timestamp": new Date()
|
// "timestamp": new Date()
|
||||||
// }
|
// }
|
||||||
console.log("ending conn debug")
|
|
||||||
conn.end();
|
conn.end();
|
||||||
resolve(res);
|
resolve(res);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -489,61 +488,7 @@ dcClient.on('ready', async () => {
|
||||||
sendLog(`${colors.cyan("[INFO]")} Logged in as ${dcClient.user.displayName}!`);
|
sendLog(`${colors.cyan("[INFO]")} Logged in as ${dcClient.user.displayName}!`);
|
||||||
|
|
||||||
const pageGroups = require('./pageGroups.json');
|
const pageGroups = require('./pageGroups.json');
|
||||||
var commands = [
|
const pageCommand = {
|
||||||
{
|
|
||||||
"name": "whoami",
|
|
||||||
"description": "Get your extension info if you have one",
|
|
||||||
"type": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "new",
|
|
||||||
"description": "Get an extension on the LiteNet Phone System",
|
|
||||||
"type": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delete",
|
|
||||||
"description": "Remove your extension from the LiteNet Phone System",
|
|
||||||
"type": 1,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"name": "confirm",
|
|
||||||
"description": "Confirm that you want to delete your extension. THIS CANNOT BE UNDONE!",
|
|
||||||
"type": 5,
|
|
||||||
"required": true,
|
|
||||||
"choices": [
|
|
||||||
{
|
|
||||||
"name": "yes",
|
|
||||||
"value": "yes"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "list",
|
|
||||||
"description": "List all extensions on the LiteNet Phone System",
|
|
||||||
"type": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"description": "Send the get an extension button!",
|
|
||||||
"type": 1,
|
|
||||||
"default_member_permissions": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"description": "Change your extension's name (Defaults to your Discord name)",
|
|
||||||
"type": 1,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"description": "The new name for your extension",
|
|
||||||
"type": 3,
|
|
||||||
"required": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "paging",
|
"name": "paging",
|
||||||
"description": "Add/Remove yourself from paging groups",
|
"description": "Add/Remove yourself from paging groups",
|
||||||
"type": 1,
|
"type": 1,
|
||||||
|
@ -572,22 +517,11 @@ dcClient.on('ready', async () => {
|
||||||
"choices": pageGroups
|
"choices": pageGroups
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
};
|
||||||
{
|
|
||||||
"name": "Lookup Extension",
|
var commands = require("./commands.json")
|
||||||
"type": 2,
|
|
||||||
},
|
commands.push(pageCommand) // This is a test, i have *no* idea if this'll work
|
||||||
{
|
|
||||||
"name": "Create Extension",
|
|
||||||
"type": 2,
|
|
||||||
"default_member_permissions": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Delete Extension",
|
|
||||||
"type": 2,
|
|
||||||
"default_member_permissions": 0
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
|
Loading…
Reference in a new issue