Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
Discord tenor gif incrustado no carga

Tengo un problema con mi código. Mi código envía el gif en la inserción, pero el gif no se carga, así que quiero saber si es de mi código o de discord/tenor.

Este es mi código:

 client.on('message', message => { if (message.content.startsWith(prefix + 'punch')) { const user = message.mentions.users.first(); if (user) { request('https://api.tenor.com/v1/random?key==punch&limit=1', function (error, response, body) { if (!error && response.statusCode == 200) { const data = JSON.parse(body); const gif = data.results[0].url; const embed = new MessageEmbed() .setTitle(`${message.author.username} a fraper ${user.username}`) .setColor(0x00AE86) .setImage(gif) .setTimestamp() .setFooter('GIFER', 'https://discord.com/api/oauth2/authorize?client_id=962008158727974922&permissions=8&scope=bot'); message.channel.send({ embeds: [embed]}); } }); } else { message.channel.send('Vous devez mentionner un utilisateur !'); } } });
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

data.results[0].url no es un enlace directo al archivo, sino la URL corta para ver la publicación en tenor.com. Si consulta https://tenor.com/becER.gif , se redirige a https://tenor.com/view/good-ebening-good-evening-coach-looking-searching-gif-15739239 looking-searching-gif-15739239.

En su lugar, debe usar la tecla media . Es una matriz de diccionarios con el formato (como gif , mp4 , webm , etc.) como clave y un objeto multimedia (con claves como size , duration y url ) como valor. Significa que puedes obtener la URL del gif de esta manera:

 const gif = data.results[0].media[0].gif.url;
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!