Skip to content

Commit d7dafdb

Browse files
authored
Add files via upload
1 parent d753b8e commit d7dafdb

File tree

24 files changed

+730
-99
lines changed

24 files changed

+730
-99
lines changed

commands/Information/aliases.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@ module.exports = {
1515
//SONG CMD
1616
let string1 = `\`\`\`fix
1717
!disconnect -- dc, leave, dis
18+
!forward -- fwd
19+
!grab -- save, yoink
20+
!loop -- repeat
21+
!lyrics -- l, ly
22+
!nowplaying -- np
1823
!pause -- stop
1924
!play -- p
25+
!playskip -- ps, pskip, playnow, pn
26+
!playtop -- ptop, pt
27+
!replay -- Resets the progress of the current song
2028
!resume -- continue, re, res
29+
!rewind -- rwd
30+
!search -- find
31+
!seek --
32+
!skip -- next, s
33+
!soundcloud -- sc
2134
\`\`\``
2235
//QUEUE CMD
2336
let string2 = `\`\`\`fix

commands/Information/commands.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@ module.exports = {
1515
//SONG CMD
1616
let string1 = `\`\`\`fix
1717
!disconnect -- Disconnects the bot from the voice channel
18+
!forward -- Forwards by a certain amount of time
19+
!grab -- Saves the current playing song to your DMs
20+
!loop -- Toggles looping for the current playing song
21+
!lyrics -- Shows The Lyrics of the current track
22+
!nowplaying -- Shows what song Rythm is currently playing
1823
!pause -- Pauses the current playing track
19-
!play -- Plays a song from youtube
24+
!play -- Play a song from YouTube with the given name/url
25+
!playskip -- Skips the current song and plays the song
26+
!playtop -- Adds a song with the given query on top of queue
27+
!replay -- Resets the progress of the current song
2028
!resume -- Resumes paused music
29+
!rewind -- Rewinds by a certain amount of time
30+
!search -- Searches from Youtube for a song via your query
31+
!seek -- Seeks to a certain point in the current track
32+
!skip -- Votes to skip the current playing song
33+
!soundcloud -- Play a song from SounCloud with the given name/url
2134
\`\`\``
2235
//QUEUE CMD
2336
let string2 = `\`\`\`fix

commands/Queue/clear.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ module.exports = {
99
const { channel } = message.member.voice;
1010
//if he is not connected to a vc return error
1111
if (!channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
12+
//send error if member is Deafed
13+
if(message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
1214
//get voice channel of the bot
1315
const botchannel = message.guild.me.voice.channel;
1416
//get the music player
1517
const player = client.manager.players.get(message.guild.id);
1618
//if no player or no botchannel return error
17-
if(!player || !botchannel) return message.channel.send(`:x: **I am not playing anything.**`);
19+
if(!player || !botchannel) return message.channel.send(`**:x: Nothing playing in this server**`);
1820
//if queue size too small return error
19-
if(!player.current < 1) return message.channel.send(`:x: **I am not playing anything.**`);
21+
if(!player.current < 1) return message.channel.send(`**:x: Nothing playing in this server**`);
2022
//if user is not in the right channel as bot, then return error
2123
if(player && channel.id !== player.voiceChannel)
2224
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);

commands/Queue/loopqueue.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ module.exports = {
99
const { channel } = message.member.voice;
1010
//if he is not connected to a vc return error
1111
if (!channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
12+
//send error if member is Deafed
13+
if(message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
1214
//get voice channel of the bot
1315
const botchannel = message.guild.me.voice.channel;
1416
//get the music player
1517
const player = client.manager.players.get(message.guild.id);
1618
//if no player or no botchannel return error
17-
if(!player || !botchannel) return message.channel.send(`:x: **I am not playing anything.**`);
19+
if(!player || !botchannel) return message.channel.send(`**:x: Nothing playing in this server**`);
1820
//if queue size too small return error
19-
if(!player.current < 1) return message.channel.send(`:x: **I am not playing anything.**`);
21+
if(!player.current < 1) return message.channel.send(`**:x: Nothing playing in this server**`);
2022
//if user is not in the right channel as bot, then return error
2123
if(player && channel.id !== player.voiceChannel)
2224
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);

commands/Queue/shuffle.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ module.exports = {
99
const { channel } = message.member.voice;
1010
//if he is not connected to a vc return error
1111
if (!channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
12+
//send error if member is Deafed
13+
if(message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
1214
//get voice channel of the bot
1315
const botchannel = message.guild.me.voice.channel;
1416
//get the music player
1517
const player = client.manager.players.get(message.guild.id);
1618
//if no player or no botchannel return error
17-
if(!player || !botchannel) return message.channel.send(`:x: **I am not playing anything.**`);
19+
if(!player || !botchannel) return message.channel.send(`**:x: Nothing playing in this server**`);
1820
//if queue size too small return error
19-
if(!player.current < 1) return message.channel.send(`:x: **I am not playing anything.**`);
21+
if(!player.current < 1) return message.channel.send(`**:x: Nothing playing in this server**`);
2022
//if user is not in the right channel as bot, then return error
2123
if(player && channel.id !== player.voiceChannel)
2224
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);

commands/Song/disconnect.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ module.exports = {
99
const { channel } = message.member.voice;
1010
//if he is not connected to a vc return error
1111
if (!channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
12+
//send error if member is Deafed
13+
if(message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
1214
//get voice channel of the bot
1315
const botchannel = message.guild.me.voice.channel;
1416
//get the music player
1517
const player = client.manager.players.get(message.guild.id);
1618
//if no player or no botchannel return error
17-
if(!player || !botchannel) return message.channel.send(`:x: **I am not playing anything.**`);
19+
if(!player || !botchannel) return message.channel.send(`**:x: Nothing playing in this server**`);
1820
//if queue size too small return error
19-
if(!player.current < 1) return message.channel.send(`:x: **I am not playing anything.**`);
21+
if (!player.queue || !player.queue.current) return message.channel.send(`**:x: Nothing playing in this server**`);
2022
//if user is not in the right channel as bot, then return error
2123
if(player && channel.id !== player.voiceChannel)
2224
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);

commands/Song/forward.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
const {
2+
MessageEmbed
3+
} = require(`discord.js`)
4+
const config = require(`../../botconfig/config.json`)
5+
const ee = require(`../../botconfig/embed.json`);
6+
const {
7+
createBar,
8+
format
9+
} = require(`../../handlers/functions`);
10+
module.exports = {
11+
name: `forward`,
12+
category: `Song`,
13+
aliases: [`fwd`],
14+
description: `Forwards by a certain amount of time in the current track.`,
15+
usage: `forward <time>`,
16+
run: async (client, message, args, cmduser, text, prefix) => {
17+
//get the voice channel of the member
18+
const { channel } = message.member.voice;
19+
//if he is not connected to a vc return error
20+
if (!channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
21+
//send error if member is Deafed
22+
if(message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
23+
//get voice channel of the bot
24+
const botchannel = message.guild.me.voice.channel;
25+
//get the music player
26+
const player = client.manager.players.get(message.guild.id);
27+
//if no player or no botchannel return error
28+
if(!player || !botchannel) return message.channel.send(`**:x: Nothing playing in this server**`);
29+
//if queue size too small return error
30+
if (!player.queue || !player.queue.current) return message.channel.send(`**:x: Nothing playing in this server**`);
31+
//if user is not in the right channel as bot, then return error
32+
if(player && channel.id !== player.voiceChannel)
33+
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);
34+
//if invalid usage
35+
if (!args[0]) {
36+
let string = `${prefix}forward <Time in seconds>`
37+
let embed = new MessageEmbed()
38+
.setTitle("**:x: Invalid usage**")
39+
.setDescription(string)
40+
.setColor("#ff0000")
41+
if(message.guild.me.hasPermission("EMBED_LINKS")){
42+
message.channel.send(embed)
43+
}else{
44+
message.channel.send("**:x: Invalid usage**\n"+string)
45+
}
46+
}
47+
//get the seektime variable of the user input
48+
let seektime = Number(player.position) + Number(args[0]) * 1000;
49+
//if the userinput is smaller then 0, then set the seektime to just the player.position
50+
if (Number(args[0]) <= 0) seektime = Number(player.position);
51+
//if the seektime is too big, then set it 1 sec earlier
52+
if (Number(seektime) >= player.queue.current.duration)
53+
return message.channel.send(`**:x: Time cannot be longer than the song**`);
54+
//seek to the new Seek position
55+
player.seek(Number(seektime));
56+
//Send Success Message
57+
return message.channel.send(`**:musical_note: Set position to \`${format(player.position)}\` :fast_forward:**`);
58+
}
59+
};
60+
/**
61+
* @INFO
62+
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js
63+
* @INFO
64+
* Work for Milrato Development | https://milrato.eu
65+
* @INFO
66+
* Please mention Him / Milrato Development, when using this Code!
67+
* @INFO
68+
*/

