В общем, ситуация такая: При нажатии на кнопку пишет, что канал для предложений не настроен, хотя он был установлен.
 
За это отвечает InteractionCreate и database.
InteractionCreate.js:
const client = require("../index");
const { MessageActionRow } = require("discord.js");
const { fail, success } = require('../config.json');
const suggestionsChannel = require("../models/suggestion");
const server = require('../models/config');
const db = require('../database'); // Путь к вашему файлу database.js
data = {
    _id: '1182737917911777371',
    suggestionsChannel: '1195397048372056185'
  };
  
client.on("interactionCreate", async (interaction) => {
    if (interaction.isCommand()) {
        await interaction.deferReply({ ephemeral: false }).catch(() => {});
        const cmd = client.slashCommands.get(interaction.commandName);
        if (!cmd)
            return interaction.followUp({ content: "Произошла ошибка " });
        const args = [];
        for (let option of interaction.options.data) {
            if (option.type === "SUB_COMMAND") {
                if (option.name) args.push(option.name);
                option.options?.forEach((x) => {
                    if (x.value) args.push(x.value);
                });
            } else if (option.value) args.push(option.value);
        }
        interaction.member = interaction.guild.members.cache.get(interaction.user.id);
        if (!interaction.guild.roles.everyone.permissions.has("USE_EXTERNAL_EMOJIS")) {
            return interaction.followUp({
                content: 'У роли "@everyone" отсутствует разрешение на "USE_EXTERNAL_EMOJIS`, включите его'
            });
        }
        if (!interaction.member.permissions.has(cmd.userPermissions || [])) {
            return interaction.followUp({
                content: `${fail} Вам нужны разрешения \`${cmd.userPermissions.join(", ")}\``
            });
        }
        if (!interaction.guild.me.permissions.has(cmd.clientPermissions || [])) {
            return interaction.followUp({
                content: `${fail} I need \`${cmd.clientPermissions.join(", ")}\` Permissions`
            });
        }
        cmd.run(client, interaction, args);
    }
    if (!interaction.isButton() || !interaction.customId.startsWith('sug-')) return;
    await interaction.deferReply({
        ephemeral: true
    });
 // Добавьте это для отладки
 let data = db.config.get(interaction.guildId) || { channel: { suggestionsChannel: null } };
if (!data.channel || !data.channel.suggestionsChannel) {
    console.error("Channel not configured:", data);
    return interaction.followUp({
        content: `${fail} Канал предложений не настроен`,
    });
}
const id = interaction.customId.replace('sug-', '').substring(0, 8);
const sugg = db.suggestionsChannel.get(id);
// Остальной код...
 // Остальной код...
 
  
    if (!sugg)
        return interaction.followUp({
            content: `${fail} предложение было удалено из базы данных`,
            ephemeral: true
        });
  
    const channelId = data.channel.suggestionsChannel;
    const channel = (await interaction.guild.channels.fetch(channelId).catch(() => null));
          
    if (!channel) {
        return interaction.followUp({
            content: `${fail} Канал предложений не найден`,
            ephemeral: true
        });
    }
  
    const message = (await channel.messages.fetch(sugg.messageId).catch(() => null));
  
    if (!message)
        return interaction.followUp({
            content: `${fail} Я не могу найти это предложение, возможно, оно было удалено`,
            ephemeral: true
        });
    
    const action = interaction.customId.replace(`sug-${id}-`, '') == 'yes' ? 'upvote' : 'downvote';
    const find = Array.isArray(sugg.answers) ? sugg.answers.find(x => x.id == interaction.user.id) : null;
    if (find) {
        if (action == find.type)
            return interaction.followUp({
                content: `${fail} Вы уже проголосовали за это предложение`,
                ephemeral: true
            });
        sugg.answers = sugg.answers.map(item => {
            if (item.id == interaction.user.id) return {
                ...item,
                type: action
            };
            else return item;
        });
        if (action == 'downvote') sugg.votes.up -= 1
        else sugg.votes.down -= 1
    } else {
        sugg.answers = Array.isArray(sugg.answers) ? sugg.answers : [];
        sugg.answers.push({
            id: interaction.user.id,
            type: action
        });
    }
    if (action == 'downvote') sugg.votes.down += 1;
    else sugg.votes.up += 1;
    const btnUp = message.components[0].components[0];
    const btnDown = message.components[0].components[1];
    btnUp.setLabel(`${sugg.votes.up}`);
    btnDown.setLabel(`${sugg.votes.down}`);
    await sugg.save();
    message.edit({
        components: [new MessageActionRow({
            components: [btnUp, btnDown]
        })]
    });
    return interaction.followUp({
        content: `${success} Ваш голос подсчитан`,
        ephemeral: true
    });
});
database.js:
const sqlite3 = require('better-sqlite3');
const fs = require('fs');
const db = new sqlite3('database.db');
const createServerTable = db.prepare(`
  CREATE TABLE IF NOT EXISTS config (
    _id TEXT PRIMARY KEY,
    suggestionsChannel TEXT DEFAULT NULL
  )
`);
createServerTable.run();
const createSuggestionsTable = db.prepare(`
  CREATE TABLE IF NOT EXISTS suggestions (
    _id TEXT PRIMARY KEY,
    messageId TEXT,
    upvotes INTEGER DEFAULT 0,
    downvotes INTEGER DEFAULT 0,
    answers TEXT,
    statusMode TEXT DEFAULT 'Pending',
    statusReason TEXT DEFAULT NULL
  )
`);
createSuggestionsTable.run();
module.exports = {
  config: {
    get: (_id) => db.prepare('SELECT * FROM config WHERE _id = ?').get(_id),
    set: (_id, suggestionsChannel) => db.prepare('INSERT OR REPLACE INTO config (_id, suggestionsChannel) VALUES (?, ?)').run(_id, suggestionsChannel),
  },
  suggestionsChannel: {
    get: (_id) => db.prepare('SELECT * FROM suggestionsChannel WHERE _id = ?').get(_id),
    set: (_id, messageId, upvotes, downvotes, answers, statusMode, statusReason) => {
        answers = answers || [];
        db.prepare('INSERT OR REPLACE INTO suggestionsChannel (_id, messageId, upvotes, downvotes, answers, statusMode, statusReason) VALUES (?, ?, ?, ?, ?, ?, ?)').run(_id, messageId, upvotes, downvotes, JSON.stringify(answers), statusMode, statusReason);
    }
  },
  db: db
};
Уже несколько часов мучаюсь, не могу понять. Помогите, пожалуйста.