Added Rock, Paper, Scissors.

This commit is contained in:
2022-10-24 01:55:30 +02:00
parent 29f69fa40a
commit 6428c01e6c
8 changed files with 83 additions and 11 deletions

View File

@@ -16,8 +16,8 @@ function onCommand(args, context) {
return;
}
if (rolls > config.dice.maxFaces) {
context.sendMessage(`Your dice can have at most ${config.dice.maxFace} faces`, context.room.id);
if (faces > config.dice.maxFaces) {
context.sendMessage(`Your dice can have at most ${config.dice.maxFaces} faces`, context.room.id);
return;
}
@@ -28,10 +28,11 @@ function onCommand(args, context) {
return `${style.grey(dieFaces[result - 1] || '☐')} ${style.bold(result)}`; // eslint-disable-line no-irregular-whitespace
});
context.sendMessage(results.join(' | '), context.room.id);
context.sendMessage(results.join(style.grey(' | ')), context.room.id);
}
module.exports = {
onCommand,
commands: ['dice', 'die', 'roll'],
help: 'What\'s your next move? Try ~dice [rolls] [faces], ~die or ~roll',
};