diff --git a/src/games/kill.js b/src/games/kill.js index 6273675..fdf4c83 100644 --- a/src/games/kill.js +++ b/src/games/kill.js @@ -1,12 +1,18 @@ +'use strict'; + const config = require('config'); function onCommand(args, context) { - context.bot.socket.transmit('message', { - roomId: context.room?.id, - recipient: context.message.user?.username, - body: 'Shutting down... :sleeping:', - style: config.style, - }); + if (config.platform === 'schat') { + context.sendMessage('Shutting down... :sleeping:', context.room?.id, { type: 'message', label: false }, context.message.user?.username); + } + + if (config.platform === 'irc' && context.room.id === config.user.nick) { + // if the room ID is the bot's own nickname, it's a PM and we should reply to the sender + context.sendMessage('Shutting down... 😴', context.user.id, { label: false }); + } else if (config.platform === 'irc') { + context.sendMessage('Shutting down... 😴', context.room?.id, { type: 'message', label: false }); + } context.logger.info(`Kill command used by ${context.user.username}`);