K
K
Killsayden2020-11-05 12:42:33
MongoDB
Killsayden, 2020-11-05 12:42:33

How to store variable data in MongoDB discord.js?

There is this variable:

let channelid = guild.channels.cache.find(ch => ch.name == 'hello').id

When creating a channel, we get its id and write it to the channelid variable, how can I save it to the database and use it for verification, for example, there is such a verification, and I need to use the channelid variable instead of the channel name
if (message.content.startsWith(prefix+'help') && message.channel.name == "hello")


Why do I need it?
When you change the name of the channel so that the bot still works in this channel.
Thanks in advance!

PS The database is connected to me, everything is set up, but I did not find a solution to this problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Killsayden, 2020-11-05
@Killsayden

Did it if

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question