-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBale.PHP
93 lines (72 loc) · 2.88 KB
/
Bale.PHP
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
<?php
/********** -Info- **********/
$BotToken = "-- Bale Bot Token --";
$BotMainURL = "https://tapi.bale.ai/bot" . $BotToken;
define('BotMainAPI', $BotMainURL);
/********** -Info- **********/
/**********************************************/
/********** -GetUpdate- **********/
$Update = file_get_contents('php://input');
file_put_contents('data/bot.Txt', $Update);
$Update = json_decode($Update, TRUE);
if (isset($Update['callback_query'])) {
$BotMassegeId = $Update['callback_query']['message']['message_id'];
$BotChatID = $Update['callback_query']['from']['id'];
$BotMessageText = $Update['message']['text'];
$BotData = $Update['callback_query']['data'];
}
else
{
$BotMassegeId = $Update['message']['message_id'];
$BotChatID = $Update['message']['chat']['id'];
$BotMessageText = $Update['message']['text'];
}
/********** -GetUpdate- **********/
/**********************************************/
/********** -Api- **********/
function getMe() ///// getMe /////
{
return file_get_contents(BotMainAPI."/getMe");
}
function getUpdates() ///// getUpdates /////
{
return file_get_contents(BotMainAPI."/getUpdates");
}
function getChat($ChatID) ///// getChat /////
{
file_get_contents(BotMainAPI."/sendMessage?chat_id=".$ChatID);
}
function sendMessage($ChatID, $MassegeText) ///// sendMessage /////
{
file_get_contents(BotMainAPI."/sendMessage?chat_id=".$ChatID."&text=".$MassegeText);
}
function editMessage($ChatID, $MassegeID, $MessageText) ///// editMessage /////
{
file_get_contents(BotMainAPI."/editMessageText?chat_id=".$ChatID."&message_id=".$MassegeID."&text=".$MessageText);
}
function deleteMessage($ChatID, $MassegeID) ///// deleteMessage /////
{
file_get_contents(BotMainAPI."/deleteMessage?chat_id=".$ChatID."&message_id=".$MassegeID);
}
function sendPhotoCaption($ChatID, $PhotoFile , $Caption) ///// sendPhotoCaption /////
{
file_get_contents(BotMainAPI."/sendPhoto?chat_id=".$ChatID."&photo=".$PhotoFile."&caption=".$Caption);
}
function sendVideoCaption($ChatID, $VideoFile , $Caption) ///// sendVideoCaption /////
{
file_get_contents(BotMainAPI."/sendVideo?chat_id=".$ChatID."&video=".$VideoFile."&caption=".$Caption);
}
function sendAudioCaption($ChatID, $AudioFile , $Caption) ///// sendAudioCaption /////
{
file_get_contents(BotMainAPI."/sendAudio?chat_id=".$ChatID."&audio=".$AudioFile."&caption=".$Caption);
}
function sendVoiceCaption($ChatID, $VoiceFile , $Caption) ///// sendVoiceCaption /////
{
file_get_contents(BotMainAPI."/sendVoice?chat_id=".$ChatID."&voice=".$VoiceFile."&caption=".$Caption);
}
function sendDocumentCaption($ChatID, $DocumentFile , $Caption) ///// sendDocumentCaption /////
{
file_get_contents(BotMainAPI."/sendDocument?chat_id=".$ChatID."&document=".$DocumentFile."&caption=".$Caption);
}
/********** -Api- **********/
?>