· 6 years ago · Oct 12, 2019, 10:16 AM
1<?php
2
3include "vk_api.php"; // vk_api addon
4
5
6const VK_KEY = "8db7703a17e7d308aa1861cdbcaa1ae630704e02201f46121e7aea224b74f11f1bba75bfa24a15552b4f3"; // Token Group
7const ACCESS_KEY = "5f92c475"; // VK Group Key
8const VERSION = "5.81"; // API Version
9
10
11// buttons
12const BTN_1 = [["command" => 'btn_1'], "Проблемы с модпаком", "green"];
13const BTN_2 = [["command" => 'btn_2'], "Проблемы с IP", "green"];
14const BTN_3 = [["command" => 'btn_3'], "Проблемы с сервером", "green"];
15const BTN_5 = [["command" => 'btn_5'], "Проблемы с сайтом", "green"];
16const BTN_6 = [["command" => 'btn_6'], "Задать вопрос", "green"];
17const BTN_7 = [["command" => 'btn_7'], "Не помогло", "red"];
18
19
20$vk = new vk_api(VK_KEY, VERSION);
21$data = json_decode(file_get_contents('php://input'));
22
23if ($data->type == 'confirmation') {
24 exit(ACCESS_KEY);
25}
26$vk->sendOK();
27// vars
28$peer_id = $data->object->peer_id;// Id user
29$message = $data->object->text; // text user
30// vars
31
32if ($data->type == 'message_new') { // create check new message
33 if($message == 'Проблема') {
34$vk->sendButton($peer_id, "Выберите к чему относится ваша проблема 🖥", [[BTN_1], [BTN_2], [BTN_3], [BTN_5], [BTN_6], [BTN_7]]);
35
36 }
37 if($message == 'проблема') {
38$vk->sendButton($peer_id, "Выберите к чему относится ваша проблема 🖥", [[BTN_1], [BTN_2], [BTN_3], [BTN_5], [BTN_6], [BTN_7]]);
39
40 }
41
42}
43
44 if($message == 'Проблемы с модпаком') {
45$vk->sendButton($peer_id, "Временно не доступно 📠");
46
47 }
48
49 if($message == 'Проблемы с IP') {
50$vk->sendButton($peer_id, "Временно не доступно 📠");
51
52 }
53
54 if($message == 'Проблемы с сервером') {
55$vk->sendButton($peer_id, "Временно не доступно 📠");
56
57 }
58
59 if($message == 'Проблемы с сайтом') {
60$vk->sendButton($peer_id, "Временно не доступно 📠");
61
62 }
63
64 if($message == 'Задать вопрос') {
65$vk->sendButton($peer_id, "Задайте интересующий вас вопрос,\nсотрудники тех.поддержки обязательно вам ответят💬");
66
67 }
68
69 if($message == 'Не помогло') {
70$vk->sendButton($peer_id, "Опишите вашу проблему,\nсотрудники тех.поддержки обязательно вам ответят💬");
71
72 }