mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 09:35:35 -05:00
*music stop fix + comment packet.sender check
This commit is contained in:
parent
81fe6317fb
commit
58d5f0258e
3 changed files with 3 additions and 3 deletions
|
@ -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') {
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue