Title: telegram_parse &#8220;upgrade&#8221;
Last modified: August 26, 2019

---

# telegram_parse “upgrade”

 *  [zerowastefvg](https://wordpress.org/support/users/zerowastefvg/)
 * (@zerowastefvg)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/telegram_parse-upgrade/)
 * Hi! 🙂 I love your plugin since unleash a lot of potential! 😀 I have just a 
   suggestion: send to “telegram_parse” action the entire data object so a developer
   can handle every kind of interactions (ex. “new_member”).
 * here is my quick mod of “parse.php”:
 * do_action( ‘telegram_parse’, $USERID, $COMMAND ); //EXPERIMENTAL
    do_action( ‘
   telegram_parse’, $USERID, $data ); //EXPERIMENTAL
 * in this way you can have more fun! 😀
    **IMPORTANT: advise people to make the
   bot “admin” otherwise it will work in “privacy mode” and will just get “/commands”.**
 * Here it is your PHP code snippet modified with an example to make a “welcome 
   message”:
 *     ```
       add_action('telegram_parse','telegramcustom_parse', 10, 2);
   
       function telegramcustom_parse( $telegram_user_id, $data ) {
           $plugin_post_id = telegram_getid( $telegram_user_id );
   
           if ( !$plugin_post_id ) {
               return;
           }
   
           $text = $data['message']['text']; // to get just text
   
           if ( $text == '/command') {
               telegram_sendmessage( $telegram_user_id, 'Oh, yes you typed '.$result);
           }
   
           if( isset($data['message']['new_chat_member']) ) {
       	telegram_sendmessage( $telegram_user_id, 'Welcome '.$data['message']['new_chat_member']['first_name']);
           }
   
           return;
       }
       ```
   
    -  This topic was modified 6 years, 9 months ago by [zerowastefvg](https://wordpress.org/support/users/zerowastefvg/).

The topic ‘telegram_parse “upgrade”’ is closed to new replies.

 * ![](https://ps.w.org/telegram-bot/assets/icon-256x256.png?rev=2981438)
 * [Telegram Bot & Channel](https://wordpress.org/plugins/telegram-bot/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/telegram-bot/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/telegram-bot/)
 * [Active Topics](https://wordpress.org/support/plugin/telegram-bot/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/telegram-bot/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/telegram-bot/reviews/)

## Tags

 * [message](https://wordpress.org/support/topic-tag/message/)
 * [upgrade](https://wordpress.org/support/topic-tag/upgrade/)

 * 0 replies
 * 1 participant
 * Last reply from: [zerowastefvg](https://wordpress.org/support/users/zerowastefvg/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/telegram_parse-upgrade/)
 * Status: not resolved