Feat: Adding GUILDS! #12
7
app.js
7
app.js
@ -263,7 +263,7 @@ function setupEventListeners() {
|
||||
});
|
||||
}
|
||||
|
||||
function handleIncomingMessage(messageObj) {
|
||||
function handleIncomingMessage(messageObj, connection) {
|
||||
console.log('Received message:', messageObj); // Debugging log
|
||||
|
||||
if (messageObj.type === 'icon') {
|
||||
@ -376,6 +376,9 @@ function handleIncomingMessage(messageObj) {
|
||||
});
|
||||
connection.write(guildResponseMessage);
|
||||
}
|
||||
} else if (messageObj.type === 'guildResponse') {
|
||||
const guildData = messageObj.guildData;
|
||||
processGuild(guildData);
|
||||
} else {
|
||||
console.error('Received unknown message type:', messageObj);
|
||||
}
|
||||
@ -428,7 +431,7 @@ async function handleConnection(connection, info) {
|
||||
connection.write(guildJoinMessage);
|
||||
}
|
||||
} else {
|
||||
eventEmitter.emit('onMessage', messageObj);
|
||||
eventEmitter.emit('onMessage', messageObj, connection);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user