mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54:55 -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;
|
time = 0;
|
||||||
startTime = 0;
|
startTime = 0;
|
||||||
noteIndex = 0;
|
noteIndex = 0;
|
||||||
setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
try {
|
try {
|
||||||
if (!bot.music.song) return;
|
if (!bot.music.song) return;
|
||||||
time = Date.now() - startTime;
|
time = Date.now() - startTime;
|
||||||
|
@ -52,6 +52,10 @@ function inject(bot) {
|
||||||
}
|
}
|
||||||
}, 20);
|
}, 20);
|
||||||
|
|
||||||
|
bot.on('end', () => {
|
||||||
|
clearInterval(interval);
|
||||||
|
});
|
||||||
|
|
||||||
bot.music.load = function(buffer, fallbackName = '[unknown]') {
|
bot.music.load = function(buffer, fallbackName = '[unknown]') {
|
||||||
// TODO: NBS Support
|
// TODO: NBS Support
|
||||||
const midi = new Midi(buffer);
|
const midi = new Midi(buffer);
|
||||||
|
|
Loading…
Reference in a new issue