Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 8471e1a

Browse files
committed
add api files
1 parent 415fd5a commit 8471e1a

File tree

3 files changed

+608
-0
lines changed

3 files changed

+608
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
class Define
23+
{
24+
const MESSENGER_INT = 0;
25+
const TELEGRAM_INT = 1;
26+
const NOT_PROCESSED = 0;
27+
const PROCESSING = 1;
28+
const PROCESSED = 2;
29+
const INCOMING = 0;
30+
const OUTGOING = 1;
31+
const DISABLED = 0;
32+
const ENABLED = 1;
33+
const NOT_LOGGED = 0;
34+
const NOT_ADMIN = 0;
35+
const ADMIN = 1;
36+
const LOGGED = 1;
37+
const SECONDS_IN_HOUR = 3600;
38+
const SECONDS_IN_MINUTE = 60;
39+
const DEFAULT_MIN_CONFIDENCE = 0.7;
40+
const BREAK_LINE = '\n'; // chr(10)
41+
const QUEUE_PROCESSING_LIMIT = self::SECONDS_IN_MINUTE * 3;
42+
43+
// commands
44+
const START_COMMAND_ID = 0;
45+
const LIST_CATEGORIES_COMMAND_ID = 1;
46+
const SEARCH_COMMAND_ID = 2;
47+
const LOGIN_COMMAND_ID = 3;
48+
const LIST_ORDERS_COMMAND_ID = 4;
49+
const REORDER_COMMAND_ID = 5;
50+
const ADD_TO_CART_COMMAND_ID = 6;
51+
const CHECKOUT_COMMAND_ID = 7;
52+
const CLEAR_CART_COMMAND_ID = 8;
53+
const TRACK_ORDER_COMMAND_ID = 9;
54+
const SUPPORT_COMMAND_ID = 10;
55+
const SEND_EMAIL_COMMAND_ID = 11;
56+
const CANCEL_COMMAND_ID = 12;
57+
const HELP_COMMAND_ID = 13;
58+
const ABOUT_COMMAND_ID = 14;
59+
const LOGOUT_COMMAND_ID = 15;
60+
const REGISTER_COMMAND_ID = 16;
61+
const LIST_MORE_COMMAND_ID = 17;
62+
const LAST_COMMAND_DETAILS_DEFAULT = '{"last_command_parameter":"","last_command_text":"","last_conversation_state":0,"last_listed_quantity":0}';
63+
// array(
64+
// 'last_command_parameter' => '',
65+
// 'last_command_text' => '',
66+
// 'last_conversation_state' => 0,
67+
// 'last_listed_quantity' => 0,
68+
// );
69+
const CURRENT_COMMAND_DETAILS_DEFAULT = '[]';
70+
// json_encode(array())
71+
72+
// message content types
73+
const CONTENT_TEXT = 0;
74+
const QUICK_REPLY = 1;
75+
const IMAGE_WITH_TEXT = 2;
76+
const IMAGE_WITH_OPTIONS = 3;
77+
const RECEIPT_LAYOUT = 4;
78+
const LIST_WITH_IMAGE = 5;
79+
const TEXT_WITH_OPTIONS = 6;
80+
81+
// conversation states
82+
const CONVERSATION_STARTED = 0;
83+
const CONVERSATION_LIST_CATEGORIES = 1;
84+
const CONVERSATION_SEARCH = 2;
85+
const CONVERSATION_EMAIL = 3;
86+
const CONVERSATION_TRACK_ORDER = 4;
87+
88+
// API
89+
const MAX_MESSAGE_ELEMENTS = 7;
90+
91+
// MESSAGE QUEUE MODES
92+
const QUEUE_NONE = 0;
93+
const QUEUE_SIMPLE_RESTRICTIVE = 1;
94+
const QUEUE_RESTRICTIVE = 2;
95+
const QUEUE_NON_RESTRICTIVE = 3;
96+
97+
const DONT_CLEAR_MESSAGE_QUEUE = 0;
98+
const CLEAR_MESSAGE_QUEUE = 1;
99+
}

0 commit comments

Comments
 (0)