-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelegram.php
More file actions
58 lines (46 loc) · 1.11 KB
/
Copy pathtelegram.php
File metadata and controls
58 lines (46 loc) · 1.11 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
require_once "env.php";
Class Telegram {
private $TELEGRAM_API_PATH;
private $userId;
private $username;
private $chatId;
private $messageText;
public function __construct() {
global $ENV;
$this->TELEGRAM_API_PATH = "https://api.telegram.org/bot" . $ENV["TELEGRAM_BOT_TOKEN"];
}
public function returnTgMessage($m) {
if ($this->chatId) {
file_get_contents($this->TELEGRAM_API_PATH . "/sendmessage?chat_id=" . $this->chatId . "&text=" . urlencode($m));
}
}
public function getTelegramPath() {
return $this->TELEGRAM_API_PATH;
}
public function setUserId($uid) {
$this->userId = $uid;
}
public function getUserId() {
return $this->userId;
}
public function setUsername($un) {
$this->username = $un;
}
public function getUsername() {
return $this->username;
}
public function setChatId($c) {
$this->chatId = $c;
}
public function getChatId() {
return $this->chatId;
}
public function setMessageText($m) {
$this->messageText = $m;
}
public function getMessageText() {
return $this->messageText;
}
}
?>