Hi I Coded A Bot But I Want To limit Bot's One Exact Event in One Channel This is Code No Errors Just Need To Lock This Event in one channel
module.exports = async (client, message) => {
if (message.author.bot) return
if (message.channel.type === "dm") {
const guild = client.guilds.cache.get("736112465678565437")
const channel = guild.channels.cache.find(c => c.name === "modmail-messages")
const embed = new Discord.MessageEmbed()
.setAuthor(`${message.author.tag} | ${message.author.id}`, message.author.displayAvatarURL())
.addField("Message", message.content)
.setFooter("Sent")
.setTimestamp()
.setColor("PURPLE")
await message.author.send("Sending To Staff...")
await channel.send(embed)
}
if (message.channel.type !== "dm" && message.guild.channels.cache.find(c => c.name === "modmail-messages")) {
const user = message.mentions.members.first()
const args = message.content.slice(process.env.PREFIX.length).trim().split(/ +/g)
let response = args.slice(1).join(' ')
if (!response)
return message.reply("please provide a response to the user!")
if (!user)
return message.reply("please specify a user!")
await user.send(`**(?Hyper Staff)** ${message.member.displayName}: ${response}`)
}
if (message.content.indexOf(process.env.PREFIX) !== 0) return
const args = message.content.slice(process.env.PREFIX.length).trim().split(/ +/g)
const command = args.shift().toLowerCase()
const cmd = client.commands.get(command)
if (!cmd) return
cmd.run(client, message, args)
}```
question from:https://stackoverflow.com/questions/65540670/vsc-discord-bot-event-locking