I guess this is feasable, still needs testing
This commit is contained in:
parent
a7f2e66a5a
commit
738d11854c
|
@ -1,9 +1,9 @@
|
||||||
const ytdl = require("ytdl-core");
|
const ytdl = require("ytdl-core-discord");
|
||||||
|
|
||||||
function play(connection, message) {
|
async function play(connection, message) {
|
||||||
var server = client.servers[message.guild.id];
|
var server = client.servers[message.guild.id];
|
||||||
|
|
||||||
server.dispatcher = connection.play(ytdl(server.queue[0], {filter: "audioonly"}));
|
server.dispatcher = connection.play(await ytdl(server.queue[0]), {filter: "audioonly"}, {type: opus});
|
||||||
|
|
||||||
server.queue.shift();
|
server.queue.shift();
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ exports.run = async (client, message, args, level) => {
|
||||||
|
|
||||||
var server = client.servers[message.guild.id];
|
var server = client.servers[message.guild.id];
|
||||||
|
|
||||||
|
server.queue.push(args[0]);
|
||||||
|
|
||||||
if(!message.guild.voiceConnection) message.member.voice.channel.join().then(function(connection) {
|
if(!message.guild.voiceConnection) message.member.voice.channel.join().then(function(connection) {
|
||||||
play(connection, message);
|
play(connection, message);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports = async client => {
|
module.exports = async client => {
|
||||||
client.logger.log(`Looks like I'm ready! My tag is ${client.user.tag}, and I'm ready to serve ${client.users.cache.some(user => !user.bot).size} users in ${client.guilds.size} ${client.guilds.size > 1 ? "servers" : "server"}.`, "ready");
|
client.logger.log(`Looks like I'm ready! My tag is ${client.user.tag}, and I'm ready to serve ${client.users.cache.some(user => !user.bot).size} users in ${client.guilds.cache.size} ${client.guilds.cache.size > 1 ? "servers" : "server"}.`, "ready");
|
||||||
|
|
||||||
client.user.setActivity(`${client.users.filter(user => !user.bot).size} humans | ${client.settings.get("default").prefix}help`, {type: "WATCHING"});
|
client.user.setActivity(`${client.users.cache.filter(user => !user.bot).size} humans | ${client.settings.get("default").prefix}help`, {type: "WATCHING"});
|
||||||
client.user.setStatus("online");
|
client.user.setStatus("online");
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.4.tgz",
|
||||||
"integrity": "sha512-AwCjNahVqASGv5mxnZCC0DfcV/hkAV/U7edUB0K+20xx7v0ZfQ3/o02bNROzpNjvfak5pM8KO5SCmJVK90e3lQ=="
|
"integrity": "sha512-AwCjNahVqASGv5mxnZCC0DfcV/hkAV/U7edUB0K+20xx7v0ZfQ3/o02bNROzpNjvfak5pM8KO5SCmJVK90e3lQ=="
|
||||||
},
|
},
|
||||||
|
"@types/node": {
|
||||||
|
"version": "13.7.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.4.tgz",
|
||||||
|
"integrity": "sha512-oVeL12C6gQS/GAExndigSaLxTrKpQPxewx9bOcwfvJiJge4rr7wNaph4J+ns5hrmIV2as5qxqN8YKthn9qh0jw=="
|
||||||
|
},
|
||||||
"abort-controller": {
|
"abort-controller": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||||
|
@ -206,7 +211,7 @@
|
||||||
"integrity": "sha1-GoJyxqohshyOdRddp1g1rvCT9xY="
|
"integrity": "sha1-GoJyxqohshyOdRddp1g1rvCT9xY="
|
||||||
},
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "github:discordjs/discord.js#c4c6ad4a63fcbc46fdf4e6f1ea01472e67c31839",
|
"version": "github:discordjs/discord.js#f85230812ff6de4f1ba1c021c93fe308fb0685e6",
|
||||||
"from": "github:discordjs/discord.js",
|
"from": "github:discordjs/discord.js",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discordjs/collection": "^0.1.1",
|
"@discordjs/collection": "^0.1.1",
|
||||||
|
@ -895,6 +900,16 @@
|
||||||
"miniget": "^1.6.0",
|
"miniget": "^1.6.0",
|
||||||
"sax": "^1.1.3"
|
"sax": "^1.1.3"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ytdl-core-discord": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ytdl-core-discord/-/ytdl-core-discord-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-uiaZWa9UG+he1F9p7Si9H6Tieyxd9dEhLi4958mHuebudQSEEPaaJHUEbFikcpB++5ogzynVOcvdeC+LFJGgEw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "^13.5.3",
|
||||||
|
"prism-media": "^1.0.1",
|
||||||
|
"ytdl-core": "^1.0.3"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,8 @@
|
||||||
"recrawl": "^2.0.0",
|
"recrawl": "^2.0.0",
|
||||||
"roll": "^1.2.0",
|
"roll": "^1.2.0",
|
||||||
"webdict": "^0.3.0",
|
"webdict": "^0.3.0",
|
||||||
"ytdl-core": "^1.0.8"
|
"ytdl-core": "^1.0.8",
|
||||||
|
"ytdl-core-discord": "^1.1.0"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://npm.pkg.github.com/"
|
"registry": "https://npm.pkg.github.com/"
|
||||||
|
|
Loading…
Reference in New Issue