Skip to content

Commit 2ba5c48

Browse files
committed
:
1 parent 9903d7a commit 2ba5c48

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

example-set.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
//Composer Loader
3+
$loader = require __DIR__.'/vendor/autoload.php';
4+
5+
$API_KEY = 'your_bot_api_key';
6+
$BOT_NAME = 'namebot';
7+
8+
try {
9+
// create Telegram API object
10+
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
11+
// set webhook
12+
echo $telegram->setWebHook('https://yourdomain/yourpath_to_hook.php');
13+
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
14+
echo $e->getMessage();
15+
}

0 commit comments

Comments
 (0)