Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

75
Vistas
When a user mentions the owner the bot should say you're not allowed

I am trying to make it when a user is tagged (eg. MyNameJeff#0001), the bot will automatically respond with you're not allowed to mention them and delete their message.

I tried searching for an event that could handle this but haven't found anything useful so far.

7 months ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can check if the collection message.mentions.users includes the guild owner's ID with the has() method. A simple if (message.mentions.users.has(message.guild.ownerId)) will work for you:

client.on('messageCreate', async (message) => {
  if (message.author.bot) return;
  if (message.mentions.users.has(message.guild.ownerId)) {
    message.channel.send('You are not allowed to mention the owner!');
    message.delete();
  }
});
7 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.