Added Hunt (hangman) game.
This commit is contained in:
20
src/games/parrot.js
Normal file
20
src/games/parrot.js
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
const Markov = require('markov-strings').default;
|
||||
const sentences = require('../../assets/markov-data.json');
|
||||
|
||||
const markov = new Markov();
|
||||
|
||||
markov.addData(sentences);
|
||||
|
||||
function onCommand(args, context) {
|
||||
const result = markov.generate({ maxTries: 100 });
|
||||
|
||||
console.log(result);
|
||||
|
||||
context.sendMessage(result.string, context.room.id);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
onCommand,
|
||||
};
|
||||
Reference in New Issue
Block a user