Added HTML colors for SChat. Adapted Letters game for SChat.
This commit is contained in:
@@ -22,7 +22,7 @@ const games = new Map();
|
||||
function getBoard(context) {
|
||||
const game = games.get(context.room.id);
|
||||
|
||||
return `${style.grey('[')} ${game.word.split('').concat(Array.from({ length: config.letters.length - game.word.length })).map((letter) => letter?.toUpperCase() || ' ').join(style.grey(' | '))} ${style.grey(']')}`;
|
||||
return `${style.grey('[')} ${game.word.split('').concat(Array.from({ length: config.letters.length - game.word.length })).map((letter) => style.bold(letter?.toUpperCase()) || ' ').join(style.grey(' | '))} ${style.grey(']')}`; // eslint-disable-line no-irregular-whitespace
|
||||
}
|
||||
|
||||
function countLetters(word) {
|
||||
@@ -158,6 +158,10 @@ function onCommand(args, context) {
|
||||
function onMessage(message, context) {
|
||||
const game = games.get(context.room.id);
|
||||
|
||||
if (message.type !== 'message' || context.user?.id === config.user?.id) { // stop listening to yourself
|
||||
return;
|
||||
}
|
||||
|
||||
if (game?.state === 'letters') {
|
||||
const multi = message.body.match(/\b[vc]{2,}\b/i)?.[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user