-
Notifications
You must be signed in to change notification settings - Fork 78
/
wasap-sendmsg.php
45 lines (37 loc) · 1.33 KB
/
wasap-sendmsg.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
<?php
echo "+\n+ [wasapbot]\n+\n";
// error_reporting(E_ERROR | E_WARNING | E_PARSE);
date_default_timezone_set('Asia/Jakarta');
$debug = false;
require_once 'whatsapp/src/whatsprot.class.php';
$nickname = "wasapbot"; // bot nickname
$username = "62xxxxxxxxxxx"; // bot number
$password = "C34G7Cauuw8lbxxxxxxxxxxxxxxxx"; // password
// konek ------------------------------------------------------------------------------------------------------------
echo "+ Login sebagai $nickname ($username)\n+\n";
$w = new WhatsProt($username, $nickname, $debug);
sleep(3);
$w->connect();
$w->loginWithPassword($password);
$w->sendGetServerProperties();
$w->sendClientConfig();
$w->sendGetGroups();
$w->sendPing();
// kirim pesan ke nomor tujuan --------------------------------------------------------------------------------------
$target="62xxxxxxxxxxx";
$pesan="Halo Dunia!";
echo "+ Mengirim pesan\n";
echo "+ target : $target\n";
echo "+ pesan : $pesan\n+\n";
$w->sendMessageComposing($target); // typing..
sleep(3);
$w->sendMessagePaused($target); // selesai typing
sleep(1);
$w->sendMessage($target, $pesan); // kirim pesan
$w->pollMessage();
sleep(1);
$w->pollMessage();
sleep(1);
$w->pollMessage();
echo "+ Selesai\n+\n";
?>