mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 15:47:57 -05:00
bot.on('end')
This commit is contained in:
parent
57a91fd3c9
commit
e8e1321791
1 changed files with 5 additions and 1 deletions
|
@ -28,7 +28,7 @@ function inject(bot) {
|
|||
time = 0;
|
||||
startTime = 0;
|
||||
noteIndex = 0;
|
||||
setInterval(() => {
|
||||
const interval = setInterval(() => {
|
||||
try {
|
||||
if (!bot.music.song) return;
|
||||
time = Date.now() - startTime;
|
||||
|
@ -52,6 +52,10 @@ function inject(bot) {
|
|||
}
|
||||
}, 20);
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval);
|
||||
});
|
||||
|
||||
bot.music.load = function(buffer, fallbackName = '[unknown]') {
|
||||
// TODO: NBS Support
|
||||
const midi = new Midi(buffer);
|
||||
|
|
Loading…
Reference in a new issue