PHP : Auto Post to WordPress from Telegram Bot

  1. Open Telegram, Search “BotFather” or you can open with your browser. If you have telegram apps in your dekstop, this URL will automatically open the apps. If you dont have telegram apps the url will open telegram web in your browser.
  2. Type and Enter “/start” in botfather chat room. You will received how to doing interaction with botfather.
  3. Choose “/newbot” to create a new bot for your web or apps. Type and Enter “/newbot”
  4. Botfather will send you response “Alright, a new bot. How are we going to call it? Please choose a name for your bot.”
  5. It’s mean you must send next command. Type and Enter your Bot Name. For Sample “mscode”.
  6. Botfather will send response, “Good. Now let’s choose a username for your bot. It must end in bot. Like this, for example: TetrisBot or tetris_bot.”
  7. And Again, type and enter bot username. Choose your username and end it with “bot” and it must be unique. Sample “mscodebot” (choose your own username) “
  8. If bot received and approved your username, Bot will send your bot token. Botfather : “Keep your token secure and store it safely, it can be used by anyone to control your bot.” So you must saved this token.
  9. OK Next is How to create PHP code.
  10. Knowing about your bot process. Create PHP File and Running in Cronjobs (Scheduler)
  11. Cron will execute your php script every minute (my recommendation)
  12. If any update in your bot (new messages), php script will take it and post this new messages as a content with your WordPress API. So you must activate the API. Check with open this URL in browser

Add comment

Your email address will not be published. Required fields are marked *

Our Facebook Page