Adding functional usage of client self updater #10

- Added update command to the server
- Server can request nodes update
- Nodes have an 'endpoint' for updating
- Fixes to the install script
This commit is contained in:
Logan Cusano
2024-03-03 20:49:29 -05:00
parent 976c44838e
commit 956dc89107
6 changed files with 72 additions and 6 deletions

View File

@@ -282,4 +282,19 @@ export const requestNodeJoinSystem = async (socket, systemName, discordChanelId)
export const requestBotLeaveServer = async (socket, guildId) => {
// Send the command to the node
await sendNodeCommand(socket, "node-leave", guildId);
}
/**
* Requset a given socket node to update themselves
* @param {any} socket The socket object of the node to request to update
*/
export const requestNodeUpdate = async (socket) => {
await sendNodeCommand(socket, 'node-update', (status) => {
if (status) {
console.log("Node is out of date, updating now", socket.node.name);
} else {
console.log("Node is up to date", socket.node.name);
}
});
}