Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

311
Visualizações
MongooseError: Operation `muted-members.insertOne()` buffering timed out after 10000ms

Please help me I want to make an Automute but I have a problem

When a muted user left the server the console gives me this error:

/Users/Fred/Desktop/Papera Bot/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:149
          const err = new MongooseError(message);
                      ^

MongooseError: Operation `muted-members.insertOne()` buffering timed out after 10000ms
    at Timeout.<anonymous> (/Users/badreddinelaghlid/Desktop/Papera Bot/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:149:23)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7)

then when the user join the server again the bot don't give the mute role to the user

I try to make this codes with mongoose

the schema code of the model:

const client = require("../index");
const Schema = require("../models/muted");

client.on("guildMemberAdd", async(member) => {
    const data = await Schema.findOne({Guild:member.guild.id});
    if (!data) return;
    const user = data.User.findIndex((prop) => prop === member.id);
    if (user == -1) return;
    let muteRole = message.guild.roles.cache.find(role => role.name === 'muted');

    member.roles.add(muteRole.id);
});

the code of guildMemberAdd:

const client = require("../index");
const Schema = require("../models/muted");

client.on("guildMemberAdd", async(member) => {
    const data = await Schema.findOne({Guild:member.guild.id});
    if (!data) return;
    const user = data.User.findIndex((prop) => prop === member.id);
    if (user == -1) return;
    let muteRole = message.guild.roles.cache.find(role => role.name === 'muted');

    member.roles.add(muteRole.id);
});

if you need any information from my code/bot to help me you can tell me guys

thanks for attention!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I had a similar issue sometime last year when I worked with Mongoose. I ran the .findOne query and I got this error MongooseError: Operation projects.findOne() buffering timed out after 10000ms

I found out I was missing the .exec() function which is supposed to execute the query. Added it and my query was executed.

You can read up on it on the Mongoose docs here: https://mongoosejs.com/docs/api.html#query_Query-exec

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda