Skip to content

Instantly share code, notes, and snippets.

@itskenny0
Last active August 22, 2016 19:32
Show Gist options
  • Save itskenny0/b87f251c8e2da53b2b8f88baf5424759 to your computer and use it in GitHub Desktop.
Save itskenny0/b87f251c8e2da53b2b8f88baf5424759 to your computer and use it in GitHub Desktop.
Possibly the tiniest 'Hello World' webhook bot you can write in PHP without any libraries.
<?php
$chat = json_decode(file_get_contents("php://input"))->message->chat->id;
header("Content-Type: application/json");
echo json_encode(array("method" => "sendMessage", "text" => "Hello World", "chat_id" => $chat));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment