/envato-sales-notify-telegrambot

This is specially created for Envato authors to get notified via Telegram when received a new sale.

Primary LanguagePHPMIT LicenseMIT

Envato Sales Telegram Bot

This is specifically designed for Envato authors to be notified via telegram when a new sale is received.

Installation

  1. Clone envato-sales-notify-telegrambot into your server root location.
  2. Install Telegram App in your device.
  3. Search @BotFather & click on /start
  4. Then type /newbot & type a name for your bot then press enter.
  5. Copy paste your $telegramApiKey with your Telegrame Api Token.
  6. Paste the following link in your browser. Replace with the API access token that you identified or created in the previous section: https://api.telegram.org/bot<API-access-token>/getUpdates?offset=0
  7. Send a message to your bot in the Telegram application. The message text can be anything. Your chat history must include at least one message to get your chat ID.
  8. Refresh your browser.
  9. Identify the numerical chat ID by finding the id inside the chat JSON object. In the example below, the chat ID is 123456789
{  
 "ok":true,
   "result":[  
      {  
         "update_id":XXXXXXXXX,
         "message":{  
            "message_id":2,
            "from":{  
               "id":123456789,
               "first_name":"Mushroom",
               "last_name":"Kap"
            },
            "chat":{  
               "id":123456789,
               "first_name":"Mushroom",
               "last_name":"Kap",
               "type":"private"
            },
            "date":1487183963,
            "text":"hi"
         }
      }
   ]
}
  1. Update $chatID with your Chat ID.
  2. Create Envato API by this link with permission View the user's items' sales history
  3. Update $envatoApiKey with your Envato Token
  4. Add cronjob like this * * * * * cd /root/path/envato-sales-notify-telegrambot/ && php index.php
  5. Enjoy :)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This package is licensed under the MIT License.

Buy Me A Coffee! ☕

If you can contribute with a donation or you want to, feel free to do it at Buy me a coffee!☕, I will be really thankfull for anything even if it is a coffee or just a kind comment towards my work, because that helps me a lot. Whenever you contribute with a donation, I will read your message and it will be shown in my main site.