Answer the question
In order to leave comments, you need to log in
How can I make the bot create a text chat on command and only in this text chat would it respond to Discord.js commands?
I have such a task that I need to do that, for example, using the !start command, the bot will create a text chat with a specific name, and only in this text chat will the bot respond to commands.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Channel creation:
client.on("message", async(message) => {
if(message.author == client.user) return;
if(message.content == "!start") {
message.guild.channels.create({
name: "commands-channel"
})
}
})
client.on("message", async(message) => {
if(message.author == client.user) return;
if(message.channel.name == "commands-channel") {
// Тут функции которые нужно выполнить при сообщении в канал "commands-channel"
}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question