1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-18 05:26:00 +00:00

update 3.0.5

This commit is contained in:
MatteZ02
2020-03-24 12:02:07 +02:00
parent 11cea679d1
commit e20d0e18e0
61 changed files with 81 additions and 109 deletions

View File

@ -3,7 +3,7 @@ const admin = require('firebase-admin');
const serviceAccount = require('./config/serviceAccount.json');
const fs = require('fs');
const path = require('path');
const events = require('../events/events.js');
const events = require('../events/events.ts');
module.exports = class extends Client {
constructor() {
@ -21,12 +21,12 @@ module.exports = class extends Client {
this.queue = new Map();
this.funcs = {};
this.dispatcher = {};
this.config = require('./config/config.js');
this.messages = require('./config/messages.js');
this.config = require('./config/config.ts');
this.messages = require('./config/messages.ts');
this.db = admin.firestore();
this.db.FieldValue = require('firebase-admin').firestore.FieldValue;
this.dispatcher.finish = require('../events/dispatcherEvents/finish.js');
this.dispatcher.error = require('../events/dispatcherEvents/error.js');
this.dispatcher.finish = require('../events/dispatcherEvents/finish.ts');
this.dispatcher.error = require('../events/dispatcherEvents/error.ts');
this.global = {
db: {
guilds: {},
@ -37,14 +37,14 @@ module.exports = class extends Client {
this.funcs[filename.slice(0, -3)] = require(`./funcs/${filename}`);
});
const commandFiles = fs.readdirSync(path.join(path.dirname(__dirname), 'commands')).filter(f => f.endsWith('.js'));
const commandFiles = fs.readdirSync(path.join(path.dirname(__dirname), 'commands')).filter(f => f.endsWith('.ts'));
for (const file of commandFiles) {
const command = require(`../commands/${file}`);
command.uses = 0;
this.commands.set(command.name, command);
this.commandAliases.set(command.alias, command);
}
const settingFiles = fs.readdirSync(path.join(path.dirname(__dirname), 'commands/settings')).filter(f => f.endsWith('.js'));
const settingFiles = fs.readdirSync(path.join(path.dirname(__dirname), 'commands/settings')).filter(f => f.endsWith('.ts'));
for (const file of settingFiles) {
const option = require(`../commands/settings/${file}`);
this.settingCmd.set(option.name, option);

View File

@ -13,7 +13,7 @@ module.exports = {
embedColor: "#b50002",
invite: "https://discordapp.com/oauth2/authorize?client_id=607266889537945605&permissions=3427328&scope=bot",
supportServer: "https://discord.gg/rvHuJtB",
devMode: false,
devMode: true,
dblApi: false,
saveDB: true,
respawn: true,

View File

@ -16,7 +16,7 @@ module.exports = async function (video, msg, voiceChannel, client, playlist = fa
return msg.channel.send(message);
}
const construct = require("../config/queueConfig.js");
const construct = require("../config/queueConfig.ts");
construct.textChannel = msg.channel;
construct.voiceChannel = voiceChannel;

View File

@ -1,8 +1,8 @@
module.exports = function msToTime(duration, format) {
var seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24);
days = Math.floor((duration / (1000 * 60 * 60 * 24)) % 24);
hours = Math.floor((duration / (1000 * 60 * 60)) % 24),
days = Math.floor((duration / (1000 * 60 * 60 * 24)) % 24);
days = (days < 10) ? "0" + days : days;
hours = (hours < 10) ? "0" + hours : hours;

View File

@ -1,7 +1,7 @@
module.exports = async function (guild, song, client, seek, play) {
const Discord = require('discord.js');
const ytdl = require('ytdl-core');
const streamConfig = require("../config/streamConfig.js");
const streamConfig = require("../config/streamConfig.ts");
const getThumb = require('video-thumbnail-url');
const prism = require('prism-media');
@ -20,7 +20,7 @@ module.exports = async function (guild, song, client, seek, play) {
"-f", "s16le",
"-ar", "48000",
"-ac", "2",
"-af", `bass=g=${queue.bass}`
"-af", `bass=g=${queue.bass}`,
];
const transcoder = new prism.FFmpeg({ args: ffmpegArgs });