-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot-tel-proses.php
41 lines (34 loc) · 1016 Bytes
/
bot-tel-proses.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
<?php
if (!defined('RA')) {
die('Tidak dapat diakses langsung.');
}
function prosesApiMessage($sumber)
{
if (isset($sumber['message'])) {
$message = $sumber['message'];
if (isset($message['text'])) {
prosesPesanTeks($message);
}
}
if (isset($sumber['callback_query'])) {
prosesCallBackQuery($sumber['callback_query']);
}
return $updateid;
}
function prosesPesanTeks($message)
{
$pesan = $message['text'];
$chatid = $message['chat']['id'];
$fromid = $message['from']['id'];
$fromname = $message['from']['first_name'];
switch (true) {
case $pesan == '/start':
$text = "Halo ".$fromname."!\nRobot berhasil mengeksekusi!\n\nSilakan untuk mengembangkan sendiri 😊";
sendApiMsg($chatid, $text, 'Markdown');
break;
default:
$text = "Mohon maaf, perintah yang anda kirimkan tidak ada 🙏";
sendApiMsg($chatid, $text, 'Markdown');
break;
}
}