process-telegram-updates/commands/command_1.sample.php

39 lines
1.3 KiB
PHP

<?php
return [
"command" => "/hello",
"description" => "simple 'hello' world command",
"callback" => function (array $from,array $chat,string $date,string $text) {
// TELEGRAM FUNCTIONS SAMPLE USAGE :
//
// telegram_send_text($chat['id'], "Olá, Fred! <b>Negrito</b>");
// telegram_send_file($chat['id'], '/path/to/image.jpg', 'photo', 'Here is a photo');
// telegram_send_file($chat['id'], '/path/to/report.pdf', 'document', 'Monthly report');
//
// [from] => Array
// (
// [id] => 122054164
// [is_bot] =>
// [first_name] => Fred
// [last_name] => Flinstone
// [username] => fredflinstone
// [language_code] => en
// [is_premium] => 1
// )
//
// [chat] => Array
// (
// [id] => 122054164
// [first_name] => Fred
// [last_name] => Flinstone
// [username] => fredflinstone
// [type] => private
// )
//
// [date] => 1756281243
// [text] => tudo bem?
telegram_send_text($chat['id'], "world");
}
];