-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlike.php
More file actions
142 lines (142 loc) · 3.87 KB
/
like.php
File metadata and controls
142 lines (142 loc) · 3.87 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
/*
by KasperTP
Ch : @dev_kasper and @errorphp
*/
ob_start();
define("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);
}
}
$up = json_decode(file_get_contents("php://input"));
$msg = $up->message;
$text = $msg->text;
$ids = $msg->chat->id;
$id = $msg->from->id;
$get = file_get_contents("unll.txt");
$data = $up->callback_query->data;
$name = $up->callback_query->from->first_name;
$user = "@".$up->callback_query->from->username;
$txt = file_get_contents("text.txt");
$names = file_get_contents("name.txt");
$link = file_get_contents("link.txt");
$sudo = "ايدي المطور";
$ch = "معرف القناة";
$list = json_encode([
'inline_keyboard'=>[
[
['text'=>'👍', 'callback_data'=>"like"],['text'=>'👎', 'callback_data'=>"dislike"]
],
[
['text'=>"$names", 'url'=>"$link"]
]
]
]);
function msg($ids, $text){
bot("sendMessage",[
"chat_id"=>$ids,
"text"=>$text,
'parse_mode'=>markdown,
'disable_web_page_preview'=>true,
]);
}
if($text == "/start" and $id == $sudo){
file_put_contents("unll.txt", "go");
msg($ids, "مرحبا بك عزيزي في بوت تصويت 📊
ارسل ما تريد تصويت عليه وسيتم نشرة 🤷♂");
}
if($text and $get == "go" and $id == $sudo){
file_put_contents("text.txt", $text);
file_put_contents("unll.txt", "1");
msg($ids, "- ارسل الان اسم للكيبورد 🔰 •");
}
if($text and $get == 1 and $id == $sudo){
file_put_contents("name.txt", $text);
file_put_contents("unll.txt", "2");
msg($ids, "- ارسل الان رابط للكيبورد 🔰 •");
}
if($text and $get == 2 and $id == $sudo){
file_put_contents("link.txt", $text);
file_put_contents("unll.txt", " ");
$txt = file_get_contents("text.txt");
$names = file_get_contents("name.txt");
$link = file_get_contents("link.txt");
bot('sendMessage',[
'chat_id'=>$id,
'text'=>"$txt",
'parse_mode'=>'MARKDOWN',
'disable_web_page_preview'=>'true',
'reply_markup'=>json_encode([
'inline_keyboard'=>[
[
['text'=>'👍', 'callback_data'=>"like"],['text'=>'👎', 'callback_data'=>"dislike"]
],
[
['text'=>"$names", 'url'=>"$link"]
]
]
])
]);
msg($ids, "- الان هاذه هيه رسالتك ☑️ •
- اذا تريد نشر ارسل (نعم)🔺•
- او تريد الغاء الامر ارسل (لا)🔻•");
}
if($text == "لا" and $id == $sudo){
file_put_contents("text.txt", " ");
file_put_contents("name.txt", " ");
file_put_contents("link.txt", " ");
file_put_contents("unll.txt", "stop");
msg($ids, "- تم الغاء الامر بنجاح 🔘 •");
}
if($text == "نعم" and $id == $sudo){
file_put_contents("unll.txt", "stop");
msg($ids, "- تم نشر المنشور بنجاح ☑️ •");
bot('sendMessage',[
'chat_id'=>$ch,
'text'=>"$txt",
'parse_mode'=>'MARKDOWN',
'disable_web_page_preview'=>'true',
'reply_markup'=>$list
]);
}
if($data == "like"){
bot('answerCallbackQuery',[
'callback_query_id'=>$up->callback_query->id,
'text'=>"- لقد تم تسجيل :: 👍 •",
'show_alert'=>true,
]);
bot("sendMessage",[
"chat_id"=>$sudo,
"text"=>"- هاذه الشخص اضغط :: 👍 •
- اسمه :: $name 🐝 •
- معرفه :: $user 🐛 •",
]);
}
if($data == "dislike"){
bot('answerCallbackQuery',[
'callback_query_id'=>$up->callback_query->id,
'text'=>"- لقد تم تسجيل :: 👎 •",
'show_alert'=>true,
]);
bot("sendMessage",[
"chat_id"=>$sudo,
"text"=>"- هاذه الشخص اضغط :: 👎 •
- اسمه :: $name 🐝 •
- معرفه :: $user 🐛 •",
]);
}
if($text != "/start" and $get == "stop" and $id == $sudo){
msg($ids, "- اذا تريد استخدام البوت مره اخره 🔄 •
- ارسل امر /start من جديد ☑️ •");
}
?>