-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
122 lines (111 loc) · 3.67 KB
/
index.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
const Discord = require("discord.js");
const config = require(`./botconfig/config.json`);
const settings = require(`./botconfig/settings.json`);
const filters = require(`./botconfig/filters.json`);
const colors = require("colors");
const Enmap = require("enmap");
const libsodium = require("libsodium-wrappers");
const ffmpeg = require("ffmpeg-static");
const voice = require("@discordjs/voice");
const DisTube = require("distube").default;
const https = require('https-proxy-agent');
const client = new Discord.Client({
shards: "auto",
//BY: "Tomato#6966",
allowedMentions: {
parse: [ ],
repliedUser: false,
},
partials: ['MESSAGE', 'CHANNEL', 'REACTION'],
intents: [
Discord.Intents.FLAGS.GUILDS,
Discord.Intents.FLAGS.GUILD_MESSAGES,
Discord.Intents.FLAGS.GUILD_VOICE_STATES,
],
presence: {
activity: {
name: `+help | musicium.eu`,
type: "PLAYING",
},
status: "online"
}
});
//BOT CODED BY: Tomato#6966
//DO NOT SHARE WITHOUT CREDITS!
//const proxy = 'http://123.123.123.123:8080';
//const agent = https(proxy);
const { SpotifyPlugin } = require("@distube/spotify");
const { SoundCloudPlugin } = require("@distube/soundcloud");
let spotifyoptions = {
parallel: true,
emitEventsAfterFetching: true,
}
if(config.spotify_api.enabled){
spotifyoptions.api = {
clientId: config.spotify_api.clientId,
clientSecret: config.spotify_api.clientSecret,
}
}
client.distube = new DisTube(client, {
emitNewSongOnly: false,
leaveOnEmpty: true,
leaveOnFinish: true,
leaveOnStop: true,
savePreviousSongs: true,
emitAddSongWhenCreatingQueue: false,
//emitAddListWhenCreatingQueue: false,
searchSongs: 0,
youtubeCookie: config.youtubeCookie, //Comment this line if you dont want to use a youtube Cookie
nsfw: true, //Set it to false if u want to disable nsfw songs
emptyCooldown: 25,
ytdlOptions: {
//requestOptions: {
// agent //ONLY USE ONE IF YOU KNOW WHAT YOU DO!
//},
highWaterMark: 1024 * 1024 * 64,
quality: "highestaudio",
format: "audioonly",
liveBuffer: 60000,
dlChunkSize: 1024 * 1024 * 64,
},
youtubeDL: true,
updateYouTubeDL: true,
customFilters: filters,
plugins: [
new SpotifyPlugin(spotifyoptions),
new SoundCloudPlugin()
]
})
//Define some Global Collections
client.commands = new Discord.Collection();
client.cooldowns = new Discord.Collection();
client.slashCommands = new Discord.Collection();
client.aliases = new Discord.Collection();
client.categories = require("fs").readdirSync(`./commands`);
client.allEmojis = require("./botconfig/emojis.json");
client.setMaxListeners(100); require('events').defaultMaxListeners = 100;
client.settings = new Enmap({ name: "settings",dataDir: "./databases/settings"});
client.infos = new Enmap({ name: "infos", dataDir: "./databases/infos"});
//Require the Handlers Add the antiCrash file too, if its enabled
["events", "commands", "slashCommands", settings.antiCrash ? "antiCrash" : null, "distubeEvent"]
.filter(Boolean)
.forEach(h => {
require(`./handlers/${h}`)(client);
})|| config.token
//Start the Bot
client.login(process.env.token || config.token)
/**
* @INFO
* Bot Coded by Tomato#6966 | https://discord.gg/milrato
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
/**
* @LOAD_THE_DASHBOARD - Loading the Dashbaord Module with the BotClient into it!
*/
client.on("ready", () => {
require("./dashboard/index.js")(client);
})