Estaba haciendo el bot de discord del tutorial de youtube https://youtu.be/bD75JNQfeYM pero el tipo que hizo el tutorial de youtube no quiere responder a mi pregunta, recibí un error que dice
Error: el almacenamiento en búfer de la operación chatbots.findOne() se agotó después de 10000 ms en Timeout.x
aquí está el código esto es chatbot.js
const fetch = require('node-fetch'); const client = require('../index'); const { findOne } = require('../models/chatbot'); const Schema = require('../models/chatbot'); client.on('messageCreate', async (message) => { if (message.author.bot) return await Schema.findOne({ guild: message.guild.id }, async (err, data) => { if (!data) return; if (err) throw err; const channell = data.channel if (message.channel.id === channell) { fetch(`https://api.monkedev.com/fun/chat?msg=${message.content}&uid=${message.author.id}&yr0n57JXpCy7aXlzFmMchuas`) .then(response => response.json()) .then(data => { message.reply(`> ${data.response}`) }) } }) })y este es el comando para chatbot
const { Client, Message, MessageEmbed } = require('discord.js'); const Schema = require('../../models/chatbot') module.exports = { name: 'set-chatbot', /* * @param {Client} client * @param {Message} message * @param {String[]} args */ run: async (client, message, args, Discord) => { const channell = message.mentions.channels.first() if (!channell) return message.reply('Please tell me a channel!'); Schema.findOne({ guild: message.guild.id }, async (err, data) => { if (data) data.delete() new Schema({ guild: message.guild.id, channel: channell.id, }).save(); message.channel.send('Done!') }) } }esta mangosta
const { mongooseConnectionString } = require("../config.json"); const mongoose = require("mongoose"); module.exports = () => { if (!mongooseConnectionString) return; mongoose.connect(mongooseConnectionString, { useFindAndModify: true, useUnifiedTopology: true, }); };modelos
const mongoose = require('mongoose') const chatbot = new mongoose.Schema({ guild: String, channel: String }) module.exports = mongoose.model("chatbot", chatbot);