mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-28 08:48:30 +02:00
Updated readme screenshot
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module.exports = function(socket) {
|
||||
module.exports = (socket) => {
|
||||
|
||||
socket.mcbot.on('end', function() {
|
||||
socket.mcbot.on('end', () => {
|
||||
socket.emit('bot:disconnect');
|
||||
delete socket.mcbot;
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = function(socket) {
|
||||
module.exports = (socket) => {
|
||||
|
||||
// login event
|
||||
socket.mcbot.on('login', function() {
|
||||
socket.mcbot.on('login', () => {
|
||||
socket.emit('buffer:success', 'Successfully logged in as ' + socket.mcbot.username + ' with entity id ' + socket.mcbot.entity.id);
|
||||
socket.emit('bot:connect', {
|
||||
host: socket.connectionParams.hostname,
|
||||
|
||||
@@ -4,10 +4,10 @@ var parseExtra = require('../../parsers/extra');
|
||||
|
||||
var escapeHtml = require('../../utils').escapeHtml;
|
||||
|
||||
module.exports = function(socket) {
|
||||
module.exports = (socket) => {
|
||||
|
||||
// message event
|
||||
socket.mcbot.on('message', function(message) {
|
||||
socket.mcbot.on('message', (message) => {
|
||||
|
||||
// empty buffer
|
||||
var buffer = '';
|
||||
@@ -40,7 +40,7 @@ module.exports = function(socket) {
|
||||
buffer = escapeHtml(buffer);
|
||||
|
||||
// format the buffer with the correct coloring
|
||||
buffer = buffer.replace(/§([0-9abcdef])([^§]*)/ig, function replace(regex, color, msg) {
|
||||
buffer = buffer.replace(/§([0-9abcdef])([^§]*)/ig, (regex, color, msg) => {
|
||||
return '<span class="color-' + color + '">' + msg.replace(/ /g, ' ') + '</span>';
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = function(socket) {
|
||||
module.exports = (socket) => {
|
||||
|
||||
// spawn event
|
||||
socket.mcbot.on('spawn', function() {
|
||||
socket.mcbot.on('spawn', () => {
|
||||
var pos = socket.mcbot.entity.position;
|
||||
socket.emit('buffer:info', 'Spawned at X:' + pos.x + ', Y:' + pos.y + ', Z:' + pos.z);
|
||||
socket.emit('bot:players', socket.mcbot.players);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
var message = require('./events/message');
|
||||
var end = require('./events/end');
|
||||
|
||||
module.exports = function(socket) {
|
||||
module.exports = (socket) => {
|
||||
|
||||
login(socket);
|
||||
spawn(socket);
|
||||
|
||||
Reference in New Issue
Block a user