mirror of
https://github.com/MinazukiAmane/Tinasha-Bot.git
synced 2025-03-15 08:55:57 +08:00
the resume button should in the disconnect not in trackend lols
This commit is contained in:
parent
24e98fad90
commit
db7f036697
@ -1,4 +1,5 @@
|
||||
const Queue = require("@src/database/schemas/Queue");
|
||||
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } = require("discord.js");
|
||||
|
||||
module.exports = async (client, player) => {
|
||||
const guild = client.guilds.cache.get(player.guildId);
|
||||
@ -36,4 +37,24 @@ module.exports = async (client, player) => {
|
||||
if (msg && msg.deletable) {
|
||||
await msg.delete().catch(() => {});
|
||||
}
|
||||
|
||||
// Send a message with a button to resume playback
|
||||
const channel = guild.channels.cache.get(player.textChannelId);
|
||||
if (channel) {
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("resume")
|
||||
.setLabel("Resume Music")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
);
|
||||
|
||||
await channel.safeSend({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setColor(EMBED_COLORS.BOT_EMBED)
|
||||
.setDescription("The music has stopped due to a disconnection. You can resume it by clicking the button below.")
|
||||
],
|
||||
components: [row]
|
||||
});
|
||||
}
|
||||
};
|
@ -1,6 +1,5 @@
|
||||
const { autoplayFunction } = require("@handlers/player");
|
||||
const { MUSIC, EMBED_COLORS } = require("@root/config.js");
|
||||
const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder } = require("discord.js");
|
||||
const { MUSIC } = require("@root/config.js");
|
||||
const Queue = require("@src/database/schemas/Queue");
|
||||
|
||||
module.exports = async (client, player, track) => {
|
||||
@ -33,26 +32,6 @@ module.exports = async (client, player, track) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Send a message with a button to resume playback
|
||||
const channel = guild.channels.cache.get(player.textChannelId);
|
||||
if (channel) {
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("resume")
|
||||
.setLabel("Resume Music")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
);
|
||||
|
||||
await channel.safeSend({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setColor(EMBED_COLORS.BOT_EMBED)
|
||||
.setDescription("The music has stopped. You can resume it by clicking the button below.")
|
||||
],
|
||||
components: [row]
|
||||
});
|
||||
}
|
||||
|
||||
if (player.get("autoplay") === true) {
|
||||
await autoplayFunction(client, track, player);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user