how to send a message to a discord server using a bot

JavaScript
const channel = client.channels.cache.get(channel => channel.name === 'the channel name')
channel.send(message)
Source

Also in JavaScript: