forked from Kjdenhartog/CovalenSupportBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicket.py
65 lines (47 loc) · 1.35 KB
/
Ticket.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import datetime
class Ticket():
def __init__(self, ticketnumber, userid):
self._ticketnumber = ticketnumber
self._staffmember = None
self._userid = userid
self._questions_and_response = None
self.open()
def assign(self, staff):
self._staffmember = staff
self._status = 'Handling'
def open(self):
self._status = 'Open'
self._date = datetime.datetime.now()
self._duration = None
def close(self):
self._status = 'Closed'
self._duration = datetime.datetime.now() - self._date
@property
def status(self):
return self._status
@property
def ticketnumber(self):
return self._ticketnumber
@property
def userid(self):
return self._userid
@userid.setter
def userid(self, discord_id):
self._userid = discord_id
@property
def staffid(self):
if self._staffmember == None:
return None
return self._staffmember.staffid
@property
def date(self):
return self._date
@property
def duration(self):
return self._duration
@property
def questions(self):
return self._questions_and_response
@questions.setter
def questions(self, questions):
self._questions_and_response = questions