const buttonPressSchema = new mongoose.Schema({
userId: { type: String, required: true },
timestamp: { type: Date, default: Date.now }
});
client.on("interactionCreate", async (interaction) => {
if(interaction.content === "$reopen") {
const user = await ButtonPress.findOne({ userId: interaction.user.id });
interaction.channel.permissionoverwrites.edit(user.id, {
ViewChannel: true,
})
}
})```
i stored userid in database with this code the user will see the channel right?