-
Notifications
You must be signed in to change notification settings - Fork 2
/
startAsking.php
42 lines (40 loc) · 1.43 KB
/
startAsking.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
<?php
/**
* Created by PhpStorm.
* User: alavi
* Date: 2/22/17
* Time: 4:00 PM
*/
function startAsking() //handle the first request to bot after showing the question * level = answering
{
global $db;
global $user_id;
global $text;
global $locale;
if($text == "Ca_nC_31")
question_menu();
else
{
mysqli_query($db, "UPDATE padporsc_bot4.users SET current_level = 'answering', current_content = \"{$text}\" WHERE user_id = {$user_id}");
if ($locale == "farsi")
makeCurl("sendMessage", ["chat_id" => $user_id, "text" => "هروقت پاسخت تکمیل شد بزن رو دکمه ی زیر.",
"reply_markup" => json_encode([
"inline_keyboard" => [
[
["text" => "تمومش کن","callback_data" => "3nD_iT"]
]
]
])
]);
elseif ($locale == "english")
makeCurl("sendMessage", ["chat_id" => $user_id, "text" => "I you have finished writing tap on the button below.Or you can continue writing without any problem",
"reply_markup" => json_encode([
"inline_keyboard" => [
[
["text" => "End it","callback_data" => "3nD_iT"]
]
]
])
]);
}
}