-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathready.js
48 lines (45 loc) · 1.46 KB
/
ready.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const
error = require("../../functions/error"),
radiostation = require("../../storage/radiostation.json"),
database = require("../../functions/database"),
player = require("../../functions/player");
/**
*
* @param {import("discord.js").Client} client
* @returns {void}
*/
module.exports = async (client) => {
try {
client.guilds.cache.forEach(async guild => {
const
db = new database(client.db),
databaseNames = {
afk: `radioAFK.${guild.id}`,
station: `radioStation.${guild.id}`
},
channel = await db.get(databaseNames.afk),
station = await db.get(databaseNames.station) || "Lofi Radio";
if (await db.has(databaseNames.afk))
return await new player()
.setData(
{
channelId: channel,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator
}
)
.radio(radiostation[station]);
})
} catch (e) {
error(e)
}
}
/**
* @copyright
* Coded by Sobhan-SRZA (mr.sinre) | https://github.com/Sobhan-SRZA
* @copyright
* Work for Persian Caesar | https://dsc.gg/persian-caesar
* @copyright
* Please Mention Us "Persian Caesar", When Have Problem With Using This Code!
* @copyright
*/