С помощью своего бота Discord я пытаюсь создать приветственное сообщение. У меня получилось следующее:
- Отправка сообщения, когда кто-то присоединяется
- Получение имени человека, который присоединяется
Теперь у меня есть проблема с помощью @ или # в этом сообщении. Я использую следующий код для сообщения:
const welcomeMessage = `Welcome @${member.user.username} to the server! Please look through the #:page_with_curl:rules and assign yourself a role at #:mortar_board:role-assignment`;
Но я также пробовал:
Welcome @${member.user.username} to the server! Please look through the #?rules and assign yourself a role at #?role-assignment
Оба они делают не то, что я хочу. Я получаю следующий результат из этого кода: ![Message of bot without the blue outline of @ and #](https://i.stack.imgur.com/xTqa2.png)
What you can see there is that the @MEE6
and the 2 channel # is not blue, and not clickable. But when I copy the full text, past it and send it in the chat it does show blue.
The result I would like to have is the result of when I copy, paste and send it. That is the following:
Сообщение мое с синим контуром @ и #
Вот еще немного кода:
const welcomeChannel = client.channels.cache.get('738678076174630922');
const welcomeMessage = `Welcome @${member.user.username} to the server! Please look through the #?rules and assign yourself a role at #?role-assignment`;
welcomeChannel.send(welcomeMessage)
Что мне делать, чтобы исправить это?