Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some new magmastream things (: #563

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"genius-lyrics-api": "^3.0.6",
"i18next": "^23.5.1",
"i18next-node-fs-backend": "^2.1.3",
"magmastream": "^2.4.0",
"magmastream": "^2.5.5",
"moment": "^2.29.1",
"mongoose": "^7.5.2",
"puppeteer": "^21.3.1",
Expand All @@ -54,4 +54,4 @@
"utf-8-validate": "^6.0.3",
"zlib-sync": "^0.1.8"
}
}
}
10 changes: 4 additions & 6 deletions src/commands/Music/autoplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ class Autoplay extends Command {

// toggle autoplay mode off and on
const player = bot.manager?.players.get(message.guild.id);
player.autoplay = !player.autoplay;
player.setAutoplay(player.autoplay, bot.user);
message.channel.send(message.translate('music/autoplay:RESP', { TOGGLE: player.autoplay }));
player.setAutoplay(!player.isAutoplay, bot.user);
message.channel.send(message.translate('music/autoplay:RESP', { TOGGLE: player.isAutoplay }));
}

/**
Expand All @@ -61,9 +60,8 @@ class Autoplay extends Command {

// toggle autplay mode off and on
const player = bot.manager?.players.get(member.guild.id);
player.autoplay = !player.autoplay;
player.setAutoplay(player.autoplay, bot.user);
await interaction.reply({ content: guild.translate('music/autoplay:RESP', { TOGGLE: player.autoplay }) });
player.setAutoplay(!player.isAutoplay, bot.user);
await interaction.reply({ content: guild.translate('music/autoplay:RESP', { TOGGLE: player.isAutoplay }) });
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/events/audio/trackStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class TrackStart extends Event {
.setTitle('music/np:AUTHOR')
.setDescription(`[${track.title}](${track.uri}) [${bot.guilds.cache.get(player.guild).members.cache.get(track.requester.id)}]`);

bot.channels.cache.get(player.textChannel)?.send({ embeds: [embed] })
.then(m => m.timedDelete({ timeout: (track.duration < 6.048e+8) ? track.duration : 60000 }));
const message = await bot.channels.cache.get(player.textChannel)?.send({ embeds: [embed] }).catch();

player.setNowPlayingMessage(message);

// clear timeout (for queueEnd event)
if (player.timeout != null) return clearTimeout(player.timeout);
Expand Down
2 changes: 0 additions & 2 deletions src/structures/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module.exports = Structure.extend('Player', Player => {
this.nightcore = false;
this.slowmo = false;
this.vaporwave = false;
// for Autoplay
this.autoplay = false;
}

// update bassboost filter
Expand Down