Skip to content

Send private message to user

In VisualMaker, you can use the /msg command to send private messages to a specific user of your bot. This command is ideal for direct communications, such as notifications, alerts, or personalized messages.


How to use the command?

Send private message

The /msg command allows you to send a personalized message to a user identified by their user_id or username.

Format:

/msg user_id_or_username "the message"

Examples:

/msg 123456789 "Hello, remember you have a pending task."

/msg @username "Congratulations on completing the challenge!"

Using expressions in messages

You can include expressions in the message to further personalize the content. Expressions allow you to include specific user information, such as their name, ID, and more.

Example:

/msg @JohnDoe "Hello {first_name}"

The user @JohnDoe, whose name is John, will receive a message like:

Hello John

This makes it easy to send highly personalized messages based on the user's information.


Who can use this command?

  • Only the bot owner and administrators designated by the owner can use the /msg command.
  • Regular users do not have permission to send messages with this command.

Important notes

  1. Identifier or username: You can use the user_id (Telegram user ID) or the username (user's @ handle) to direct the message.
  2. Message format: The message text should always be enclosed in quotes (" "). This ensures everything you type is correctly sent to the user.
  3. Dynamic expressions: You can use expressions to represent variables such as {first_name}, {username}, {id}, and others to personalize your message. See them all here.
  4. Immediate effect: The message will be sent to the user as soon as the command is executed.

With this command and the use of dynamic expressions, you can interact directly with your bot's users in a personalized and effective way.