From 58d5f0258e9b3009cd889404de1c813dcde73384 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Tue, 16 Aug 2022 17:14:04 +0700 Subject: [PATCH] *music stop fix + comment packet.sender check --- commands/music.js | 1 + plugins/chat.js | 4 ++-- plugins/music.js | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/music.js b/commands/music.js index aa5bf12..bf77a18 100644 --- a/commands/music.js +++ b/commands/music.js @@ -71,6 +71,7 @@ module.exports = { playUrl(bot, args.slice(1)); } if (args[0]==='stop') { + bot.core.run('minecraft:tellraw @a ' + JSON.stringify([{text: 'Stopped playing '}, {text: bot.music.song.name, color: 'gold'}])); bot.music.stop(); } if (args[0]==='loop') { diff --git a/plugins/chat.js b/plugins/chat.js index ab57af6..c87e042 100644 --- a/plugins/chat.js +++ b/plugins/chat.js @@ -19,14 +19,14 @@ function inject(bot) { try { const raw = message.toMotd().substring(0, 32767); if (raw.match(/<.*§r> .*/g)) { - if (packet.sender === '00000000-0000-0000-0000-000000000000') return; + // if (packet.sender === '00000000-0000-0000-0000-000000000000') return; const username = raw.substr(3).split('§r>')[0]; const message = raw.split('§r> §r')[1]; bot.emit('message', username, message, packet.sender); } else if (raw.match(/<.*> .*/g)) { - if (packet.sender === '00000000-0000-0000-0000-000000000000') return; + // if (packet.sender === '00000000-0000-0000-0000-000000000000') return; const username = raw.substr(3).split('>')[0]; const message = raw.split('> ')[1]; diff --git a/plugins/music.js b/plugins/music.js index f4b0570..c79cb1a 100644 --- a/plugins/music.js +++ b/plugins/music.js @@ -67,7 +67,6 @@ function inject(bot) { }; bot.music.stop = function() { - bot.core.run('minecraft:tellraw @a ' + JSON.stringify([{text: 'Stopped playing '}, {text: bot.music.song.name, color: 'gold'}])); bot.music.song = null; bot.music.loop = false; resetTime();