-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuickReplies.py
More file actions
35 lines (28 loc) · 793 Bytes
/
Copy pathQuickReplies.py
File metadata and controls
35 lines (28 loc) · 793 Bytes
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
from typing import List
class QuickReplies(dict):
"""
{
"title": string,
"quickReplies": [
string
]
}
"""
def __init__(self, title: str, quick_replies: str):
super().__init__()
self['title'] = title
self['quickReplies'] = []
for item in quick_replies:
self['quickReplies'].append(item)
def add_quick_replies(self, quick_replies: str) -> List[str]:
if self['quickReplies'] is None:
self['quickReplies'] = []
for item in quick_replies:
self['quickReplies'].append(item)
return self['quickReplies']
@property
def output(self):
return {
"title": self['title'],
"quickReplies": self['quickReplies']
}