Замените channel id
фактическим идентификатором канала, на который вы хотите отправлять материалы.
Для Discord. js v12 (последняя версия):
client.on('message', ({attachments, author, content, guild}) => {
// only do this for DMs
if (!guild) {
// this will simply send all the attachments, if there are any, or the message content
// you might also want to check that the content is a link as well
const submission = attachments.size
? {files: attachments.array(), content: `${author}`}
: {content: `${content}\n${author}`}
client.channels.cache.get('channel id').send(submission)
}
})
Для Discord. js v11 заменить
client.channels.cache.get('channel id').send(submission)
на
client.channels.get('channel id').send(submission)