K
K
Killsayden2020-11-06 19:26:49
Node.js
Killsayden, 2020-11-06 19:26:49

How to remove information about the server from the database if the bot was kicked/banned by DISCORD.JS?

Good evening, you need to find a solution on how to make a scheme, if the bot is kicked from the server or banned, it deleted information about this server from the database.

What the code for getting the server looks like:

global.Guild = require("./data/Guild.js");

bot.on("guildCreate", async (guild) => {
... Здесь создание канала
    Guild.create({ 
        chID: guild.channels.cache.find(ch => ch.name == 'music').id, // ID канала
        gID: guild.id // ID сервера
    })
})


Screenshot-16.png
Delete not the entire collection, but only this entry in the screenshot

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