-
Notifications
You must be signed in to change notification settings - Fork 11
/
bot.php
106 lines (90 loc) · 2.61 KB
/
bot.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
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
////////BENCHAMIN LOUIS//////
//CHANNEL:- T.ME/INDUSBOTS////
error_reporting(0);
set_time_limit(0);
flush();
$API_KEY = $_ENV['BOT_TOKEN'];
##------------------------------##
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, $model){
bot('sendMessage',[
'chat_id'=>$chat_id,
'text'=>$text,
'parse_mode'=>$mode
]);
}
function sendaction($chat_id, $action){
bot('sendchataction',[
'chat_id'=>$chat_id,
'action'=>$action
]);
}
//==============BENCHAM======================//
$update = json_decode(file_get_contents('php://input'));
$message = $update->message;
$message_id = $update->message->id;
$chat_id = $message->chat->id;
$name = $from_id = $message->from->first_name;
$from_id = $message->from->id;
$text = $message->text;
$fromid = $update->callback_query->from->id;
$username = $update->message->from->username;
$chatid = $update->callback_query->message->chat->id;
$callback_query = $update->callback_query->data;
$messageid = $update->callback_query->message->message_id;
$reply = $update->message->reply_to_message->message_id;
$START_MESSAGE = $_ENV['START_MESSAGE'];
//===============BENCHAM=============//
if ($text == "/start") {
bot('sendmessage', [
'chat_id' =>$chat_id,
'text' =>"***$START_MESSAGE
Use*** `/bin <First 6 digit of the bin>` ***Support: ko-fi.com/devillD***",
'parse_mode'=>'MarkDown',
]);
}if(strpos($text,"/bin") !== false){
$bin = trim(str_replace("/bin","",$text));
$data = json_decode(file_get_contents("https://api.api-zero.workers.dev/bin/$bin"),true);
$bank = $data['data']['BIN/IIN'];
$vendor = $data['data']['Card Brand'];
$type = $data['data']['Card Type'];
$level = $data['data']['Card Level'];
$bank = $data['data']['Issuer Name / Bank'];
$country = $data['data']['ISO Country Name'];
if($data['data']){
bot('sendmessage', [
'chat_id' =>$chat_id,
'text' =>"***
➲ Bin : $bin
➲ Level : $level
➲ Type : $type
➲ Brand : $vendor
➲ Bank : $bank
➲ Country : $country
Bot by @unkusr
***",
'parse_mode'=>"MarkDown",
]);
}
else {
bot('sendmessage', [
'chat_id' =>$chat_id,
'text' =>"INVALID BIN! Try once again :)",
]);
}
}
?>