Compare commits

..

No commits in common. "c63f05fcf58343cfe9c3ff8f61c767b0acb22592" and "98c5335bc26b2d7188b584f6e0dc4f618e889bb8" have entirely different histories.

4 changed files with 5 additions and 11 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.16.1",
"version": "1.16.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.16.1",
"version": "1.16.0",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.16.1",
"version": "1.16.0",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {

View File

@ -4,13 +4,8 @@ const config = require('config');
const { version } = require('../../package.json');
function onCommand(args, context) {
const commandsByGame = Object.entries(context.games)
.filter(([command, game]) => !command.includes('-') && !game.restricted)
.reduce((acc, [command, game]) => ({ ...acc, [game.name]: [...(acc[game.name] || []), command] }), {});
const commands = Object.entries(commandsByGame)
.map(([gameName, gameCommands]) => `${gameName.slice(0, 1).toUpperCase()}${gameName.slice(1)}: ${gameCommands.map((command) => `${config.prefix}${command}`).join(', ')}`)
.join(' | ');
const commandsByGame = Object.entries(context.games).reduce((acc, [command, game]) => ({ ...acc, [game.name]: [...(acc[game.name] || []), command] }), {});
const commands = Object.entries(commandsByGame).map(([gameName, gameCommands]) => `${gameName.slice(0, 1).toUpperCase()}${gameName.slice(1)}: ${gameCommands.map((command) => `${config.prefix}${command}`).join(', ')}`).join(' | ');
context.sendMessage(`${commands}`, context.room.id, { styleCommands: true });
context.sendMessage(`Try ${config.prefix}game:help for more info, ${config.prefix}game:score [username] and ${config.prefix}game:lead for scores. | ${config.user.username} v${version} `, context.room.id, { styleCommands: true });

View File

@ -39,5 +39,4 @@ function onCommand(args, context) {
module.exports = {
name: 'Say',
onCommand,
restricted: true,
};