commands/Song/grab.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const {
2+
MessageEmbed
3+
} = require(`discord.js`);
4+
const config = require(`../../botconfig/config.json`);
5+
const ee = require(`../../botconfig/embed.json`);
6+
const {
7+
createBar,
8+
format
9+
} = require(`../../handlers/functions`);
10+
module.exports = {
11+
name: `grab`,
12+
category: `Song`,
13+
aliases: [`save`, `yoink`],
14+
description: `Saves the current playing song to your Direct Messages`,
15+
usage: `grab`,
16+
run: async (client, message, args, cmduser, text, prefix) => {
17+
//get the voice channel of the member
18+
const { channel } = message.member.voice;
19+
//if he is not connected to a vc return error
20+
if (!channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
21+
//send error if member is Deafed
22+
if(message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
23+
//get voice channel of the bot
24+
const botchannel = message.guild.me.voice.channel;
25+
//get the music player
26+
const player = client.manager.players.get(message.guild.id);
27+
//if no player or no botchannel return error
28+
if(!player || !botchannel) return message.channel.send(`**:x: Nothing playing in this server**`);
29+
//if queue size too small return error
30+
if (!player.queue || !player.queue.current) return message.channel.send(`**:x: Nothing playing in this server**`);
31+
//if user is not in the right channel as bot, then return error
32+
if(player && channel.id !== player.voiceChannel)
33+
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);
34+
//Send Information Message
35+
let date = `${new Date().getFullYear()}-${String(new Date().getMonth()).length ==1 ? "0" + new Date().getMonth() : new Date().getMonth()}-${String(new Date().getDate()).length ==1 ? "0" + new Date().getDate() : new Date().getDate()}`;
36+
message.author.send(new MessageEmbed()
37+
.setThumbnail(`https://img.youtube.com/vi/${player.queue.current.identifier}/mqdefault.jpg`)
38+
.setURL("https://milrato.eu")
39+
.setColor("GREEN")
40+
.setTitle("Song saved :musical_note:")
41+
.setDescription(`[${player.queue.current.title.split("[").join("\[").split("]").join("\]")}](${player.queue.current.uri})\n\n\`Length:\` ${format(player.queue.current.duration).split(" | ")[0]}\n\n\`Requested by:\` ${player.queue.current.requester.username} (${player.queue.current.requester.tag})`)
42+
.setFooter(`${date} - ${message.guild.name}`)
43+
).catch(e=>{
44+
return message.channel.send("**:x: Your Dm's are disabled**")
45+
})
46+
47+
message.react("📭").catch(e=>console.log("Could not react"))
48+
}
49+
};
50+
/**
51+
* @INFO
52+
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js
53+
* @INFO
54+
* Work for Milrato Development | https://milrato.eu
55+
* @INFO
56+
* Please mention Him / Milrato Development, when using this Code!
57+
* @INFO
58+
*/

commands/Song/loop.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
name: `loop`,
3+
category: `Queue`,
4+
aliases: ["repeat"],
5+
description: `Toggles looping for the current playing song.`,
6+
usage: `loop`,
7+
run: async (client, message, args, cmduser, text, prefix) => {
8+
//get the voice channel of the member
9+
const { channel } = message.member.voice;
10+
//if he is not connected to a vc return error
11+
if (!channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
12+
//send error if member is Deafed
13+
if(message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
14+
//get voice channel of the bot
15+
const botchannel = message.guild.me.voice.channel;
16+
//get the music player
17+
const player = client.manager.players.get(message.guild.id);
18+
//if no player or no botchannel return error
19+
if(!player || !botchannel) return message.channel.send(`**:x: Nothing playing in this server**`);
20+
//if queue size too small return error
21+
if(!player.current < 1) return message.channel.send(`**:x: Nothing playing in this server**`);
22+
//if user is not in the right channel as bot, then return error
23+
if(player && channel.id !== player.voiceChannel)
24+
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);
25+
//if bot connected bot not with the lavalink player then try to delete the player
26+
if(player && botchannel && channel.id !== botchannel.id){
27+
player.destroy();
28+
}
29+
//change Queue Mode
30+
player.setTrackRepeat(!player.trackRepeat);
31+
//Send Success Message
32+
return message.channel.send(`**${player.trackRepeat ? `:repeat_one: Enabled` : `:repeat_one: Disabled`}**`);
33+
}
34+
};
35+
/**
36+
* @INFO
37+
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js
38+
* @INFO
39+
* Work for Milrato Development | https://milrato.eu
40+
* @INFO
41+
* Please mention Him / Milrato Development, when using this Code!
42+
* @INFO
43+
*/

commands/Song/lyrics.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
const {
2+
MessageEmbed, Message, splitMessage
3+
} = require(`discord.js`);
4+
const config = require(`../../botconfig/config.json`);
5+
const {
6+
KSoftClient
7+
} = require(`@ksoft/api`);
8+
const ee = require(`../../botconfig/embed.json`);
9+
const {
10+
format,
11+
delay
12+
} = require(`../../handlers/functions`);
13+
module.exports = {
14+
name: `lyrics`,
15+
category: `Song`,
16+
aliases: [`l`, `ly`],
17+
description: `Shows The Lyrics of the current track`,
18+
usage: `lyrics [Songtitle]`,
19+
cooldown: 15,
20+
run: async (client, message, args, cmduser, text, prefix) => {
21+
//get the voice channel of the member
22+
const { channel } = message.member.voice;
23+
//if he is not connected to a vc return error
24+
if (!args[0] && !channel) return message.channel.send(`:x: **You have to be in a voice channel to use this command.**`);
25+
//send error if member is Deafed
26+
if(!args[0] && message.member.voice.selfDeaf) return message.channel.send(`:x: **You cannot run this command while deafened**`);
27+
//get voice channel of the bot
28+
const botchannel = message.guild.me.voice.channel;
29+
//get the music player
30+
const player = client.manager.players.get(message.guild.id);
31+
//if no player or no botchannel return error
32+
if(!args[0] && (!player || !botchannel)) return message.channel.send(`**:x: Nothing playing in this server**`);
33+
//if queue size too small return error
34+
if (!args[0] && (!player.queue || !player.queue.current)) return message.channel.send(`**:x: Nothing playing in this server**`);
35+
//if user is not in the right channel as bot, then return error
36+
if(!args[0] && (player && channel.id !== player.voiceChannel))
37+
return message.channel.send(`**:x: You need to be in the same voice channel as Milrato x Rythm to use this command**`);
38+
//if bot connected bot not with the lavalink player then try to delete the player
39+
if(!args[0] && (player && botchannel && channel.id !== botchannel.id)){
40+
player.destroy();
41+
}
42+
//get the Song Title
43+
let title = args[0] || player.queue.current.title || "404";
44+
if(title == "404") return message.channel.send(`**:x: Something went wrong**`);
45+
//if there are search terms, search for the lyrics
46+
if (args[0]) {
47+
//get the new title
48+
title = args.join(` `);
49+
}
50+
//set the lyrics temp. to null
51+
let lyrics = null;
52+
//send info msg
53+
let lyricsmsg = await message.channel.send(`**:mag: Searching lyrics for \`${title}\`**`).catch(e=>console.log("error"))
54+
//if there is the use of lyrics_finder
55+
//create a new Ksoft Client
56+
const ksoft = new KSoftClient(config.ksoftapi);
57+
//get the lyrics
58+
await ksoft.lyrics.get(title).then(async (track) => {
59+
//send error if no lyrics
60+
if (!track.lyrics) return lyricsmsg.edit(`**:x: No Lyrics found for:** \`${title}\``).catch(e=>console.log("error"))
61+
//safe the lyrics on the temp. variable
62+
lyrics = track.lyrics;
63+
});
64+
var embeds = [];
65+
66+
let lyembed = new MessageEmbed().setColor("#00ff00").setTitle(title.substr(0, 256)).setDescription(lyrics);
67+
68+
const splitDescription = splitMessage(lyembed.description);
69+
for(var i = 0; i < splitDescription.length; i++){
70+
if(i > 0){
71+
embeds.push(new MessageEmbed().setColor("#00ff00").setDescription(splitDescription[i]))
72+
}else{
73+
embeds.push(lyembed.setDescription(splitDescription[i]));
74+
}
75+
}
76+
77+
78+
lyricsmsg.edit({content: `**:mag: Searching lyrics for \`${title}\`**`, embed: embeds[0]}).catch(e=>console.log("error"))
79+
for(let i = 1; i<embeds.length;i++){
80+
message.channel.send(embeds[i]).catch(e=>console.log("error"))
81+
}
82+
}
83+
};
84+
/**
85+
* @INFO
86+
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js
87+
* @INFO
88+
* Work for Milrato Development | https://milrato.eu
89+
* @INFO
90+
* Please mention Him / Milrato Development, when using this Code!
91+
* @INFO
92+
*/

0 commit comments

Comments
 (0)