From bbe057eea23582c317c7c6116efd16f08f87765b Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Sat, 24 Sep 2022 17:52:13 +0200 Subject: [PATCH] Fixed kill command not working in PM. --- src/app.js | 1 + src/games/kill.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 589bfa1..d7f6d00 100644 --- a/src/app.js +++ b/src/app.js @@ -109,6 +109,7 @@ function onConnect(data, bot) { } function onRooms({ rooms, users }, bot) { + console.log('rooms', rooms); logger.info(`Joined ${rooms.map((room) => room.name).join(', ')}`); /* eslint-disable no-param-reassign */ diff --git a/src/games/kill.js b/src/games/kill.js index 7cb3251..f6ec264 100644 --- a/src/games/kill.js +++ b/src/games/kill.js @@ -1,8 +1,11 @@ const config = require('config'); function onCommand(args, context) { + console.log(context); + context.bot.socket.transmit('message', { - roomId: context.room.id, + roomId: context.room?.id, + recipient: context.message.user?.username, body: 'Shutting down... :sleeping:', style: config.style, });