Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F629799
set.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
613 B
Referenced Files
None
Subscribers
None
set.php
View Options
<?php
// Load composer
require
__DIR__
.
'/vendor/autoload.php'
;
$API_KEY
=
'your_bot_api_key'
;
$BOT_NAME
=
'username_bot'
;
$hook_url
=
'https://yourdomain/path/to/hook.php'
;
try
{
// Create Telegram API object
$telegram
=
new
Longman
\
TelegramBot
\
Telegram
(
$API_KEY
,
$BOT_NAME
)
;
// Set webhook
$result
=
$telegram
->
setWebHook
(
$hook_url
)
;
// Uncomment to use certificate
//$result = $telegram->setWebHook($hook_url, $path_certificate);
if
(
$result
->
isOk
(
)
)
{
echo
$result
->
getDescription
(
)
;
}
}
catch
(
Longman
\
TelegramBot
\
Exception
\
TelegramException
$e
)
{
echo
$e
;
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 15, 7:49 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
136384
Default Alt Text
set.php (613 B)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline