i'm developing a discord bot, i want to send a Log to a Specify Channel but i get everytime a Error Code. idk why im new Pls Help
My Code
const { SlashCommandBuilder } = require("@discordjs/builders")
const { MessageEmbed } = require("discord.js")
module.exports = {
data: new SlashCommandBuilder()
.setName("i")
.setDescription("Say a Info about the bot."),
async execute(interaction) {
await interaction.reply({
content: `Test`, ephemeral: true
})
interaction.guild.channels.cache.get('972168780845318174').channels.send({
embeds: [
new MessageEmbed()
.setTitle(`**Log System**`)
.setDescription(`<@${interaction.author.id}> try the command **/i**!`)
.setColor(`#00caff`)
.setFooter('System')
.setTimestamp(Date.now())
]
})
}
}
And here the Error
(node:24340) DeprecationWarning: The interaction event is deprecated. Use interactionCreate instead
(Use `node --trace-deprecation ...` to show where the warning was created)
TypeError: Cannot read properties of undefined (reading 'channels')
at Object.execute (C:\Users\Admin\Desktop\bot\src\commands\info.js:15:67)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Client.<anonymous> (C:\Users\Admin\Desktop\bot\src\index.js:31:13)