Jump to content
Bicrypto v4.5.0 + All Plugins ×

Whatsapp Gateway | Multi Device v8.5.1


Magd Almuntaser

Recommended Posts

  • DW Members
Posted (edited)

Campaign Delay
(fix for 7.0.0 & 6.5.x & 5.5.0)

Reason: There is error in setting the delay for each message, causing all messages to be sent at once in a batch.
Solution: Remove the min function from the code.


Replace the following code in the app/Console/Commands/StartBlast.php file at line 77 from:

$data = [
	'data' => $blastdata,
	'type' => $campaign->type,
	'delay' => min($campaign->delay, 1),
	'campaign_id' => $campaign->id,
	'sender' => $campaign->device->body,
];


To:

$data = [
	'data' => $blastdata,
	'type' => $campaign->type,
	'delay' => $campaign->delay,
	'campaign_id' => $campaign->id,
	'sender' => $campaign->device->body,
];

 

Edited by Magd Almuntaser
  • Like 1
Link to comment
Share on other sites

24 minutes ago, Magd Almuntaser said:

Campaign Delay
(fix for 7.0.0 & 6.5.x & 5.5.0)

Reason: There is error in setting the delay for each message, causing all messages to be sent at once in a batch.
Solution: Remove the min function from the code.


Replace the following code in the app/Console/Commands/StartBlast.php file at line 77 from:

$data = [
	'data' => $blastdata,
	'type' => $campaign->type,
	'delay' => min($campaign->delay, 1),
	'campaign_id' => $campaign->id,
	'sender' => $campaign->device->body,
];


To:

$data = [
	'data' => $blastdata,
	'type' => $campaign->type,
	'delay' => $campaign->delay,
	'campaign_id' => $campaign->id,
	'sender' => $campaign->device->body,
];

 

Dari pada banyak replace scrip alangkah baiknya dijadikan satu faile saja menjadi v7.1 , jadi kita tinggal extrax di hosting/vps

Link to comment
Share on other sites

  • DW Members
1 hour ago, pak kacung said:

Dari pada banyak replace scrip alangkah baiknya dijadikan satu faile saja menjadi v7.1 , jadi kita tinggal extrax di hosting/vps

Saya akan melakukannya nanti, tetapi saya harus terlebih dahulu memposting semua perbaikan di sini karena perbaikan ini tidak hanya untuk satu versi. Ada versi 7.0.0, 6.5.0, dan 5.5.0, dan beberapa orang masih menggunakan versi yang lebih lama.
Jadi, jika saya membuat satu file untuk versi 7.0.0, mereka yang menggunakan versi lama tidak akan mendapatkan manfaatnya.
Juga, saya tidak bisa membuat versi 7.0.1 karena itu bukan pengembangan saya. Pengembang adalah satu-satunya yang mengendalikan penamaan ini. Jadi, jika saya memberikan nomor versi baru, pengembang mungkin merilis versi yang sama, dan perubahan saya akan berbeda dari versinya.

28 minutes ago, Zero828 said:

@Magd Almuntaser sir thanks for your efforts 

 

 

Make  all error fix then share please 🥺 

 

Thanks 

I will do that later, but I must first post all the fixes here since the fixes are not for a single version. There are versions 7.0.0, 6.5.0, and 5.5.0, and some people are still using older versions.
So, if I create a single file for version 7.0.0, those with older versions won't benefit.
And if I consider putting these modifications on GitHub so that others can know the changes made to the files and can download the versions, the developer will not agree and will report my GitHub account because it is a nulled version.

  • Love 1
Link to comment
Share on other sites

  • DW Members
1 hour ago, Enno Askrindo said:

@Magd Almuntaser I can't send Image Message, please help

You need SSH to fix your problem ..
First, you need to make sure that the APP_URL variable in the .env file contains the correct URL with http://
Second, open SSH, navigate to the root directory of the script, and enter this command:

php artisan storage:link

Done.. you can send image without problem ..

Link to comment
Share on other sites

  • DW Members
1 hour ago, agus amin said:

ada yang berhasil install di aapanel + SSL Cloudflare? kalau di hosting sudah jalan, VPS Aapanel + SSL Cloudflare belum

Ya, server saya menggunakan SSL.
Anda akan memerlukan banyak usaha untuk membuat script Anda berfungsi dengan SSL.
Pertama, Anda perlu mendapatkan SSL sendiri. Anda dapat membelinya dari internet atau mendapatkannya secara gratis melalui Let's Encrypt.
Anda juga perlu meletakkan file SSL di folder cert untuk nodejs dan juga mengubah pengaturannya.
Selain itu, Anda perlu mengubah opsi SSL di Cloudflare.

