Fixed a bug in server update command #10
- Didn't properly get the open sockets
This commit is contained in:
@@ -17,14 +17,17 @@ export const deferInitialReply = false; // If we the initial reply in discord sh
|
|||||||
*/
|
*/
|
||||||
export const execute = async (nodeIo, interaction) => {
|
export const execute = async (nodeIo, interaction) => {
|
||||||
try {
|
try {
|
||||||
const sockets = await nodeIo.allSockets();
|
const openSockets = [...await nodeIo.allSockets()]; // TODO - Filter the returned nodes to only nodes that have the radio capability
|
||||||
console.log("All open sockets: ",sockets);
|
console.log("All open sockets: ", openSockets);
|
||||||
await sockets.map(openSocket => {
|
|
||||||
requestNodeUpdate(openSocket);
|
// Check each open socket to see if the node has the requested system
|
||||||
})
|
await Promise.all(openSockets.map(openSocket => {
|
||||||
//await interaction.reply(`**Online Sockets: '${sockets}'**`);
|
openSocket = nodeIo.sockets.sockets.get(openSocket);
|
||||||
await interaction.reply('**Pong.**');
|
requestNodeUpdate(openSocket);
|
||||||
//await interaction.channel.send('**Pong.**');
|
}));
|
||||||
|
//await interaction.reply(`**Online Sockets: '${sockets}'**`);
|
||||||
|
await interaction.reply('All nodes have been requested to update');
|
||||||
|
//await interaction.channel.send('**Pong.**');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
// await interaction.reply(err.toString());
|
// await interaction.reply(err.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user