forked from SudhanPlayz/Discord-MusicBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8906bb
commit 7fc17aa
Showing
11 changed files
with
115 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,62 @@ | ||
/** | ||
* | ||
* @param {import("../lib/DiscordMusicBot")} client | ||
* @param {import("discord.js").ButtonInteraction} interaction | ||
* | ||
* @param {import("../lib/DiscordMusicBot")} client | ||
* @param {import("discord.js").ButtonInteraction} interaction | ||
*/ | ||
module.exports = async (client, interaction) => { | ||
let guild = client.guilds.cache.get(interaction.customId.split(":")[1]) | ||
let property = interaction.customId.split(":")[2] | ||
let player = client.manager.get(guild.id) | ||
let guild = client.guilds.cache.get(interaction.customId.split(":")[1]); | ||
let property = interaction.customId.split(":")[2]; | ||
let player = client.manager.get(guild.id); | ||
|
||
if(!player)return interaction.reply({ embeds: [ client.Embed("There is no player to control in this server.")] }) | ||
if (!player) | ||
return interaction.reply({ | ||
embeds: [client.Embed("There is no player to control in this server.")], | ||
}); | ||
|
||
if(property === "LowVolume"){ | ||
player.setVolume(player.volume-10) | ||
return interaction.reply({ embeds: [ client.Embed("Successfully set server volume to "+player.volume) ] }) | ||
} | ||
if (property === "LowVolume") { | ||
player.setVolume(player.volume - 10); | ||
return interaction.reply({ | ||
embeds: [ | ||
client.Embed("Successfully set server volume to " + player.volume), | ||
], | ||
}); | ||
} | ||
|
||
if(property === "Previous"){ | ||
if(!player.queue.previous)return interaction.reply({ embeds: [ client.ErrorEmbed("There is no previous played song") ] }) | ||
player.queue.unshift(player.queue.previous) | ||
player.queue.unshift(player.queue.current) | ||
player.stop() | ||
return interaction.deferUpdate() | ||
} | ||
if (property === "Previous") { | ||
if (!player.queue.previous) | ||
return interaction.reply({ | ||
embeds: [client.ErrorEmbed("There is no previous played song")], | ||
}); | ||
player.queue.unshift(player.queue.previous); | ||
player.queue.unshift(player.queue.current); | ||
player.stop(); | ||
return interaction.deferUpdate(); | ||
} | ||
|
||
if(property === "PlayAndPause"){ | ||
if(player.paused)player.play() | ||
else player.pause() | ||
return interaction.reply({ embeds: [ client.Embed(player.paused?"Paused":"Resumed")] }) | ||
} | ||
if (property === "PlayAndPause") { | ||
if (player.paused) player.play(); | ||
else player.pause(); | ||
return interaction.reply({ | ||
embeds: [client.Embed(player.paused ? "Paused" : "Resumed")], | ||
}); | ||
} | ||
|
||
if(property === "Next"){ | ||
player.stop() | ||
return interaction.deferUpdate() | ||
} | ||
if (property === "Next") { | ||
player.stop(); | ||
return interaction.deferUpdate(); | ||
} | ||
|
||
if(property === "HighVolume"){ | ||
player.setVolume(player.volume+10) | ||
return interaction.reply({ embeds: [ client.Embed("Successfully set server volume to "+player.volume) ] }) | ||
} | ||
if (property === "HighVolume") { | ||
player.setVolume(player.volume + 10); | ||
return interaction.reply({ | ||
embeds: [ | ||
client.Embed("Successfully set server volume to " + player.volume), | ||
], | ||
}); | ||
} | ||
|
||
return interaction.reply({ ephemeral: true, content: "Unknown controller option" }) | ||
} | ||
return interaction.reply({ | ||
ephemeral: true, | ||
content: "Unknown controller option", | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters