-
Search BotFather in telegram chat
- Run Command
/start
- Run Command
/newbot
, fill Bot username and Bot Name, to get token
- open chat
t.me/GZeinNumerBot
- Red Mark is My Token
https://api.telegram.org/bot601_________92:AAF________________Bg/getupdates
Result
sent hai
message
https://api.telegram.org/bot601_________92:AAF________________Bg/getupdates
- Now you can get
chat_id
- Now sent chat via url
https://api.telegram.org/bot601_________92:AAF________________Bg/sendMessage?chat_id=796251625&text=haizein
- run this file in URL
localhost\html_telegram_bot\index.php
//index.php
<?php
$token = "bot601_________92:AAF________________Bg";
$data = [
"text" => 'pesannya disini',
'chat_id' => '796251625',
];
$a = file_get_contents("https://api.telegram.org/$token/sendMessage?" . http_build_query($data));
Copyright 2023 M. Fadli Zein