How to get the current channel a slash command was used in

I took a look at the following post https://discord.com/channels/737141877803057244/1061609301556346921 and
const target= await interaction.guild?.channels.cache.get('id');
const target= await interaction.guild?.channels.cache.get('id');
comes up as undefined. I am needing to get returned as if I were running client.channels.fetch(process.env.BOT_REPORT_CHANNEL_ID)
Solution:
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Jump to solution
1 Reply
Solution
Favna
Favna2y ago
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Want results from more Discord servers?
Add your server