1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 11:20:19 +00:00
musix-oss/Client.js

59 lines
1.5 KiB
JavaScript
Raw Normal View History

2019-12-05 13:17:15 +00:00
const { Client, Collection } = require('discord.js');
const admin = require('firebase-admin');
2024-02-09 09:53:30 +00:00
require('dotenv/config');
2019-12-05 13:17:15 +00:00
module.exports = class extends Client {
constructor() {
super({
2024-02-09 09:53:30 +00:00
intents: [
"Guilds",
"GuildMessages",
"GuildVoiceStates",
"MessageContent"
],
disableMentions: "everyone",
disabledEvents: ["TYPING_START"]
2019-12-05 13:17:15 +00:00
});
this.commands = new Collection();
this.commandAliases = new Collection();
this.playlistCmd = new Collection();
this.settingCmd = new Collection();
this.events = new Collection();
this.queue = new Map();
this.funcs = {};
this.funcs.handleVideo = require('./funcs/handleVideo.js');
this.funcs.play = require('./funcs/play.js');
this.funcs.msToTime = require('./funcs/msToTime.js');
this.funcs.exe = require('./funcs/exe.js');
2024-02-09 09:53:30 +00:00
this.config = require('./config.js');
2019-12-05 13:17:15 +00:00
this.global = {
db: {
guilds: {},
playlists: {},
},
};
2024-02-09 09:53:30 +00:00
if(this.config.firebase.serviceAccount){
this.funcs.dbget = require('./funcs/dbget.js');
admin.initializeApp({
credential: admin.credential.cert(this.config.firebase.serviceAccount),
});
this.db = admin.firestore();
this.db.FieldValue = require('firebase-admin').firestore.FieldValue;
}
2019-12-05 13:17:15 +00:00
}
2019-12-17 02:12:12 +00:00
};