Skip to content

Commit 2ba3c4d

Browse files
committed
0.1.0
The Second DJ Boy Version advanced-discord-music-bot I call it DJ-Gril because it's for that. Idk where I did steal it so yeah don't ask :)
1 parent 26b6d1b commit 2ba3c4d

34 files changed

+1769
-2
lines changed

README.md

+121-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,121 @@
1-
# DJ-Boy
2-
Music player on discord with custom channel feature.
1+
# زبان فارسی
2+
[![Deploy on Herokucd](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Sobhan-SRZA/Discord-Music-Bot/)
3+
4+
[![Use on Replit](https://repl.it/badge/github/Sobhan-SRZA/Discord-Music-Bot/)](https://repl.it/github/Sobhan-SRZA/Discord-Music-Bot/)
5+
## آدرس های من در فضای مجازی👇🏼🙃
6+
7+
8+
9+
آدرس [توییچ](https://www.twitch.tv/sobhan_srza)
10+
11+
آدرس کانال [تلگرام من](https://t.me/SobhanSRZA)
12+
13+
آدرس [اینستگرام](https://www.instagram.com/srza._.gamer)
14+
15+
آدرس [آپارات](https://www.aparat.com/Sobhan.SRZA)
16+
17+
آدرس [یوتوب](https://b2n.ir/srza.-.gamer)
18+
19+
آدرس [دیسکورد](https://discord.gg/bNpqrdXNNn)
20+
21+
آدرس [یوتوب](https://b2n.ir/srza._.action)
22+
23+
24+
## آموزش نصب و ران کردن بات
25+
26+
`برای ران کردن بات شما نیازمند دیدن ویدیوی آموزشی این سورس هستید که ر یوتبم آپلودش کردم
27+
ولی شما بازهم میتوانید اینجا آموزش ببینید😁❤`
28+
29+
## ست کردن پرفیکس بات و اد کردن توکن بات
30+
31+
برای اد کردن پرفیکس و توکن بات به سورس ، شما باید برید به پوشه
32+
`.env`
33+
سپس با توجه به کد زیر به ترتیب پرفیکس و توکن بات رو اد کنید👇🏼🙃
34+
35+
```js
36+
37+
TOKEN="Youre-bot-token"
38+
PREFIX="Youre-bot-prefix"
39+
```
40+
41+
در بخش
42+
`TOKEN`
43+
توکن باتتون رو اد کنید و. در بخش
44+
`PREFIX`
45+
پرفیکس باتتون رو اد کنید
46+
47+
48+
## ران کردن بات
49+
50+
برای ران کردن فقط کافیه وارد ترمینال شوید و کد زیر را بزنید و اینتر کنید
51+
52+
`npm i`
53+
54+
`npm i express`
55+
56+
بات شما روشن شد و آماده کار است
57+
:D
58+
59+
60+
61+
62+
63+
## Language EN
64+
[![Deploy on Herokucd](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Sobhan-SRZA/Discord-Music-Bot/)
65+
66+
[![Use on Replit](https://repl.it/badge/github/Sobhan-SRZA/Discord-Music-Bot/)](https://repl.it/github/Sobhan-SRZA/Discord-Music-Bot/)
67+
68+
## My addresses in cyberspace 👇🏼🙃📡
69+
70+
71+
[Twich](https://www.twitch.tv/sobhan_srza) address
72+
73+
My [Telegram](https://t.me/SobhanSRZA) Channel Address
74+
75+
[Instegram](https://www.instagram.com/srza._.gamer) address
76+
77+
Address of the [Aparat](https://www.aparat.com/Sobhan.SRZA)
78+
79+
[YouTube](https://b2n.ir/srza.-.gamer) address
80+
81+
[Discord](https://discord.gg/bNpqrdXNNn)address
82+
83+
[YouTube](https://b2n.ir/srza._.action) address
84+
85+
86+
87+
## How to install and run the bot🤖
88+
89+
To run the bot, you need to watch the instructional video of this source, which I uploaded to my YouTube
90+
But you can still learn here
91+
92+
93+
94+
## Set the bot prefix and edit the bot token👻👾
95+
96+
To add a prefix and a token to the source, you need to go to the folder
97+
`.env`
98+
Then, according to the following code, edit the prefix and the token bot, respectively
99+
100+
```js
101+
102+
TOKEN = "Youre-bot-token"
103+
PREFIX = "Youre-bot-prefix"
104+
```
105+
106+
in part`TOKEN`Add your baton token and. in part`PREFIX`Edit Button Perfix
107+
108+
109+
110+
## Run the bot👽
111+
112+
To run, just enter the terminal and enter the following code and enter
113+
114+
`npm i`
115+
116+
`npm i express`
117+
118+
Your bot is on and ready to go
119+
:D
120+
121+

afk.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"734676305022419017":{"afk":true},"912596015075455016":{"afk":false},"933368289097285722":{"afk":true},"1000449226058256424":{"afk":true}}

assets/Music.gif

88.5 KB
Loading

commands/about.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
info: {
3+
name: "about",
4+
description: "This command send you info and tel you about the bot :D",
5+
usage: "",
6+
aliases: ["info"],
7+
},
8+
run: async (client, message, args) => {
9+
//about bot
10+
const Discord = require('discord.js');
11+
const moment = require("moment");
12+
let infoEmbed = new Discord.MessageEmbed()
13+
infoEmbed.setColor("RANDOM");
14+
infoEmbed.setTitle(`About \`${client.user.username}\``);
15+
infoEmbed.addField(":ping_pong: Ping",`┕\`${Math.round(client.ws.ping)}ms\``,true);
16+
infoEmbed.addField(":clock1: Uptime", `┕\`${moment.duration(message.client.uptime)}\``,true);
17+
infoEmbed.addField(":file_cabinet: Memory",`┕\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(
18+
2
19+
)}mb\``,true);
20+
infoEmbed.addField(":homes: Servers",`┕\`${client.guilds.cache.size}\``, true);
21+
infoEmbed.addField(":busts_in_silhouette: Users",`┕\`${client.users.cache.size}\``,true);
22+
infoEmbed.addField(":control_knobs: API Latency",`┕\`${message.client.ws.ping}ms\``,true);
23+
infoEmbed.addField(":robot: Version",`┕\`Omega 3.1.0\``,true);
24+
infoEmbed.addField(":blue_book: Discord.js",`┕\`v12.2.1\``,true);
25+
infoEmbed.addField(":green_book: Node",`┕\`16.2.1\``,true);
26+
infoEmbed.addField("👨🏻‍🎨 Create",`┕\`By ™️Sizar Team **Mr.SIN RE#1528**\``,true);
27+
infoEmbed.setTimestamp();
28+
infoEmbed.setFooter(`Requested by ${message.author.username}`, `${message.author.displayAvatarURL()}`);
29+
message.channel.send(infoEmbed)
30+
31+
32+
},
33+
};

commands/afk.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const { MessageEmbed } = require("discord.js");
2+
const sendError = require("../util/error");
3+
const fs = require('fs');
4+
5+
6+
module.exports = {
7+
info: {
8+
name: "afk",
9+
description: "24/7",
10+
usage: "[afk]",
11+
aliases: ["24/7"],
12+
},
13+
14+
run: async function (client, message, args) {
15+
let afk = JSON.parse(fs.readFileSync("./afk.json", "utf8"));
16+
if (!afk[message.guild.id]) afk[message.guild.id] = {
17+
afk: false,
18+
};
19+
var serverQueue = afk[message.guild.id]
20+
if (serverQueue) {
21+
serverQueue.afk = !serverQueue.afk;
22+
message.channel.send({
23+
embed: {
24+
color: "GREEN",
25+
description: `💤 **|** AFK is **\`${serverQueue.afk === true ? "enabled" : "disabled"}\`**`
26+
}
27+
});
28+
return fs.writeFile("./afk.json", JSON.stringify(afk), (err) => {
29+
if (err) console.error(err);
30+
});
31+
};
32+
return sendError("There is nothing playing in this server.", message.channel);
33+
},
34+
};

commands/disconnect.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const { MessageEmbed } = require("discord.js");
2+
const sendError = require("../util/error");
3+
4+
module.exports = {
5+
info: {
6+
name: "disconnect",
7+
description: "To stop the music and clearing the queue & disconnect on the voice",
8+
usage: "",
9+
aliases: ["dc"],
10+
},
11+
12+
run: async function (client, message, args) {
13+
const channel = message.member.voice.channel
14+
if (!channel)return sendError("I'm sorry but you need to be in a voice channel to play music!", message.channel);
15+
const serverQueue = message.client.queue.get(message.guild.id);
16+
if (!serverQueue)return sendError("There is nothing playing that I could stop for you.", message.channel);
17+
if(!serverQueue.connection)return
18+
if(!serverQueue.connection.dispatcher)return
19+
try{
20+
serverQueue.connection.dispatcher.end(true);
21+
} catch (error) {
22+
message.guild.me.voice.channel.leave(true);
23+
message.client.queue.delete(message.guild.id);
24+
return sendError(`:notes: The player has stopped and the queue has been cleared.: ${error}`, message.channel);
25+
}
26+
message.client.queue.delete(message.guild.id);
27+
serverQueue.songs = [];
28+
message.react("👋🏼")
29+
},
30+
};

commands/help.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const { MessageEmbed } = require('discord.js')
2+
3+
module.exports = {
4+
info: {
5+
name: "help",
6+
description: "To show all commands",
7+
usage: "[command]",
8+
aliases: ["commands", "help me", "pls help", "h"]
9+
},
10+
11+
run: async function(client, message, args){
12+
13+
14+
const db = require("quick.db");
15+
var prefix = await db.fetch(`prefix_${message.guild.id}`)||process.env.PREFIX;
16+
let music = new MessageEmbed()
17+
music.setAuthor(`Requested by ${message.author.username}`, `${message.author.displayAvatarURL()}`)
18+
music.setThumbnail(message.client.user.displayAvatarURL({ format: "png" }))
19+
music.setTitle(`${client.user.username} Help :)`)
20+
music.setDescription('List of all commands')
21+
music.setFooter(`To get info of each command you can do ${prefix}help | Create by Mr.SIN RE#1528 :)`, `https://cdn.discordapp.com/attachments/902034619791196221/905054458793312327/2GU.gif`)
22+
music.setColor("RANDOM")
23+
var allcmds = "";
24+
client.commands.forEach(cmd => {
25+
let cmdinfo = cmd.info
26+
27+
music.addField(
28+
`**${prefix}${cmdinfo.name}${cmdinfo.usage}**`,
29+
`\`Description: ${cmdinfo.description} | Aliases: (${cmdinfo.aliases})\``,
30+
true
31+
);
32+
})
33+
34+
const { MessageButton } = require('discord-buttons');
35+
let btn2 = new MessageButton()
36+
.setStyle('url')
37+
.setLabel('🤖Invite Bot')
38+
.setURL(`https://discord.com/api/oauth2/authorize?client_id=${message.client.user.id}&permissions=412353895745&scope=bot`)
39+
let btn = new MessageButton()
40+
.setStyle('url')
41+
.setLabel('🦾Server Support')
42+
.setURL(`https://discord.com/invite/bNpqrdXNNn`)
43+
message.channel.send( { button: [btn,btn2],embed: music });
44+
}
45+
}

commands/invite.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
info: {
3+
name: "invite",
4+
description: "To add/invite the bot to your server",
5+
usage: "[invite]",
6+
aliases: ["in"],
7+
},
8+
run: async function(client, message, args) {
9+
const { MessageButton } = require('discord-buttons');
10+
const Discord = require('discord.js')
11+
let inviteEmbed = new Discord.MessageEmbed()
12+
inviteEmbed.setAuthor(`Requested by ${message.author.username}`, `${message.author.displayAvatarURL()}`)
13+
inviteEmbed.setThumbnail(message.client.user.displayAvatarURL({ format: "png" }))
14+
inviteEmbed.setTitle(`Ba Invite Bot Be Servert Azash Hemaiat Kon☺ ${client.user.username}`)
15+
inviteEmbed.setDescription(`**Montazer chi hasti🤨? Bodo mano be servert add kon🙂😘 \n\n [Invite Link](https://discord.com/api/oauth2/authorize?client_id=${message.client.user.id}&permissions=412353895745&scope=bot)**`)
16+
inviteEmbed.setURL(`https://discord.gg/5GYNec4urW`)
17+
inviteEmbed.setFooter("Created By Mr.SIN RE#1528 :)", `https://cdn.discordapp.com/attachments/902034619791196221/905054458793312327/2GU.gif`)
18+
inviteEmbed.setColor("RANDOM")
19+
let btn2 = new MessageButton()
20+
.setStyle('url')
21+
.setLabel('🤖Invite Bot')
22+
.setURL(`https://discord.com/api/oauth2/authorize?client_id=${message.client.user.id}&permissions=412353895745&scope=bot`)
23+
let btn = new MessageButton()
24+
.setStyle('url')
25+
.setLabel('🦾Server Support')
26+
.setURL(`https://discord.com/invite/bNpqrdXNNn`)
27+
message.channel.send( { button: [btn,btn2],embed: inviteEmbed });
28+
}
29+
};

commands/loop.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { MessageEmbed } = require("discord.js");
2+
const sendError = require("../util/error");
3+
4+
module.exports = {
5+
info: {
6+
name: "loop",
7+
description: "Toggle music loop",
8+
usage: "loop",
9+
aliases: ["l"],
10+
},
11+
12+
run: async function (client, message, args) {
13+
const serverQueue = message.client.queue.get(message.guild.id);
14+
if (serverQueue) {
15+
serverQueue.loop = !serverQueue.loop;
16+
return message.channel.send({
17+
embed: {
18+
color: "GREEN",
19+
description: `🔁 **|** Loop is **\`${serverQueue.loop === true ? "enabled" : "disabled"}\`**`
20+
}
21+
});
22+
};
23+
return sendError("There is nothing playing in this server.", message.channel);
24+
},
25+
};

commands/lyrics.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const { MessageEmbed } = require("discord.js");
2+
const lyricsFinder = require("lyrics-finder");
3+
const sendError = require("../util/error");
4+
5+
module.exports = {
6+
info: {
7+
name: "lyrics",
8+
description: "Get lyrics for the currently playing song",
9+
usage: "[lyrics]",
10+
aliases: ["ly"],
11+
},
12+
13+
run: async function (client, message, args) {
14+
const queue = message.client.queue.get(message.guild.id);
15+
if (!queue) return sendError("There is nothing playing.",message.channel).catch(console.error);
16+
17+
let lyrics = null;
18+
19+
try {
20+
lyrics = await lyricsFinder(queue.songs[0].title, "");
21+
if (!lyrics) lyrics = `No lyrics found for ${queue.songs[0].title}.`;
22+
} catch (error) {
23+
lyrics = `No lyrics found for ${queue.songs[0].title}.`;
24+
}
25+
26+
let lyricsEmbed = new MessageEmbed()
27+
.setAuthor(`${queue.songs[0].title} — Lyrics`, "https://cdn.discordapp.com/attachments/865859167557255178/897552744402026556/undefined_-_Imgur.gif")
28+
.setImage(queue.songs[0].img)
29+
.setColor("RANDOM")
30+
.setDescription(lyrics)
31+
.setTimestamp();
32+
33+
if (lyricsEmbed.description.length >= 2048)
34+
lyricsEmbed.description = `${lyricsEmbed.description.substr(0, 2045)}...`;
35+
return message.channel.send(lyricsEmbed).catch(console.error);
36+
},
37+
};

0 commit comments

Comments
 (0)