Skip to content
This repository was archived by the owner on Sep 15, 2020. It is now read-only.

Commit 0622908

Browse files
committed
minor fixing bug
1 parent 9624b2b commit 0622908

File tree

2 files changed

+53
-48
lines changed

2 files changed

+53
-48
lines changed

Diff for: .idea/workspace.xml

+41-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: evilbot.php

+12-37
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
include 'LineCross.php';
44
use x9119x\LineCross;
55

6-
const AUTH_TOKEN = "";
6+
const AUTH_TOKEN = ""; //PUT YOUR AuthToken HERE
7+
const ADMIN_MID = ""; //YOUR LINE UNIQUE ID FROM LINE DATABASE
78

8-
$AuthInfo = new \x9119x\AuthInfo(AUTH_TOKEN);
9+
10+
$AuthInfo = new \x9119x\AuthInfo(AUTH_TOKEN); //Put AUTH_TOKEN HERE
911

1012
try{
11-
$Line = new LineCross();
13+
$Line = new LineCross($AuthInfo); //Put $AuthInfo HERE
1214
}catch(x9119x\TalkException $e) {
1315
echo "\033[0;31m[ERROR]\033[0m".$e->reason . PHP_EOL;
1416
exit;
@@ -69,10 +71,12 @@ public function Alloc($Ops){
6971

7072
$args = explode(" ", $text);
7173
if($args[0] == "members"){
72-
if($this->_from != "u5e7641aec03eaaf4513227c7aeef5c97"){
73-
$this->Line->LineService->sendMessage("who the fuck are you? you're not admin!", $Op->message->to);
74+
if($this->_from != ADMIN_MID){
75+
$this->Line->LineService->sendMessage("who are you? you're not admin!", $Op->message->to);
7476
return;
7577
}
78+
79+
//GET GROUP INFO
7680
$getGroupInfo = $this->Line->LineService->getGroup($Op->message->to);
7781

7882
$members = "";
@@ -82,29 +86,15 @@ public function Alloc($Ops){
8286
}
8387
$this->Line->LineService->sendMessage($members, $Op->message->to);
8488
}else if($args[0] == strtolower("kick")){
85-
//GET ACCEPTED ACCOUNT
86-
$getIDs = json_decode(file_get_contents("debugGroupMLHY"), true);
87-
$accIDs = array();
88-
89-
foreach($getIDs["members"] as $key){
90-
array_push($accIDs, $key["mid"]);
91-
}
92-
//CHECK ACCEPTED ACCOUNT
93-
if(!in_array($this->_from, $accIDs)){
94-
$this->Line->LineService->sendMessage("who the fuck are you? you're not admin!", $Op->message->to);
95-
return;
96-
}
97-
98-
//CHECK GROUP
99-
if($Op->message->to == "c8f25b930e19bd85e65c856de0f44399a"){
100-
$this->Line->LineService->sendMessage("u can't kick this group, BITCH!", $Op->message->to);
89+
if($this->_from != ADMIN_MID){
90+
$this->Line->LineService->sendMessage("who are you? you're not admin!", $Op->message->to);
10191
return;
10292
}
10393

10494
//GET GROUP INFO
10595
$getGroupInfo = $this->Line->LineService->getGroup($Op->message->to);
10696

107-
//THIS SHIT IS TO GET ALL THE MEMBERS IN THE GROUP
97+
//GET ALL THE MEMBERS IN THE GROUP
10898
$memIDs = array();
10999
$count = 0;
110100
foreach($getGroupInfo->members as $key){
@@ -159,24 +149,9 @@ public function Alloc($Ops){
159149
echo $ex->getMessage().PHP_EOL;
160150
}
161151

162-
163-
//GET GROUP INFO BY GROUP ID
164-
//$getGroupInfo = $this->Line->LineService->getGroup($getGroupIDByInvite[0]);
165-
166152
//GET GROUP COMPACT
167153
$getCompactGroup = $this->Line->LineService->getCompactGroup($getGroupIDByInvite[0]);
168154

169-
//GET LIST MEMBERS OF GROUP
170-
/**
171-
ob_start();
172-
foreach($getCompactGroup as $key){
173-
print_r($key);
174-
}
175-
$y = ob_get_clean();
176-
*/
177-
//file_put_contents("./debugGroupMLHY", json_encode($getCompactGroup, 0));
178-
179-
//yield $this->MessageContactBuilder((array) $getGroupInfo->creator);;
180155
yield $getCompactGroup;
181156
break;
182157
default:

0 commit comments

Comments
 (0)