send channel message with id in interactionCreate

How do i send a message to a specific channel using it's id in the interactionCreate. What i have tried:
const logChannel = interaction.channels.cache.find(channel => channel.id === 'ID')
const logChannel = interaction.channels.cache.find(channel => channel.id === 'ID')
6 Replies
MrMythical
MrMythical3y ago
just use .get(id)
PAdventures
PAdventuresOP3y ago
const logChannel = interaction.channels.get(ID)
const logChannel = interaction.channels.get(ID)
?
MrMythical
MrMythical3y ago
.cache.get
PAdventures
PAdventuresOP3y ago
TypeError: Cannot read properties of undefined (reading 'cache')
TypeError: Cannot read properties of undefined (reading 'cache')
MrMythical
MrMythical3y ago
interaction.client.channels.cache.get
PAdventures
PAdventuresOP3y ago
thanks
Want results from more Discord servers?
Add your server