mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
add /play to test file
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -130,13 +130,18 @@ client.on('message', msg => {
|
|||||||
|
|
||||||
const ytdl = require('ytdl-core');
|
const ytdl = require('ytdl-core');
|
||||||
|
|
||||||
let disp;
|
let disp, con;
|
||||||
|
|
||||||
client.on('message', msg => {
|
client.on('message', msg => {
|
||||||
|
if (msg.content.startsWith('/play')) {
|
||||||
|
const chan = msg.content.split(' ').slice(1).join(' ');
|
||||||
|
con.playStream(ytdl(chan, {filter : 'audioonly'}), { passes : 4 });
|
||||||
|
}
|
||||||
if (msg.content.startsWith('/join')) {
|
if (msg.content.startsWith('/join')) {
|
||||||
const chan = msg.content.split(' ').slice(1).join(' ');
|
const chan = msg.content.split(' ').slice(1).join(' ');
|
||||||
msg.channel.guild.channels.get(chan).join()
|
msg.channel.guild.channels.get(chan).join()
|
||||||
.then(conn => {
|
.then(conn => {
|
||||||
|
con = conn;
|
||||||
msg.reply('done');
|
msg.reply('done');
|
||||||
disp = conn.player.playStream(ytdl('https://www.youtube.com/watch?v=oQBiPwklN_Q', {filter : 'audioonly'}), { passes : 3 });
|
disp = conn.player.playStream(ytdl('https://www.youtube.com/watch?v=oQBiPwklN_Q', {filter : 'audioonly'}), { passes : 3 });
|
||||||
conn.player.on('debug', console.log);
|
conn.player.on('debug', console.log);
|
||||||
|
|||||||
Reference in New Issue
Block a user