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

153
Views
No se puede verificar el estado personalizado del usuario discord.js

Estoy tratando de hacer un sistema en discord.js versión 12 donde si tienes mi vanity invite en tu estado, obtienes un rol de seguidor

Cada vez que intento esto, siempre dice TypeError: Cannot read property 'find' of undefined

Aquí está mi código

 const roleID = "MyRoleID" const inviteLink = "discord.gg/MyVanityInvite" client.on('presenceUpdate', (_oldPresence, newPresence) => { const member = newPresence.member if (member) { // Ignore members who already have the role if (!member.roles.cache.has(roleID)) { console.log(newPresence) const customStatus = newPresence.activities.find(activity => activity.type === 'CUSTOM_STATUS').state if (customStatus) { if (customStatus.includes(inviteLink)) { member.roles.add(roleID) .catch(console.error) } } } } })

Si trato de iniciar sesión, la nueva Presencia registra una matriz

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

<Presence>.activities devuelve una serie de actividades, no necesita obtener el cache , solo busque directamente como:

 newPresence.activities.find(activity => activity.type === 'CUSTOM_STATUS').state
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!