This commit is contained in:
Raven Scott 2021-07-02 13:38:41 -04:00
parent 75a3a414bf
commit 95d8c13bcb

View File

@ -14,7 +14,7 @@ exports.run = async (bot, message, args, functions) => {
var url = urlcmd
if (url != "stop") {
var name = Math.floor(Math.random() * 999999);
var callback = function(exitCodes) {
var callback = function (exitCodes) {
console.log('Called Back - Converting....');
let midiBuffer = fs.readFileSync('./midifiles/' + name + ".mid");
@ -33,20 +33,20 @@ exports.run = async (bot, message, args, functions) => {
const now = new Date();
message.channel.send({
"embed": {
"color": 2899536,
"footer": {
"text": date.format(now, 'MM/DD/YYYY hh:mm:ss')
},
"fields": [
"color": 2899536,
"footer": {
"text": date.format(now, 'MM/DD/YYYY hh:mm:ss')
},
"fields": [
{
"name": "Midi Sound Generator",
"value": "Here is the sound file: \n https://midi.codingvm.codes/" + name + ".wav \n It should also be playing within the voice channel" ,
"inline": true
}
]
{
"name": "Midi Sound Generator",
"value": "Here is the sound file: \n https://midi.codingvm.codes/" + name + ".wav \n It should also be playing within the voice channel",
"inline": true
}
]
}
});
});
const dispatcher = connection.play('/var/www/html/midi/' + name + ".wav");
dispatcher.on("end", end => {
@ -64,27 +64,27 @@ exports.run = async (bot, message, args, functions) => {
.catch(console.log);
} else {
} else {
const date = require('date-and-time');
const now = new Date();
message.channel.send({
"embed": {
"color": 2899536,
"footer": {
"text": date.format(now, 'MM/DD/YYYY hh:mm:ss')
},
"fields": [
const date = require('date-and-time');
const now = new Date();
message.channel.send({
"embed": {
"color": 2899536,
"footer": {
"text": date.format(now, 'MM/DD/YYYY hh:mm:ss')
},
"fields": [
{
"name": "Midi Sound Generator",
"value": "Here is the sound file: \n https://midi.codingvm.codes/" + name + ".wav \n If you join voice, I can also play it when finished." ,
"inline": true
{
"name": "Midi Sound Generator",
"value": "Here is the sound file: \n https://midi.codingvm.codes/" + name + ".wav \n If you join voice, I can also play it when finished.",
"inline": true
}
]
}
]
}
});
}
});
}
}
@ -113,12 +113,11 @@ exports.conf = {
guildOnly: false,
aliases: [''],
permLevel: "User"
};
};
exports.help = {
exports.help = {
name: "midi",
category: "Troll",
description: "",
description: "Play a midi file from a URL - Download the wav or Listen in VC",
usage: "midi"
};
};