K
K
Killsayden2020-10-20 19:36:00
MongoDB
Killsayden, 2020-10-20 19:36:00

How to make a database on MongooDB of all servers hosting Discord.js MongooDB bot?

I need to make a database for the bot, which will be entered into all the servers on which it is - for what?

I have such a problem that I have this code, and I have such a problem, I put the bot on the HEROKU hosting and if I create a channel on one server, the channel is not created on the other server, because of the "go" variable but without it, I don’t know how to do it, if there are options without a database, then you can notify me about it, I have been puzzling over this problem all day.

Thanks for the answer!

var go = 0

bot.on("message", async(message) => {
    if (message.content == "r!start" && go == 0) {
    go = 1
    message.guild.channels.create('good, {
        type: "text",
        topic: "Привет"
    })

    if (go = 1 && !message.author.bot) {
        message.channel.send('Вы успешно создали канал - #good')
    }

    setInterval(function(){ 
        let channel = message.guild.channels.cache.find(ch => ch.name == "good")
        if (!channel) {
            go = 0
        }
        if (channel) { 
            go = 1
        }
    }, 1000);

    }
    })

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question