• Resolved AmirHossein

    (@aghorbanmehr)


    Hi dear Marco
    As I mentioned before I need to respond to users according to the tracking ID, It means that everyone has a unique Tracking ID and everyday new Tracking IDs are being generated by the system.
    As you told I used the “Insert PHP” plugin to retrieve data from database but how can I generate dynamic commands?
    I need to read these Tracking IDs from URL.

    Thanks for your help.

    https://www.ads-software.com/plugins/telegram-bot/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Marco Milesi

    (@milmor)

    Where does the ID come from?

    Thread Starter AmirHossein

    (@aghorbanmehr)

    Users in telegram should enter their Tracking Code and in reply the bot should use these Tracking IDs and send them one single sentence according to their product state.
    for example:
    Active
    or
    Finished

    Plugin Author Marco Milesi

    (@milmor)

    Hi,
    v0.13 added the function telegram_get_data_array() and allows using parameters like /command 01 that call the /command custom post type.

    Example (requires Insert Php plugin):

    [insert_php]
    if ( $data = telegram_get_data_array() ) {
    //Your Code
    }
    [/insert_php]

    You can retrieve data as follows:

    $data['message']['text'] //Incoming Text
    $data['message']['from']['id']
    $data['message']['from']['username']
    $data['message']['from']['first_name']

    If you want to have something like /track 1234567890 then you can use the previous code and split $data['message']['text'] to get the ID.

    Thread Starter AmirHossein

    (@aghorbanmehr)

    Hi
    You are great.
    Many thanks.
    I’m trying hard to figure out how to work with this.

    If I had any problem I will ask you later.

    Thanks again.

    Thread Starter AmirHossein

    (@aghorbanmehr)

    It works fine.

    as I mentioned before you are greate.

    Thanks.

    Thread Starter AmirHossein

    (@aghorbanmehr)

    I’m really happy with this plugin.
    resolved.

    Plugin Author Marco Milesi

    (@milmor)

    Thank You and keep following this project ??

    will be a simpler way to use arguments or is it insert_php plugin and php programming mandatory?

    wonderful plugin by the way

    Plugin Author Marco Milesi

    (@milmor)

    The above code shold be simple enough ?? However, this need more work!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to read Dynamic URLs?’ is closed to new replies.