Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F628976
example-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
605 B
Referenced Files
None
Subscribers
None
example-set.php
View Options
<?php
//Composer Loader
$loader
=
require
__DIR__
.
'/vendor/autoload.php'
;
$API_KEY
=
'your_bot_api_key'
;
$BOT_NAME
=
'namebot'
;
$link
=
'https://yourdomain/yourpath_to_hook.php'
;
try
{
// create Telegram API object
$telegram
=
new
Longman
\
TelegramBot
\
Telegram
(
$API_KEY
,
$BOT_NAME
)
;
// set webhook
$result
=
$telegram
->
setWebHook
(
$link
)
;
//Uncomment to use certificate
//$result = $telegram->setWebHook($link, $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, 5:37 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
115264
Default Alt Text
example-set.php (605 B)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline