mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-06-01 18:58:27 +02:00
Send chat message when joining (yes, branding)
This commit is contained in:
@@ -6,9 +6,9 @@ module.exports = function($scope, socket) {
|
||||
|
||||
$scope.chat = '';
|
||||
|
||||
if (window.location.hostname === 'chat.alexkvazos.com') {
|
||||
socket.emit('chat', { message: 'Connected via web chat client / chat.alexkvazos.me.' });
|
||||
}
|
||||
socket.on('bot:spawn', function() {
|
||||
socket.emit('chat', { message: 'Connected via MinecraftChat - https://chat.alexkvazos.com' });
|
||||
});
|
||||
|
||||
$scope.send = function() {
|
||||
if ($scope.chat.trim().length > 0) {
|
||||
|
||||
@@ -4,6 +4,7 @@ module.exports = function(socket) {
|
||||
socket.mcbot.on('spawn', function() {
|
||||
var pos = socket.mcbot.entity.position;
|
||||
socket.emit('buffer:info', 'Spawned at X:' + pos.x + ', Y:' + pos.y + ', Z:' + pos.z);
|
||||
socket.emit('bot:spawn');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user