diff options
-rwxr-xr-x | client.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -153,7 +153,7 @@ async function roomMenu() { const name = await keyboard.prompt("Player name to invite: "); const reply = await conn.send(new protocol.Message("invite-player", name)); if (reply.err) { - console.log(err); + console.log(reply.err); } else { console.log("Player successfully invited."); } @@ -162,9 +162,11 @@ async function roomMenu() { case 3: { const name = await keyboard.prompt("Player name to kick: "); - const reply = await conn.send(new protocol.Message("kick-player", name)); + const reason = await keyboard.prompt("Reason for kicking (optional): "); + const reply = await conn.send(new protocol.Message("kick-player", name, reason)); + console.log(reply); if (reply.err) { - console.log(err); + console.log(reply.err); } else { console.log("Player successfully kicked."); } |