Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 8 hours ago, SHIEVIP said: @Magd Almuntaser May I have your repaired file please? i don't know what you mean but all my files that i've fixed is here .. you can see the code and replace your file.. Quote Link to comment Share on other sites More sharing options...
Micro Creatives Posted August 19, 2023 Share Posted August 19, 2023 @Magd Almuntaser still auto reply not work by replacing files what you provided Quote Link to comment Share on other sites More sharing options...
divysriv Posted August 19, 2023 Share Posted August 19, 2023 @Magd Almuntaser 17 minutes ago, Magd Almuntaser said: if you install script on windows local server like xampp or other you can open CMD and run in the root script : php artisan serve don't close the CMD window .. and open another CMD and run in the root script: node . don't close the CMD window. you can open browser and enter (127.0.0.1:8000) and your whatsapp server is (127.0.0.1:3100) =========================== if you run this script on your linux website you can create or edit .htaccess file in the root: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} !^/socket.io/ RewriteCond %{REQUEST_URI} !^/backend-* RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ /public/$1 [L,QSA] </IfModule> <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> and you can open your website link and see if working or not .. if not working you go to yoursite . com/public/home after install the script you can change the .env file and correct the link to your site.. to run the whatsapp server you need to install nodejs and run: node . any qustion im here After doing all it just showing blank page on opening site, i'm using cpanel and installing on subdomain Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 3 minutes ago, divysriv said: @Magd Almuntaser After doing all it just showing blank page on opening site, i'm using cpanel and installing on subdomain try to open this link sub.yoursite. com/public/home Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 8 minutes ago, Micro Creatives said: @Magd Almuntaser still auto reply not work by replacing files what you provided after you replace the file you need to restart nodejs .. Quote Link to comment Share on other sites More sharing options...
divysriv Posted August 19, 2023 Share Posted August 19, 2023 5 minutes ago, Magd Almuntaser said: try to open this link sub.yoursite. com/public/home It showing blank Quote Link to comment Share on other sites More sharing options...
Micro Creatives Posted August 19, 2023 Share Posted August 19, 2023 @Magd Almuntaser after modify that file and restart node.js and delete all old autoreply commands and created new command ...still not working ! autoreply Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 10 minutes ago, divysriv said: It showing blank DM send me you link Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 3 minutes ago, Micro Creatives said: @Magd Almuntaser after modify that file and restart node.js and delete all old autoreply commands and created new command ...still not working ! autoreply send the word from your phone and screenshot your ssh window .. that mean give me the log to know what is the error you have Quote Link to comment Share on other sites More sharing options...
divysriv Posted August 19, 2023 Share Posted August 19, 2023 3 minutes ago, Magd Almuntaser said: DM send me you link Done Quote Link to comment Share on other sites More sharing options...
SHIEVIP Posted August 19, 2023 Share Posted August 19, 2023 @Magd Almuntaser When i try send message and show error like this Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 7 minutes ago, SHIEVIP said: @Magd Almuntaser When i try send message and show error like this your website disable eval function .. so you need to decode all files that encoded.. i decoded this two files for you. so first if you use 5.5.0 you can replace this file inside this file (app/Services/Impl/WhatsappServiceImpl.php) : <?php namespace App\Services\Impl; use App\Services\WhatsappService; use Illuminate\Support\Facades\Http; class WhatsappServiceImpl implements WhatsappService { private $url; public function __construct() { $this->url = env('WA_URL_SERVER'); } public function fetchGroups($device): object { $fetch = Http::withOptions(['verify' => false])->asForm()->post($this->url .'/backend-getgroups',['token' => $device->body]); return json_decode($fetch->body()); } public function startBlast($data): object { $res = Http::withOptions(['verify' => false]) ->asForm() ->post( $this->url . '/backend-blast', [ 'data' => json_encode($data), 'delay' => 1, ] ); return json_decode($res->body()); } public function sendText($request,$receiver): object | bool { $results = Http::withOptions(['verify' => false])->asForm()->post($this->url . '/backend-send-text', [ 'token' => $request->sender, 'number' =>$receiver, 'text' => $request->message, ]); return json_decode($results->body()); } public function sendMedia($request,$receiver): object | bool { // GET FILE NAME from $request->url $fileName = explode('/', $request->url); $fileName = explode('.', end($fileName)); $fileName = $fileName[0]; $data = [ 'token' => $request->sender, 'url' => $request->url, 'number' => $receiver, 'caption' => $request->caption ?? '', 'filename' => $fileName, 'type' => $request->media_type, 'ptt' => $request->ptt ? ($request->ptt == 'vn' ? true : false) : false, ]; $results = Http::withOptions(['verify' => false])->asForm()->post($this->url . '/backend-send-media', $data); return json_decode($results->body()); } public function sendButton($request,$receiver): object | bool { $buttons = []; foreach ($request->button as $button) { $buttons[] = ['displayText' => $button, ]; } // check url if exists,set to image if not exists cheeck thumbnail if exists set to image $image = $request->url ? $request->url : ($request->image ? $request->image : ''); $data = [ 'token' => $request->sender, 'number' => $receiver, 'button' => json_encode($buttons), 'message' => $request->message, 'footer' => $request->footer ?? '', 'image' => $image, ]; ; $results = Http::withOptions(['verify' => false])->asForm()->post($this->url . '/backend-send-button', $data); return json_decode($results->body()); } public function sendTemplate($request,$receiver): object | bool { $templates = []; $ii = 1; foreach ($request->template as $template) { $ii++; $typedest = explode('|', $template)[0] == 'url' ? 'url' : (explode('|', $template)[0] == 'call' ? 'phoneNumber' : 'id'); $type = explode('|', $template)[0] == 'id' ? 'quickReplyButton' : explode('|', $template)[0] . 'Button'; $templates[] = [ 'index' => $ii, $type => [ 'displayText' => explode('|', $template)[1], $typedest => explode('|', $template)[2], ], ]; } $image = $request->url ? $request->url : ($request->image ? $request->image : ''); $data = [ 'token' => $request->sender, 'number' => $receiver, 'button' => json_encode($templates), 'text' => $request->message, 'footer' => $request->footer ?? '', 'image' => $image, ]; $results = Http::withOptions(['verify' => false])->asForm()->post($this->url . '/backend-send-template', $data); return json_decode($results->body()); } public function sendList($request,$receiver) : Object | bool { $section['title'] = $request->title; $i = 1; foreach ($request->list as $menu) { $i++; $section['rows'][] = [ 'title' => $menu, 'rowId' => 'id' . $i, 'description' => '', ]; } $data = [ 'token' => $request->sender, 'number' => $receiver, 'list' => json_encode($section), 'text' => $request->message, 'footer' => $request->footer ?? '', 'title' => $request->title, 'buttonText' => $request->buttontext, ]; $results = Http::withOptions(['verify' => false])->asForm()->post($this->url . '/backend-send-list', $data); return json_decode($results->body()); } public function sendPoll ($request ,$receiver) : Object | bool { $optionss = []; foreach ($request->option as $opt) { $optionss[] = $opt; } $data = [ "token" => $request->sender, "number" => $receiver, "name" => $request->name, "options" => json_encode($optionss), "countable" => $request->countable === "1" ? true : false, ]; $results = Http::withOptions(['verify' => false])->asForm()->post($this->url . '/backend-send-poll', $data); return json_decode($results->body()); } } ?> and replace this code with (app/Services/Impl/MessageServiceImpl.php) : <?php namespace App\Services\Impl; use App\Services\MessageService; class MessageServiceImpl implements MessageService { public function formatText($text): array { return ['text' => $text]; } public function formatImage($url, $caption = ''): array { return ['image' => ['url' => $url], 'caption' => $caption]; } // formating buttons public function formatButtons($text, $buttons, $urlimage = '', $footer = '' ): array { $optionbuttons = []; $i = 1; foreach ($buttons as $button) { $optionbuttons[] = [ 'buttonId' => "id$i", 'buttonText' => ['displayText' => $button], 'type' => 1, ]; $i++; } $valueForText = $urlimage ? 'caption' : 'text'; $message = [ $valueForText => $text, 'buttons' => $optionbuttons, 'footer' => $footer, 'headerType' => 1, ]; if ($urlimage) { $message['image'] = ['url' => $urlimage]; } return $message; } // formating templates public function formatTemplates( $text,$buttons, $urlimage = '', $footer = ''): array { $templateButtons = []; $i = 1; foreach ($buttons as $button) { $type = explode('|', $button)[0] . 'Button'; $textButton = explode('|', $button)[1]; $urlOrNumber = explode('|', $button)[2]; $typeIcon = explode('|', $button)[0] === 'url' ? 'url' : 'phoneNumber'; $templateButtons[] = [ 'index' => $i, $type => ['displayText' => $textButton, $typeIcon => $urlOrNumber], ]; $i++; } $valueForText = $urlimage ? 'caption' : 'text'; $templateMessage = [ $valueForText => $text, 'footer' => $footer, 'templateButtons' => $templateButtons, 'viewOnce' => true, ]; //add image to templateMessage if exists if ($urlimage) { $templateMessage['image'] = ['url' => $urlimage]; } return $templateMessage; } public function formatLists ($text,$lists,$title,$name,$buttonText,$footer = '') : array { $section = [ 'title' => $title, ]; $i = 1; foreach ($lists as $menu) { $i++; $section['rows'][] = [ 'title' => $menu, 'rowId' => 'id' . $i, 'description' => '', ]; } $listMessage = [ 'text' => $text, 'footer' => $footer, 'title' => $name, 'buttonText' => $buttonText, 'sections' => [$section], 'viewOnce' => true, ]; return $listMessage; } public function format ($type, $data) : array { switch ($type) { case 'text': $reply = $this->formatText($data->message); break; case 'image': $reply = $this->formatImage($data->image, $data->caption ); break; case 'button': $buttons = []; foreach ($data->button as $button) { $buttons[] = $button; } $reply = $this->formatButtons( $data->message,$buttons,$data->image ? $data->image : '',$data->footer ?? '' ); break; case 'template': $buttons = []; foreach ($data->template as $button) { $buttons[] = $button; } try { $reply = $this->formatTemplates( $data->message,$buttons, $data->image ? $data->image : '',$data->footer ?? '' ); } catch (\Throwable $th) { throw new \Exception('Invalid button type'); } break; case 'list': $reply = $this->formatLists($data->message,$data->list,$data->title,$data->name,$data->buttontext,''); break; default: # code... break; } return $reply; } } ?> after that you try again to send msg if there is error screenshot to know what is the other files need decoded. Quote Link to comment Share on other sites More sharing options...
Arif Wicaksono Posted August 19, 2023 Share Posted August 19, 2023 Hello, anyone khow how to call variable name when sending scheduled message? please tell me Quote Link to comment Share on other sites More sharing options...
Clarar Posted August 19, 2023 Share Posted August 19, 2023 (edited) On 8/10/2023 at 9:50 PM, Micro Creatives said: Autoreply notworking since i installed, other features is working fine but only autoreply notworking ? i used shared hosting Hi friend Seems like an isolated issue with autoreply after installation. Shared hosting might be a factor. Check plugin settings and hosting compatibility for a quick fix. Quote Edited August 27, 2023 by Clarar 1 Quote Link to comment Share on other sites More sharing options...
Antoni Edi Kurniawan Posted August 19, 2023 Share Posted August 19, 2023 23 minutes ago, Clarar said: Hi friend Seems like an isolated issue with autoreply after installation. Shared hosting might be a factor. Check plugin settings and hosting compatibility for a quick fix. True Quote Link to comment Share on other sites More sharing options...
SHIEVIP Posted August 19, 2023 Share Posted August 19, 2023 @Magd Almuntaser still error sir Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 (edited) 1 hour ago, Clarar said: Hi friend Seems like an isolated issue with autoreply after installation. Shared hosting might be a factor. Check plugin settings and hosting compatibility for a quick fix. The problem when your friend send msg the format is: {"text":"Hello World"} the correct is: {text:"Hello World"} becouse the (text) is object not string.. so to fix the problem you can see my old reply Edited August 19, 2023 by Magd Almuntaser Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 11 minutes ago, SHIEVIP said: @Magd Almuntaser still error sir yes i know it's still not working becouse you don't replace what i give you in old reply i've sent to you (2) files you should replace the two files you forget MessageServiceImpl.php so back to my old reply and replace the correct files Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 ok this is the two files again .. MessageServiceImpl.phpWhatsappServiceImpl.php 1 Quote Link to comment Share on other sites More sharing options...
Magd Almuntaser Posted August 19, 2023 Share Posted August 19, 2023 (edited) Ok guys i've decoded all files in this script and fixed most errors like autoreply and others.. you can download from here: easyupload .io/3j7cjg remove space from link. Edited August 20, 2023 by Magd Almuntaser 2 2 Quote Link to comment Share on other sites More sharing options...
nikokenzo Posted August 19, 2023 Share Posted August 19, 2023 I prefer use version 5.2.0 no issues Quote Link to comment Share on other sites More sharing options...
divysriv Posted August 19, 2023 Share Posted August 19, 2023 1 hour ago, nikokenzo said: I prefer use version 5.2.0 no issues Do you have link of it, prefer providing as latest version is showing blank on installation on server Quote Link to comment Share on other sites More sharing options...
kecoamumet Posted August 20, 2023 Share Posted August 20, 2023 16 hours ago, Magd Almuntaser said: Ok guys i've decoded all files in this script and fixed most errors like autoreply and others.. you can download from here: mediafire .com/file/i61pnpkx3qj5an5/whatsapp-gateway-multi-device-v5.5.0-decoded.zip/file remove space from link. nice bro. ty so much. it work for autoreply. i hope other bug too. Quote Link to comment Share on other sites More sharing options...
divysriv Posted August 20, 2023 Share Posted August 20, 2023 @Magd Almuntaser when I select test message, under type message, no option is visible to write messages Quote Link to comment Share on other sites More sharing options...
Zero828 Posted August 20, 2023 Share Posted August 20, 2023 @Magd Almuntaser broken link sir Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.