Skip to content

Commit

Permalink
Development (SudhanPlayz#174)
Browse files Browse the repository at this point in the history
* 24/7 Stay in vc stuff

* edits and fixes (SudhanPlayz#168)

* add: YouTube Tutorial at readme

* Master branch to development (SudhanPlayz#171)

* Latest commits to fix stuff (SudhanPlayz#169)

* 24/7 Stay in vc stuff

* edits and fixes (SudhanPlayz#168)

Co-authored-by: Joseph <[email protected]>

* ;-; (SudhanPlayz#170)

* 24/7 Stay in vc stuff

* edits and fixes (SudhanPlayz#168)

* add: YouTube Tutorial at readme

Co-authored-by: Joseph <[email protected]>

Co-authored-by: Joseph <[email protected]>

* temporarily removed line (SudhanPlayz#172)

* edits and fixes

* temporarily removed line

* fix: Lyrics cmd by @Reyansh-Khobragade

Co-authored-by: Joseph <[email protected]>
  • Loading branch information
SudhanPlayz and joeyk710 authored May 3, 2021
1 parent e770157 commit a83d921
Showing 1 changed file with 47 additions and 45 deletions.
92 changes: 47 additions & 45 deletions commands/lyrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,51 +49,53 @@ module.exports = {
return message.channel.send(Pages[0]);
else return client.Pagination(message, Pages);
},

SlashCommand: {
options: [
{
name: "song",
description: "Get the lyrics of a song",
required: false,
options: [
],

/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/

run: async (client, interaction, args, { GuildDB }) => {
let player = await client.Manager.get(message.guild.id);
let SongTitle = args.join(" ");
if (!args[0] && !player)
return interaction.send("Nothing is playing right now...");
if (!args[0]) SongTitle = player.queue.current.title;

let lyrics = await lyricsFinder(SongTitle);
if (!lyrics)
return interaction.send("No lyrics found for " + SongTitle);
lyrics = lyrics.split("\n"); //spliting into lines
let SplitedLyrics = _.chunk(lyrics, 45); //45 lines each page

let Pages = SplitedLyrics.map((ly) => {
let em = new MessageEmbed()
.setAuthor(SongTitle + " — Lyrics", client.config.IconURL)
.setColor("RANDOM")
.setDescription(ly.join("\n"));

if (args.join(" ") !== SongTitle)
em.setThumbnail(player.queue.current.displayThumbnail());

return em;
});

if (!Pages.length || Pages.length === 1)
return interaction.send(Pages[0]);
else return client.Pagination(message, Pages);
}}],

{
name: "song",
value: "song",
type: 3,
description: "Get the lyrics of a song",
required: false,
},

],
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/

run: async (client, interaction, args, { GuildDB }) => {
let player = await client.Manager.get(interaction.guild_id);
let SongTitle = interaction.data.options[0].value
if (!SongTitle && !player)
return interaction.send("Nothing is playing right now...");
if (!SongTitle) SongTitle = player.queue.current.title;

let lyrics = await lyricsFinder(SongTitle);
if (!lyrics)
return interaction.send("No lyrics found for " + SongTitle);
lyrics = lyrics.split("\n"); //spliting into lines
let SplitedLyrics = _.chunk(lyrics, 45); //45 lines each page

let Pages = SplitedLyrics.map((ly) => {
let em = new MessageEmbed()
.setAuthor(SongTitle + " — Lyrics", client.config.IconURL)
.setColor("RANDOM")
.setDescription(ly.join("\n"));

if (SongTitle !== SongTitle)
em.setThumbnail(player.queue.current.displayThumbnail());

return em;
});

return interaction.send(Pages[0]);
}
}
}
};

0 comments on commit a83d921

Please sign in to comment.