Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yo #317

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Yo #317

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,22 @@ import axios from 'axios';
import moment from 'moment-timezone';

/* Para agregar mΓ‘s APIs asegurate de poner global.apiname = ['APIKey'] */ /* By Skid πŸ€‘ */
const ytdl = require('ytdl-core');

// Usa tu clave de API aquΓ­
const API_KEY = 'AIzaSyDiapwiIPcUZG4_7wB0sCY4r1Tfi3fX3EM';

async function playCommand(url, chat) {
if (!ytdl.validateURL(url)) {
return chat.reply('Por favor, proporciona un enlace vΓ‘lido de YouTube.');
}

const info = await ytdl.getInfo(url);
const audioStream = ytdl(url, { filter: 'audioonly' });

// Enviar el audio al chat
chat.sendMessage({ audio: audioStream, filename: `${info.videoDetails.title}.mp3` });
}
global.openai_key = 'sk-0';
/* ObtΓ©n tu API Key en este enlace: https://platform.openai.com/account/api-keys */

Expand Down
Loading