2.1.0 • Published 4 years ago
bombparty v2.1.0
Installation
npm i bombparty
Afterwards, get into the doc directory to look into the API Reference.
Example
const BombParty = require('bombparty')
const client = new BombParty()
// It will connect to a guest account
// Please use:
// new BombParty({ secret: 'NuclearHub.sid COOKIE HERE!' })
// in order to use a real user account
client.on('room', function(room) {
room.say('Namasté!')
// Triggered on commands, check API Reference for more info.
room.on('command', function(user, command) {
room.say(`Command from ${user.name}: ${command}`)
})
// Triggered once a player is required to play.
room.on('game.turn', function(player) {
room.say(`You need to play, ${player.name}!`)
})
})
client.join('chipolata')
// This will join the room 'chipolata'