Oleh karena itu, saya sarankan Anda tetap tanpa SSL jika Anda pemula dalam hal server, atau beri tahu saya jika Anda tahu banyak tentang server sehingga saya dapat memberi Anda langkah-langkahnya.

1 hour ago, The Billionaire said:

@Magd Almuntaser 

Route::get('/schedule', [ScheduleMessageController::class, 'index'])->name('scheduleMessage');

ScheduleMessage Controller couldn't be found among the controllers inside Routes/mpedia.php

 

 

I didn't understand your question, but the schedule only uses cronjob, so its commands are only within the server and it doesn't have a specific interface.
You can check some files related to it in these paths:
- app/Console/Commands/ScheduleCron.php
- app/Console/Commands/StartBlast.php
- app/Console/Kernel.php
- app/Http/Controllers/CampaignController.php

Link to comment
Share on other sites

  • DW Members
1 hour ago, The Billionaire said:

@Magd Almuntaser 

Route::get('/schedule', [ScheduleMessageController::class, 'index'])->name('scheduleMessage');

ScheduleMessage Controller couldn't be found among the controllers inside Routes/mpedia.php

 

 

Oh, I understand your question now,😅 sorry for the delay in understanding.
Indeed, there is no class or controller named ScheduleMessageController.
I think the developer might have added it but didn't finish it because the schedule uses cronjob, so there's no need for a separate controller or class.

Link to comment
Share on other sites

3 minutes ago, Magd Almuntaser said:

Oh, I understand your question now,😅 sorry for the delay in understanding.
Indeed, there is no class or controller named ScheduleMessageController.
I think the developer might have added it but didn't finish it because the schedule uses cronjob, so there's no need for a separate controller or class.

@Magd Almuntaser Nice one

Link to comment
Share on other sites

On 7/6/2024 at 5:08 PM, Magd Almuntaser said:

AutoReply
(fix for 7.0.0 & 6.5.x & 5.5.0)

Reason: Because there is no connection to the WhatsApp server after connecting to the socket.
Solution: Connect to the WhatsApp server for all the numbers in the database after connecting to the socket.


Replace the server.js file located in the root directory of the script with the following code:
 

"use strict";

// Copyright By Ilman Sunanuddin, M pedia
// Email : Ilmansunannudin2@gmail.com
// website : https://m-pedia.co.id
// Whatsap : 6282298859671
// ------------------------------------------------------------------
// You are not allowed to share or sell this source code without permission.

const wa = require("./server/whatsapp");
const fs = require("fs");
const dbs = require('./server/database/index');
require("dotenv").config();
const lib = require("./server/lib");
global.log = lib.log;

/**
 * EXPRESS FOR ROUTING
 */
const express = require("express");
const app = express();
const http = require("http");
const server = http.createServer(app);

/**
 * SOCKET.IO
 */
const { Server } = require("socket.io");
const io = new Server(server);
const port = process.env.PORT_NODE;
app.use((req, res, next) => {
  res.set("Cache-Control", "no-store");
  req.io = io;
  // res.set('Cache-Control', 'no-store')
  next();
});

const bodyParser = require("body-parser");

// parse application/x-www-form-urlencoded
app.use(
  bodyParser.urlencoded({
    extended: false,
    limit: "50mb",
    parameterLimit: 100000,
  })
);
// parse application/json
app.use(bodyParser.json());
app.use(express.static("src/public"));
app.use(require("./server/router"));

// console.log(process.argv)

io.on("connection", (socket) => {
  socket.on("StartConnection", (data) => {
    wa.connectToWhatsApp(data, io);
  });
  socket.on("ConnectViaCode", (data) => {
    wa.connectToWhatsApp(data, io, true);
  });
  socket.on("LogoutDevice", (device) => {
    wa.deleteCredentials(device, io);
  });
});
server.listen(port, console.log(`Server run and listening port: ${port}`));

dbs.db.query("SELECT * FROM devices WHERE status = 'Connected'", (err, results) => {
    if (err) {
      console.error('Error executing query:', err);
    }
    results.forEach(row => {
      const number = row.body;
      if (/^\d+$/.test(number)) {
        wa.connectToWhatsApp(number);
      }
    });
});

 

@Magd Almuntaser autoreply still not work sir. I've tried local and cpanel

Link to comment
Share on other sites

  • DW Members
4 hours ago, Putra Pertama said:

@Magd Almuntaser autoreply still not work sir. I've tried local and cpanel

After you use my file you need to restart nodejs ..

Autoreply working without any problem .. if you still have this problem you can PM me i will see what is your problem

Link to comment
Share on other sites

3 minutes ago, Magd Almuntaser said:

Oh now i know what is your problem .. you can see my post:

Campaign has not started

(fix for 7.0.0)

Looks like I forgot that step. I tried it from the beginning and now everything works fine. thanks sir

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...