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

173
Views
Discord.js: si tengo una matriz donde se elige una opción aleatoria, ¿hay alguna forma de enviar un gif que coincida con esta opción?

Entonces, tengo el siguiente código:

 var jobs = [ 'lawyer', 'hitman', 'gardener', 'cashier' ] var thumbnails = [ "https://c.tenor.com/DP615vqUzeAAAAAC/ace-attorney-phoenix-wright.gif", "https://i.ytimg.com/vi/6nzyIHz5bb0/hqdefault.jpg", "https://c.tenor.com/vzSw7IoYMdYAAAAM/lifehack-hose.gif", "https://c.tenor.com/eYUWlNN0Fw4AAAAM/thisisalecx-cashier.gif" ] let job = jobs[Math.floor(Math.random() * jobs.length)]

Esto elige una opción aleatoria de la matriz de "trabajos". Y tengo la lista con las miniaturas incrustadas que quiero usar. Ahora, si envía un trabajo aleatorio desde la matriz, ¿hay alguna forma de enviar uno de los gifs que coincida con este trabajo? ¡Cualquier ayuda es apreciada!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Utilizar este:

 var jobs = [ 'lawyer', 'hitman', 'gardener', 'cashier' ] var thumbnails = [ "https://c.tenor.com/DP615vqUzeAAAAAC/ace-attorney-phoenix-wright.gif", "https://i.ytimg.com/vi/6nzyIHz5bb0/hqdefault.jpg", "https://c.tenor.com/vzSw7IoYMdYAAAAM/lifehack-hose.gif", "https://c.tenor.com/eYUWlNN0Fw4AAAAM/thisisalecx-cashier.gif" ] let index = Math.floor(Math.random() * jobs.length) let job = jobs[index] let image = thumbnails[index]
about 4 years ago · Juan Pablo Isaza 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!