Skip to content

Instantly share code, notes, and snippets.

@andreafortuna
Last active January 25, 2018 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreafortuna/47e1c33a121bb3997aa66c868511f767 to your computer and use it in GitHub Desktop.
Save andreafortuna/47e1c33a121bb3997aa66c868511f767 to your computer and use it in GitHub Desktop.
Simple Telegram Echo Bot
<?php
call_user_func(function($hookObj){file_get_contents("https://api.telegram.org/bot<YOURTOKEN>/sendMessage?chat_id=" .$hookObj["message"]["chat"]["id"] . "&text=" . urlencode($hookObj['message']['text']));},json_decode(file_get_contents("php://input"), true));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment