@@ -76,21 +76,18 @@ io.sockets.on("connection", function (socket) {
7676 socket . emit ( "kicked" , reason ) ;
7777 } ) ;
7878 bot . on ( "message" , function ( msg ) {
79- if ( msg . extra != undefined ) {
80- let message = msg . extra [ 0 ] . text ;
79+ let message = msg . toAnsi ( )
8180
82- const replacements = [
83- [ / & / g, "&" ] ,
84- [ / < / g, "<" ] ,
85- [ / > / g, ">" ] ,
86- [ / " / g, """ ] ,
87- ] ;
88- for ( const replacement of replacements )
89- message = message . replace ( replacement [ 0 ] , replacement [ 1 ] ) ;
90- msg . extra [ 0 ] . text = message ;
91- }
81+ const replacements = [
82+ [ / & / g, "&" ] ,
83+ [ / < / g, "<" ] ,
84+ [ / > / g, ">" ] ,
85+ [ / " / g, """ ] ,
86+ ] ;
87+ for ( const replacement of replacements )
88+ message = message . replace ( replacement [ 0 ] , replacement [ 1 ] ) ;
9289
93- socket . emit ( "msg" , convert . toHtml ( msg . toAnsi ( ) ) ) ;
90+ socket . emit ( "msg" , convert . toHtml ( message ) ) ;
9491 } ) ;
9592 bot . on ( "experience" , function ( ) {
9693 socket . emit ( "xp" , bot . experience ) ;
@@ -183,7 +180,8 @@ io.sockets.on("connection", function (socket) {
183180 clearInterval ( interval ) ;
184181 console . log ( `[\x1b[31m-\x1b[0m] ${ query . nick } ` ) ;
185182 bot . end ( ) ;
186- } catch ( error ) { }
183+ } catch ( error ) {
184+ }
187185 } ) ;
188186 socket . on ( "dig" , function ( pos ) {
189187 var block = bot . blockAt ( vec3 ( pos [ 0 ] , pos [ 1 ] - 16 , pos [ 2 ] ) ) ;
0 commit comments