File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,22 @@ import axios from 'axios';
8
8
import moment from 'moment-timezone' ;
9
9
10
10
/* Para agregar mΓ‘s APIs asegurate de poner global.apiname = ['APIKey'] */ /* By Skid π€ */
11
+ const ytdl = require ( 'ytdl-core' ) ;
11
12
13
+ // Usa tu clave de API aquΓ
14
+ const API_KEY = 'AIzaSyDiapwiIPcUZG4_7wB0sCY4r1Tfi3fX3EM' ;
15
+
16
+ async function playCommand ( url , chat ) {
17
+ if ( ! ytdl . validateURL ( url ) ) {
18
+ return chat . reply ( 'Por favor, proporciona un enlace vΓ‘lido de YouTube.' ) ;
19
+ }
20
+
21
+ const info = await ytdl . getInfo ( url ) ;
22
+ const audioStream = ytdl ( url , { filter : 'audioonly' } ) ;
23
+
24
+ // Enviar el audio al chat
25
+ chat . sendMessage ( { audio : audioStream , filename : `${ info . videoDetails . title } .mp3` } ) ;
26
+ }
12
27
global . openai_key = 'sk-0' ;
13
28
/* ObtΓ©n tu API Key en este enlace: https://platform.openai.com/account/api-keys */
14
29
You canβt perform that action at this time.
0 commit comments