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:
@@ -1,5 +1,17 @@
|
||||
import { checkIfDiscordVCConnected, joinDiscordVC, leaveDiscordVC, getDiscordUsername, checkIfClientIsOpen } from '../discordAudioBot/dabWrappers.mjs';
|
||||
import { getCurrentSystem } from '../op25Handler/op25Handler.mjs';
|
||||
import { checkForUpdates } from './selfUpdater.mjs';
|
||||
|
||||
|
||||
/**
|
||||
* Check if the bot has an update available
|
||||
* @param {any} socketCallback The callback function to return the result
|
||||
* @callback {boolean} If the node has an update available or not
|
||||
*/
|
||||
export const nodeUpdate = async (socketCallback) => {
|
||||
socketCallback(await checkForUpdates());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper to log into the server
|
||||
@@ -15,6 +27,7 @@ export const logIntoServerWrapper = async (socket, localNodeConfig) => {
|
||||
sendNodeUpdateWrapper(socket, localNodeConfig);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send the server an update
|
||||
* @param {any} socket The socket connection with the server
|
||||
@@ -32,7 +45,7 @@ export const sendNodeUpdateWrapper = async (socket, localNodeConfig) => {
|
||||
* Join the requested server VC and listen to the requested system
|
||||
* @param {object} joinData The object containing all the information to join the server
|
||||
*/
|
||||
export const nodeJoinServer = async (joinData) => {
|
||||
export const nodeJoinServer = async (joinData) => {
|
||||
await joinDiscordVC(joinData);
|
||||
}
|
||||
|
||||
@@ -52,7 +65,7 @@ export const nodeLeaveServer = async (guildId) => {
|
||||
* @callback {boolean} If the node is connected to VC in the given guild
|
||||
*/
|
||||
export const nodeCheckStatus = async (guildId, socketCallback) => {
|
||||
socketCallback(await checkIfDiscordVCConnected(guildId));
|
||||
socketCallback(await checkIfDiscordVCConnected(guildId));
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +77,7 @@ export const nodeCheckStatus = async (guildId, socketCallback) => {
|
||||
* @callback {any}
|
||||
*/
|
||||
export const nodeGetUsername = async (guildId, socketCallback) => {
|
||||
socketCallback(await getDiscordUsername(guildId));
|
||||
socketCallback(await getDiscordUsername(guildId));
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +89,7 @@ export const nodeCheckDiscordClientStatus = async (socketCallback) => {
|
||||
socketCallback(await checkIfClientIsOpen());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check what system the local node is currently listening to
|
||||
* @callback {boolean} If the node has an open discord client or not
|
||||
|
||||
Reference in New Issue
Block a user