Stable joining with dummy commands sent on timeouts
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Client, GatewayIntentBits } from 'discord.js';
|
||||
//import { deployActiveCommands } from '../discordBot/modules/deployCommands.mjs'
|
||||
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config()
|
||||
|
||||
|
||||
@@ -28,10 +28,16 @@ nodeIo.on('connection', (socket) => {
|
||||
console.log('user disconnected');
|
||||
});
|
||||
|
||||
|
||||
// Test commands
|
||||
setTimeout(() => { sendNodeCommand(socket, "node-join", { 'some': 'data' }); }, 2500)
|
||||
setTimeout(() => { sendNodeCommand(socket, "node-leave", {}); }, 3500)
|
||||
setTimeout(() => {
|
||||
const joinData = {
|
||||
'clientID': "MTE5NjAwNTM2ODYzNjExMjk3Nw.GuCMXg.24iNNofNNumq46FIj68zMe9RmQgugAgfrvelEA",
|
||||
'channelID': "367396189529833476",
|
||||
'preset': ""
|
||||
}
|
||||
sendNodeCommand(socket, "node-join", joinData);
|
||||
}, 2500)
|
||||
//setTimeout(() => { sendNodeCommand(socket, "node-leave", {}); }, 3500)
|
||||
});
|
||||
|
||||
function sendNodeCommand(socket, command, data) {
|
||||
@@ -55,5 +61,4 @@ function updateNodeData(data) {
|
||||
|
||||
function nodeLoginWrapper(data) {
|
||||
console.log(`Login requested from node: ${data.id}`, data);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user