The scope of this Telegram bot is to be updated about the prices of the cryptocurrencies of your interest periodically (every 30 minutes, for example). Every user can set a personal time interval and can set the cryptocurrencies to be updated on from those which are into the database (into the table cryn_cryptocurrencies).
You can also choose to get the silent notifications and you can get into the bot the latest update about your selected cryptocurrencies (so as not to wait for the automatic notification).
You can try this bot hosted by me: @CryptosNotification_bot
I used composer to get the following PHP libraries:
- telegram-bot-sdk: to have an interface for the Telegram Bot API calls
- meekrodb : to have a set of function to make simple and secure database calls
To get info about cryptocurrencies state i used the API of Coinmarket.
- You need your Telegram bot API token, your CoinmarketAPI token, database infos (username, password, hostname and database name).
- You have to upload the file
config/crypto_notification_db.sqlinto your server's database. - You have to modify the fields into
config/config.jsonfile. - You have to set the webhook of the bot (by the
setWebhookTelegram bot API call) and (eventually) insert a record into thecryn_userstable with your data, so you can use it. - You need to set a cronjob on the file
cronjob_update.phpevery 5 minutes (there are a lot of services to set your cronjobs online) to get the updates.