Skip to content

Instantly share code, notes, and snippets.

@rizkyramadhan21
Created June 18, 2021 18:51
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 rizkyramadhan21/db498b3f2745aedc5dfece7182c7b684 to your computer and use it in GitHub Desktop.
Save rizkyramadhan21/db498b3f2745aedc5dfece7182c7b684 to your computer and use it in GitHub Desktop.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Bot extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$TOKEN = "TOKEN BOT ANDA";
$apiURL = "https://api.telegram.org/bot$TOKEN";
$update = json_decode(file_get_contents("php://input"), TRUE);
$chatID = $update["message"]["chat"]["id"];
$message = $update["message"]["text"];
if (strpos($message, "/start") === 0) {
file_get_contents($apiURL."/sendmessage?chat_id=".$chatID."&text=Haloo, test webhooks dicoffeean.com.&parse_mode=HTML");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment