I develop a Bot for the Telegram Messenger.
You can see the code on Github. You can easily write your own plugins to extend the Messenger. Feel free to create Pull Request in my repository.
0.9.21 – Added Google Search Plugin
0.9.2 – new API, differentiation between different message types
0.9.1 – Full support for Plugins + availability of MySQL
0.8 – Initial release
Want to write more plugins or improve the bot? Feel free to clone git repository and start working. See this guide for more information.
You will need a PHP-enabled Webserver, a SSL-certificate for your domain, a MySQL database (optional) and a Telegram Bot Key. You will also need to download some scripts from other locations.
Some plugins may need further configuration steps.
Create a new Telegram Bot. Make sure you disable the privacy mode – otherwise some plugins won’t work!
Clone the git repository onto your server and create a new host for it (e.g. telegram.example.com). Make sure you have SSL enabled for this host with a valid certificate. You can get one from StartSSL or via letsencrypt for free or create your own certificate.
Create a new file in the root directory (where config.php is) and call it secret.php. This file will contain all sensible information, such as passwords and API keys.
You have to do the following definitions (replace it by valid data!).
<?php // TELEGRAM define("TELEGRAM_API_TOKEN", "YOUR_TELEGRAM_TOKEN"); define("TELEGRAM_LISTENER_URL", "https://telegram.example.com/listener.php"); define("BOT_OFFICIAL_NAME", "YOUR_BOT_NAME"); // DATABASE define("dbserver", "localhost"); define("dbpassword", "YOUR_PW"); define("dbusername", "YOUR_USER"); define("dbdatabase", "YOUR_DB"); // MEMES define("meme_api_login", "YOUR_MEME_LOGIN"); define("meme_api_pw", "YOUR_MEME_PW"); // WEATHER define("weather_appid", "YOUR_OPEN_WEATHER_API_KEY"); // WOLFRAM define("WOLFRAM_API_KEY", "YOUR_WOLFRAM_API_KEY"); ?>
Then you just have to call https://telegram.example.com/register.php once to make Telegram push new messages to your server – that is all you need.