*music stop fix + comment packet.sender check

This commit is contained in:
ChomeNS 2022-08-16 17:14:04 +07:00
parent 81fe6317fb
commit 58d5f0258e
3 changed files with 3 additions and 3 deletions

View file

@ -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') {

View file

@ -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];

View file

@ -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();