mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-15 05:36:54 +00:00
Modified the audio player (still doesn't work though)
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module.exports ={
|
module.exports ={
|
||||||
name: 'kareoke',
|
name: 'kareoke',
|
||||||
description: 'Sing your least-favorite song with you favorite person, me!',
|
description: 'Sing your least-favorite song with your favorite person, me!',
|
||||||
execute(message, args) {
|
execute(message, args) {
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
const cheerio = require('cheerio')
|
const cheerio = require('cheerio')
|
||||||
|
|||||||
+7
-24
@@ -6,31 +6,14 @@ const { VoiceConnectionStatus, AudioPlayerStatus } = require('@discordjs/voice')
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: "playaudio",
|
name: "playaudio",
|
||||||
execute(message, args, client) {
|
execute(message, args, client) {
|
||||||
message.channel.send("This command has not been set up yet\nSorry!");
|
// message.channel.send("This command has not been set up yet\nSorry!");
|
||||||
return;
|
// return;
|
||||||
// //const guild = client.guilds.cache.get(client.guild.id);
|
const ytdl = require('ytdl-core-discord');
|
||||||
// const channel = client.guilds.channels.cache.get('930148609406685227');
|
const url = args[0];
|
||||||
// channel.join()
|
|
||||||
// .then(connection => console.log('Connected'))
|
|
||||||
// .catch(console.error);
|
|
||||||
|
|
||||||
|
async function play(connection, url) {
|
||||||
// const { createAudioResource, createAudioPlayer } = require('@discordjs/voice');
|
connection.playOpusStream(await ytdl(url));
|
||||||
|
}
|
||||||
// const player = createAudioPlayer();
|
|
||||||
|
|
||||||
// const resource = createAudioResource('/home/user/voice/music.mp3', {
|
|
||||||
// metadata: {
|
|
||||||
// title: 'A good song!',
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
// // Not recommended - listen to errors from the audio player instead for most usecases!
|
|
||||||
// resource.playStream.on('error', error => {
|
|
||||||
// console.error('Error:', error.message, 'with track', resource.metadata.title);
|
|
||||||
// });
|
|
||||||
|
|
||||||
// player.play(resource);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user