Skip to content
This repository was archived by the owner on Jun 7, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 60 additions & 66 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,94 +2,88 @@
/*
copyright @ medantechno.com
Modified by Ilyasa
And Modified by Farzain - zFz ( Faraaz )
2017
*/
require_once('./line_class.php');

$channelAccessToken = 'YOUR-CHANNEL-ACCESS-TOKEN'; //Your Channel Access Token
$channelSecret = 'YOUR-CHANNEL-SECRET';//Your Channel Secret

$channelAccessToken = 'xq1ZicEYD8t+gkFSePswCnb2EVf/bo6fj4tB3VySMuWtZRUp6prf9TOwAYYp4tNDlACdpglyR0Yx3WCeCWplXWbyLYqi/jlyNvpFJ1+npW5c9q1EIii4iQciPDkfPIxhquEHP5OSYL6dLxEU6T3fowdB04t89/1O/w1cDnyilFU='; //Your Channel Access Token
$channelSecret = '068ed74c96a8b5bc4c066fce61209e7c';//Your Channel Secret
$client = new LINEBotTiny($channelAccessToken, $channelSecret);

$userId = $client->parseEvents()[0]['source']['userId'];
$userId = $client->parseEvents()[0]['source']['userId'];
$replyToken = $client->parseEvents()[0]['replyToken'];
$message = $client->parseEvents()[0]['message'];
$message = $client->parseEvents()[0]['message'];
$profil = $client->profil($userId);
$pesan_datang = $message['text'];

if($message['type']=='sticker')
{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => 'Terima Kasih Stikernya.'
)
)
);
{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => 'Terima Kasih Stikernya.'
)
)
);
}
else
$pesan=str_replace(" ", "%20", $pesan_datang);
$key = 'YOUR-API-KEY-SIMSIMI'; //API SimSimi
$key = 'df9b02ef-6b8a-4337-a383-80af09b0c6f0'; //API SimSimi
$url = 'http://sandbox.api.simsimi.com/request.p?key='.$key.'&lc=id&ft=1.0&text='.$pesan;
$json_data = file_get_contents($url);
$url=json_decode($json_data,1);
$diterima = $url['response'];
if($message['type']=='text')
{
if($url['result'] == 404)
{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => 'Mohon Gunakan Bahasa Indonesia Yang Benar :D.'
)
)
);
}
{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => 'Mohon Gunakan Bahasa Indonesia Yang Benar :D.'
)
)
);
}
else
if($url['result'] != 100)
{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => 'Maaf '.$profil->displayName.' Server Kami Sedang Sibuk Sekarang.'
)
)
);
}
else{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => ''.$diterima.''
)
)
);
}
{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => 'Maaf '.$profil->displayName.' Server Kami Sedang Sibuk Sekarang.'
)
)
);
}
else{
$balas = array(
'UserID' => $profil->userId,
'replyToken' => $replyToken,
'messages' => array(
array(
'type' => 'text',
'text' => ''.$diterima.''
)
)
);
}
}

$result = json_encode($balas);

file_put_contents('./reply.json',$result);


$client->replyMessage($balas);