Replace : Create And Management
Overview
The Replace feature in Auto Forward Bot allows you to modify message content before it is forwarded. This is particularly useful when you want to:
Customize forwarded messages to match your target audience.
Remove sensitive or unwanted information.
Add consistent branding or formatting.
This feature will not work if you enable "Show Header Forwarder" in task list
Create New Replace
1. USE Basic
âĄī¸ Command Information
ACTION is add or remove
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
Original_WORD is word you want replace. Check Tab Example
NEW_WORD is word will replace. Check Example
âī¸ Example âī¸
Use the syntax as shown below when you want to replace words or full paragraphs.
âĄī¸ Change black to white
/replace add re1 black -> white
âĄī¸ Remove keyword black from the message
/replace add re1 black -> EMPTY
âĄī¸ Remove keyword do not from the message i do not like black
âĄī¸ Change under the moon to on the sun in content Sometimes I lay under the moon
2. USE Regex
âĄī¸ Command Information
ACTION is add or remove
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
Must use suffix for LABEL is _regex
Original_WORD is word you want replace. Check Example
NEW_WORD is word will replace. Check Example
We do not support usage of regex, you are on your own if you decide to use regex. Only use it if you know what you are doing.
To match spaces in regex, add a \ character before the space or use \s
âī¸ Example âī¸
âĄī¸ Change good or perfect to bad
âĄī¸ Match every url or @mention and change it to @Auto_Forward_Messages_Bot /replace add re1_regex (@|www|https?)\S+ -> @Auto_Forward_Messages_Bot
âĄī¸ Exam1: Refactor content use regex. Remove "âī¸TPA trading report:", "TPA: Entry", "The monitoring will be continued." in content below đ
âĄī¸ Exam2: Refactor content use regex. Change all "Take profit (1|2|3)đat" to TP in content below đ
âĄī¸ Exam 3: Refactor content use regex. Change all to new format in content below đ
Replace Power
This is a powerful bot replacement feature. It is used to remove and change keywords from messages by combining multiple syntaxes. You can use regex with this feature.
To apply multiple replace rules at once you just need to place them in a newline
1. Syntax Command
âĄī¸ Command Information
ACTION is ADD or REMOVE
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
Must use suffix for LABEL is _power
[[ALL_IN_ONE]] is shortcode. Keep it after Label
Original_WORD is word you want replace. Can use Regex
NEW_WORD is word will replace.
âī¸ Input Syntax Simple Example âī¸
âĄī¸ Change good to bad
/replace add re1_power [[ALL_IN_ONE]] -> "good","bad"
âĄī¸ Change 20 to 50 and 2+5=7 to 6+4=10
âĄī¸ Remove keyword black from the message
âī¸ Input Syntax Example (Advanced) âī¸
âĄī¸ Change telegram.me or tm.me to autoforwardtelegram.com
âĄī¸ Use regex to match gray or grey and change it to red
âĄī¸ Unshort urls, match tag (query) and change it to customer
âĄī¸ Match every url or @mention and change it to @Auto_Forward_Messages_Bot
âĄī¸ To apply multiple transformation rules at once you just need to place them in a newline
Create New Replace Use ShortCode
âĄī¸ Command Arguments
âĄī¸ Command Information
ACTION is add or remove
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
Original_WORD is word or short code you want replace.
NEW_WORD is word or short code will replace.
âī¸ ShortCode Guide âī¸
â
Original_WORD
is the word or phrase in the source message that you want to replace.
You can use the following ShortCodes:
[[FULL_MESSAGE]]
: Extracts the full content of the message, including text, media, and other types[[FULL_TEXT]]
: Extracts only the text content from the original message
â
NEW_WORD
is the value that will replace the original word. You can combine it with these ShortCodes:
đš Message & Sender Info
[[ORIGIN_USERNAME]]
Username of the original sender
[[ORIGIN_USERID]]
Telegram user ID of the original sender
[[ORIGIN_TEXT]]
The original message text
[[ORIGIN_NAME]]
Full name of the original sender or name of the original channel
[[ORIGIN_POST_ID]]
Post ID of the original message
[[ORIGIN_CHAT_ID]]
Chat ID of the original message
[[ORIGIN_QUOTED_TEXT]]
Quoted text from the original post
[[ORIGIN_NAME_URL]]
A clickable link to the original sender or channel
[[FROM_USER]]
Username of the user who forwarded the message
[[SOURCE_NAME]]
Name of the original source or channel the message was forwarded from
[[SENDER_CHAT]]
Display name of the sender
[[FORWARD_FROM_CHAT]]
Original chat or channel name if the message was forwarded
đš Current Time Info
[[CURRENT_TIME]]
Current time (HH:MM:SS)
[[CURRENT_DATE]]
Current date (DD/MM/YYYY)
[[CURRENT_DATETIME]]
Full current date and time
[[CURRENT_TIMESTAMP]]
Current Unix timestamp
đš Original Post Timestamps
[[ORIGIN_POST_TIME]]
Time (only) of the original post
[[ORIGIN_POST_DATE_FORMATTED]]
Formatted date of the original post
[[ORIGIN_POST_DATETIME]]
Full date and time of the original post
đš Sender Personal Info
[[ORIGIN_FIRST_NAME]]
First name of the original sender
[[ORIGIN_LAST_NAME]]
Last name of the original sender
[[ORIGIN_PHONE]]
Phone number of the sender (if any)
đš Media & File Info
[[MEDIA_TYPE]]
Media type (photo, video, document...)
[[FILE_SIZE]]
Formatted file size
[[FILE_NAME]]
Name of the attached file
đš Chat Info
[[CHAT_TYPE]]
Type of chat: PRIVATE, GROUP, CHANNEL...
[[MESSAGE_LINK]]
Direct link to the message
[[CHAT_USERNAME]]
Username of the chat
[[CHAT_MEMBERS_COUNT]]
Number of members in the chat
đš Message Content Metadata
[[WORD_COUNT]]
Total word count in the message
[[CHAR_COUNT]]
Total character count
[[LINE_COUNT]]
Total line count
[[TEXT_LENGTH]]
Length of the text
[[HASHTAGS]]
All hashtags in the message
[[MENTIONS]]
All mentions (@username)
[[URLS]]
All URLs in the message
đš Engagement Stats
[[VIEW_COUNT]]
Number of views (for channel posts)
[[FORWARD_COUNT]]
Number of times the message was forwarded
[[REACTIONS_COUNT]]
Number of emoji reactions
đš Other Utilities
[[RANDOM_EMOJI]]
A random emoji from the system collection
[[RANDOM_NUMBER]]
Random number between 1 and 1000
[[MESSAGE_ID]]
ID of the current message
[[REPLY_TO_MESSAGE_ID]]
ID of the replied message
[[IS_FORWARD]]
Whether the message is a forward (true/false)
[[IS_REPLY]]
Whether the message is a reply (true/false)
[[HAS_MEDIA]]
Whether the message contains media
đ Note: ShortCodes will be dynamically replaced during processing.
You can mix multiple ShortCodes in NEW_WORD
for advanced customization.
âī¸ Example âī¸
Use the syntax as shown below when you want to replace words or full paragraphs. Hello. How are you? âĄī¸ Change full content Hello. How are you? to Hi
âĄī¸ Change Hello. How are you? to original content + Signature Source
Remove Lines without Keyword using Replace
This feature is used to keep lines from the message. You will use keywords to check message lines and if a keyword or one of the keywords (if multiple) is found on the line, AutoForward will keep that line from the final result.
âĄī¸ USE command
Syntax
âĄī¸ Command Information
ACTION is add or remove
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
Must use suffix for LABEL is _keepwith
Keywords
is word you want found on the line and keep that line. Check Example
âī¸ Example âī¸
âĄī¸ Content Original:
24/11/23 | Market Execution
Notes:
đBUY limit XAUUSD at 1994
Stop Loss 1990
Take Profit 1 at 2000
Take Profit 2 at 2006
Take Profit 3 at 2026
âĸAPPROPRIATE risk size 1%
âĄī¸ Result Final: Keep line have keyword "BUY" , line have keyword "Take Profit" and line have keyword "risk size".
đBUY limit XAUUSD at 1994
Stop Loss 1990
Take Profit 1 at 2000
Take Profit 2 at 2006
Take Profit 3 at 2026
âĸAPPROPRIATE risk size 1%
Remove Lines By Keyword with Replace
This feature is used to remove lines from the message. You will use keywords to check message lines and if a keyword or one of the keywords (if multiple) is found on the line, AutoForward will remove that line from the final result.
âĄī¸ USE command
âĄī¸ Command Information
ACTION is add or remove
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
Must use suffix for LABEL is _rmline
Keywords
is word you want found on the line and remove that line. Check Example
âī¸ Example âī¸
âĄī¸ Content Original:
24/11/23 | Market Execution
Notes:
đBUY limit XAUUSD at 1994
Stop Loss 1990
Take Profit 1 at 2000
Take Profit 2 at 2006
Take Profit 3 at 2026
âĸAPPROPRIATE risk size 1%
/replace add re1_rmline Market,Notes,risk size -> EMPTY
âĄī¸ Result Final: Remove line have keyword "Market" , line have keyword "Notes" and line have keyword "risk size".
đBUY limit XAUUSD at 1994
Stop Loss 1990
Take Profit 1 at 2000
Take Profit 2 at 2006
Take Profit 3 at 2026
Remove Lines EMPTY Use Replace
Remove Lines By Line Order With Replace
This feature is used to remove lines from the message. You will use line order, AutoForward will remove that line from the final result.
âĄī¸ USE command
âĄī¸ Command Information
ACTION is add or remove
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
Must use suffix for LABEL is _removelines
lineorder1,lineorder2
is line order you want to remove. Check Example
âī¸ Example âī¸
âĄī¸ Content Original:
24/11/23 | Market Execution
đBUY limit XAUUSD at 1994
Stop Loss 1990
Take Profit 1 at 2000
Take Profit 2 at 2006
Take Profit 3 at 2026
âĸAPPROPRIATE risk size 1%
/replace add re1_removelines 1,7 -> EMPTY
âĄī¸ Result Final: Remove line 1 is "24/11/23 | Market Execution " and line 7 is "âĸAPPROPRIATE risk size 1%"
đBUY limit XAUUSD at 1994
Stop Loss 1990
Take Profit 1 at 2000
Take Profit 2 at 2006
Take Profit 3 at 2026
Replace Emoji
Emoji Premium
This feature is used to change emoji premium from the message.
Note: This feature requires a premium Telegram account to operate.
âĄī¸ USE command
This replacement can be done using any type of replace command, such as
basic, regex, power, or removelines.
âĄī¸ Command Information
ACTION is add or remove
LABEL is the nickname you want to define for your Replace.
Do not use number for LABEL.
emoji_premium_code, new_emoji_premium_code are emojis premium
Note: Premium emojis are different from regular emojis, so you need to extract the format code of the premium emoji first.
In this case, the format code will be
In this case, the format code will be
After obtaining the two format codes, you can use them to replace each other with the command:
âĄī¸ Content Original:
âĄī¸ Content Result:
Similarly, on the mobile app, it will look like the image below:
You can also use this method to replace any text or normal emoji with a premium emoji, or vice versa.
Here are a few examples of replacing any text or normal emoji with a premium emoji, or vice versa:
Replace normal text with a premium emoji:
Replace a normal emoji with a premium emoji:
Replace a premium emoji with normal text:
Replace a premium emoji with a normal emoji:
Here are some additional examples of how to use the "Remove Lines without Keyword" and "Remove Lines by Keyword" features with a premium emoji keyword:
Remove Lines without Keyword is Emoji
To keep lines containing specific keywords (like a premium emoji) and remove all others:
Original Content:
Result:
Remove Lines by Keyword is Emoji
To remove lines containing specific keywords (like a premium emoji):
Original Content:
Result:
Apply/Disable Replace For a Task
2. Select đ Advanced Configuration from Menu Setting
3. Select Replace from Menu Advanced Configuration to show list replace
4. Click a your replace you want to Activate or Deactivate for Task
Apply/Disable Replace For All Task
When Apply All Replace for Task will won't activate for each single task
Use command /replace after select Show All Replace
Remove All Replace
Use command /replace after select CLEAR ALL
Regex Magic: Beyond Your Imagination | Replace Advanced Feature
Last updated