-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAccess.php
More file actions
97 lines (97 loc) · 2.39 KB
/
Access.php
File metadata and controls
97 lines (97 loc) · 2.39 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php /*
به نام آنکه هستی نام ازو یافت
فلک جنبش، زمین آرام ازو یافت
خدایی کافرینش در سجودش
گواهی مطلق آمد بر وجودش
جواهر بخش فکرتهای باریک
به روز آرندۀ شبهای تاریک
غم و شادی نگار و بیم و اُمّید
شب و روز آفرین و ماه و خورشید
------------------------------
The Source Bot: @NoMoBot
Channel News: @Norbert_Team
Support: @MosiDevBot
*/
##------------------------------##
ob_start();
##------------------------------##
$API_KEY = 'توکن ربات';
$ADMIN = array('260864889','دیگر ادمین ها');
##------------------------------##
define('API_KEY',$API_KEY);
function bot($method,$datas=[]){
$url = "https://api.telegram.org/bot".API_KEY."/".$method;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$datas);
$res = curl_exec($ch);
if(curl_error($ch)){
var_dump(curl_error($ch));
}else{
return json_decode($res);
}
}
function SendMessage($chat_id, $text, $mode = null){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>$text,
'parse_mode'=>$mode
]);
}
function ForwardMessage($chat_id, $from_chat, $message_id){
bot('ForwardMessage',[
'chat_id'=>$chat_id,
'from_chat_id'=>$from_chat,
'message_id'=>$message_id
]);
}
function SendPhoto($chat_id, $photo, $caption = null){
bot('SendPhoto',[
'chat_id'=>$chat_id,
'photo'=>$photo,
'caption'=>$caption
]);
}
function SendAudio($chat_id, $audio, $caption= null){
bot('SendAudio',[
'chat_id'=>$chat_id,
'audio'=>$audio,
'caption'=>$caption
]);
}
function SendDocument($chat_id, $document, $caption = null){
bot('SendDocument',[
'chat_id'=>$chat_id,
'document'=>$document,
'caption'=>$caption
]);
}
function SendSticker($chat_id, $sticker){
bot('SendSticker',[
'chat_id'=>$chat_id,
'sticker'=>$sticker
]);
}
function SendVideo($chat_id, $video, $caption= null){
bot('SendVideo',[
'chat_id'=>$chat_id,
'video'=>$video,
'caption'=>$caption
]);
}
function SendVoice($chat_id, $voice, $caption = null){
bot('SendVoice',[
'chat_id'=>$chat_id,
'voice'=>$voice,
'caption'=>$caption
]);
}
function SendAction($chat_id, $action){
bot('SendChatAction',[
'chat_id'=>$chat_id,
'action'=>$action
]);
}
##------------------------------##
?>