mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 00:23:17 +00:00
Update index.js
This commit is contained in:
parent
41dc95cf1b
commit
e3b3178a5f
23
index.js
23
index.js
@ -379,4 +379,27 @@ function play(guild, song) {
|
|||||||
serverQueue.textChannel.send(`:musical_note: Start playing: **${song.title}**`);
|
serverQueue.textChannel.send(`:musical_note: Start playing: **${song.title}**`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseDate(ms, times) {
|
||||||
|
var d = new Date(ms);
|
||||||
|
var obj = {};
|
||||||
|
for (var i = 0; i < times.length; i++) {
|
||||||
|
if (times[i] === 'ms') {
|
||||||
|
obj[times[i]] = d.getMilliseconds();
|
||||||
|
} else if (times[i] === 's') {
|
||||||
|
obj[times[i]] = d.getSeconds();
|
||||||
|
} else if (times[i] === 'm') {
|
||||||
|
obj[times[i]] = d.getMinutes();
|
||||||
|
} else if (times[i] === 'h') {
|
||||||
|
obj[times[i]] = d.getHours();
|
||||||
|
} else if (times[i] === 'd') {
|
||||||
|
obj[times[i]] = d.getDate();
|
||||||
|
} else if (times[i] === 'mo') {
|
||||||
|
obj[times[i]] = d.getMonth();
|
||||||
|
} else if (times[i] === 'y') {
|
||||||
|
obj[times[i]] = d.getFullYear() - 1970;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
client.login(process.env.BOT_TOKEN);
|
client.login(process.env.BOT_TOKEN);
|
||||||
|
Loading…
Reference in New Issue
Block a user