diff --git a/src/games/mash.js b/src/games/mash.js index 9b5022f..b2dbea7 100755 --- a/src/games/mash.js +++ b/src/games/mash.js @@ -35,7 +35,7 @@ function start(length, context, attempt = 0) { if (answers.some((answer) => answer.word === anagram)) { if (attempt >= 10) { - context.sendMessage(`Sorry, I did not find a mashable ${length}-letter word`); + context.sendMessage(`Sorry, I did not find a mashable ${length}-letter word`, context.room.id); return; } diff --git a/src/play.js b/src/play.js index 2dd1252..9fa8ff4 100755 --- a/src/play.js +++ b/src/play.js @@ -117,6 +117,11 @@ async function getGames(bot, identifier) { const sendMessage = (body, roomId, options, recipient) => { const curatedBody = curateMessageBody(body, game, key, options); + if (!roomId && !recipient) { + logger.error(`Missing room ID or recipient for message: ${body}`); + return; + } + if (config.platform === 'irc') { bot.client.say(/^#/.test(roomId) ? roomId : recipient, curatedBody); }