-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset.php
More file actions
executable file
·35 lines (27 loc) · 811 Bytes
/
set.php
File metadata and controls
executable file
·35 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$API_KEY = '';
$BOT_NAME = 'Schaffenbot';
$admin_id = ; // userid von admin
//$GROUP_ID = -204065026; // bot test group
$GROUP_ID = -191031802; // schaffen cix
$BOT_URL = "https://api.telegram.org/bot" . $API_KEY . "/sendMessage";
$hook_url = ''; // url zur hook.php
$mysql_credentials = [
'host' => 'localhost',
'user' => '',
'password' => '',
'database' => '',
];
require __DIR__ . '/../vendor/autoload.php';
$commands_path = __DIR__ . '/commands/';
try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
// Set webhook
$result = $telegram->setWebhook($hook_url);
if ($result->isOk()) {
echo $result->getDescription();
}
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
echo $e;
}