-
Notifications
You must be signed in to change notification settings - Fork 0
/
chatbot_project1.py
195 lines (159 loc) · 6.9 KB
/
chatbot_project1.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
from datetime import datetime
class Response:
attributes = {
'negative_res': ["no", "nope", "nah", "no thanks", "no thank", "sorry"],
'exit_words': ["bye", "exit", "quit", "goodbye", "later"]}
# salutations at the start of chat
def wishes(self):
print("Welcome to our system!!")
name = input("What's your name: ")
print("Hii " + name + " :)")
self.select()
# exit commands from attributes dictionary
def exit(self, reply):
for i in Response.attributes:
return reply.lower()
# Options available on portal
def select(self):
print("How may I help you ?")
print("1. Attendance issue")
print("2. Attendance update issue")
print("3. Payments")
print("4. Attendance records")
choice = input("Enter the number corresponding to your choice: ")
if choice == "1":
print(self.attendance_query())
elif choice == "2":
print(self.attendance_updated())
elif choice == "3":
print(self.payment())
elif choice == "4":
print(self.attendance_record())
else:
print("Thank You!! Have a nice day")
# Attendance related issues on field
def attendance_query(self):
print("Great! Please choose from the following options:")
print("1. Camera issue")
print("2. Network problem")
print("3. Attendance not marked")
choice = input("Enter the number corresponding to your choice: ")
if choice == "1":
self.camera_issue()
elif choice == "2":
self.net_issue()
elif choice == "3":
self.attendance_not_marked()
else:
print("Invalid choice. Please select a valid option.")
def camera_issue(self):
a = datetime.now()
print(f"Query : Camera related issue \nIssue raised on : {a} "
f"\nEstimated issue resolve date : 2023-12-01 23.59.59")
self.select()
def net_issue(self):
a = datetime.now()
print(
f"Query : Network related issue \nIssue raised on : {a} \n"
f"Please check your network or else try after some time.")
self.select()
def attendance_not_marked(self):
a = datetime.now()
b = input("Enter date on which attendance is not marked : ")
print(f"Query : Attendance not marked \nIssue raised on : {a} \nAttendance Marked for the date {b}. "
f"\nThank you !! Have a nice day :)")
self.select()
# attendance update issue on portal
def attendance_updated(self):
print("Great! Please choose from the following options:")
print("1. Attendance not updated yet")
print("2. Not able to see my attendance")
print("3. Leave not updated")
choice = input("Enter the number corresponding to your choice: ")
if choice == "1":
self.update()
elif choice == "2":
self.view()
elif choice == "3":
self.leave()
else:
print("Invalid choice. Please select a valid option.")
def update(self):
a = input("Enter the date at which attendance is not yet updated : ")
b = datetime.now()
print(
f"Query : Yet attendance is not updated.\nIssue raised on : {b}\nAttendance is updated for the date {a}"
f"\nThank you !! Have a nice day :)")
self.select()
def view(self):
a = datetime.now()
print(f"Query : Can't view attendance. \nIssue raised on : {a}"
f"\nYour page will get updated within an hour.\nThank you for your valuable update.\nHave a good day ;D")
self.select()
def leave(self):
a = datetime.now()
print(f"Query : Leave not updated.\nIssue raised on : {a}"
f"\nYour leave will get updated within an hour.\nSorry for the delay")
self.select()
# payment related issue
def payment(self):
print("Great! Please choose from the following options:")
print("1. Payment Slip")
print("2. Payment not done")
choice = input("Enter the number corresponding to your choice: ")
if choice == "1":
self.slip()
elif choice == "2":
self.pay()
else:
print("Invalid choice. Please select a valid option.")
def slip(self):
a = input("Enter the year for which payment slip is to be generated : ")
b = datetime.now()
print(f"Query : Payment slip.\nIssue raised on : {b}"
f"\nPayment Slip pdf document sent on your registered mail account successfully for the year {a}. "
f"\nThank you !! Have a nice day :)")
self.select()
def pay(self):
a = datetime.now()
print(f"Query : Payment not yet received. \nIssue raised on : {a}"
f"\nPayment is not received yet.\nQuery noted. \nEstimated resolve date: 21/12/2023 \nHave a good day :D")
self.select()
# to fetch attendance or absence or leaves records
def attendance_record(self):
print("Great! Please choose from the following options:")
print("1. Attendance record")
print("2. Leave record")
print("3. Absence record")
choice = input("Enter the number corresponding to your choice: ")
if choice == "1":
self.record()
elif choice == "2":
self.leave_record()
elif choice == "3":
self.absence()
else:
print("Invalid choice. Please select a valid option.")
def record(self):
a = input("Enter the month for which your attendance record is to be generated : ")
b = datetime.now()
print(f"Query : Attendance records slip.\nIssue raised on : {b}"
f"\nAttendance record pdf document is sent on your registered mail account successfully for month of {a}."
f"\nThank you !! Have a nice day :)")
self.select()
def leave_record(self):
a = input("Enter the month for which your leave record is to be generated : ")
b = datetime.now()
print(f"Query : Leave record. \nIssue raised on : {b}"
f"\nLeave record pdf document is sent on your registered mail account successfully for the month of {a}. "
f"\nHave a good day :D")
self.select()
def absence(self):
a = input("Enter the month for which your absence record is to be generated : ")
b = datetime.now()
print(f"Query : Absence record.\nIssue raised on : {b}"
f"\nAbsence record pdf document is sent on your registered mail account successfully for month of {a}. "
f"\nThank you !! Have a nice day :)")
self.select()
chat = Response()
chat.wishes()