Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
How to send messages to a specify channel discord js v13

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)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!