Compare commits
2 Commits
89dc51e3e9
...
2d48a18c16
Author | SHA1 | Date |
---|---|---|
|
2d48a18c16 | |
|
007773f38c |
|
@ -54,6 +54,7 @@ module.exports = {
|
|||
magenta: 'magenta',
|
||||
pink: 'pink',
|
||||
grey: 'shadow',
|
||||
silver: 'shadow',
|
||||
},
|
||||
trivia: {
|
||||
mode: 'first', // first or timeout
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "schat2-clive",
|
||||
"version": "1.19.1",
|
||||
"version": "1.19.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "schat2-clive",
|
||||
"version": "1.19.1",
|
||||
"version": "1.19.2",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bhttp": "^1.2.8",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "schat2-clive",
|
||||
"version": "1.19.1",
|
||||
"version": "1.19.2",
|
||||
"description": "Game host for SChat 2-powered chat sites",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -221,7 +221,7 @@ function onMessage(message, context) {
|
|||
|
||||
module.exports = {
|
||||
name: 'Mash',
|
||||
commands: ['mash', ...defineCommands, ...resolveCommands],
|
||||
commands: ['mash', 'wordmash', ...defineCommands, ...resolveCommands],
|
||||
onCommand,
|
||||
onMessage,
|
||||
help: `Resolve the anagram. Get a new mash with ${config.prefix}mash [length], look up definitions with ${config.prefix}define [word], resolve an anagram (that's not currently in play) with ${config.prefix}solve [anagram].`,
|
||||
|
|
|
@ -49,7 +49,7 @@ async function playRound(context, round = 0) {
|
|||
|
||||
const question = game.questions[round];
|
||||
|
||||
context.sendMessage(`${style.bold(style.pink(`Question ${round + 1}/${game.questions.length}`))} ${style.silver(`(${question.category})`)}: ${question.question}`, context.room.id);
|
||||
context.sendMessage(`${style.bold(style.pink(`Question ${round + 1}/${game.questions.length}`))} ${style.grey(`(${question.category})`)}: ${question.question}`, context.room.id);
|
||||
context.logger.info(`Trivia asked "${question.question}" with answer: ${question.answer}`);
|
||||
|
||||
try {
|
||||
|
|
|
@ -39,29 +39,19 @@ function shieldMethods(methods) {
|
|||
|
||||
const styleMethods = (() => {
|
||||
if (config.platform === 'irc') {
|
||||
return shieldMethods({
|
||||
return {
|
||||
...styles,
|
||||
code: bypass,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
if (config.platform === 'schat') {
|
||||
const methods = {
|
||||
return {
|
||||
bold: schatBold,
|
||||
italic: schatItalic,
|
||||
code: schatCode,
|
||||
...Object.fromEntries(Object.entries(config.schatColorAliases).map(([color, value]) => [color, (text) => schatColor(text, value)])),
|
||||
};
|
||||
|
||||
const handler = {
|
||||
get(target, prop) {
|
||||
return target[prop] || bypass;
|
||||
},
|
||||
};
|
||||
|
||||
const shieldedMethods = shieldMethods(methods);
|
||||
|
||||
return new Proxy(shieldedMethods, handler);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -74,4 +64,12 @@ const expandedMethods = {
|
|||
answer: (value) => styleMethods.bold(styleMethods.yellow(value)),
|
||||
};
|
||||
|
||||
module.exports = expandedMethods;
|
||||
const handler = {
|
||||
get(target, prop) {
|
||||
return target[prop] || bypass;
|
||||
},
|
||||
};
|
||||
|
||||
const shieldedMethods = shieldMethods(expandedMethods);
|
||||
|
||||
module.exports = new Proxy(shieldedMethods, handler);
|
||||
|
|
Loading…
Reference in New Issue