This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnote.txt
130 lines (97 loc) · 4.78 KB
/
note.txt
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
if int(Currenttime[:2]) <= int(prayer.Fajar[:2]):
TimeLeftFajar = int(Currenttime[:2]) - int(prayer.Fajar[:2])
else:
TimeLeftFajar = (int(Currenttime[:2]) - int(prayer.Fajar[:2])) - 24
if int(Currenttime[:2]) <= int(prayer.Dhuhar[:2]):
TimeLeftDhuhar = int(Currenttime[:2]) - int(prayer.Dhuhar[:2])
else:
TimeLeftDhuhar = (int(Currenttime[:2]) - int(prayer.Dhuhar[:2])) - 24
if int(Currenttime[:2]) <= int(prayer.Asr[:2]):
TimeLeftAsr = int(Currenttime[:2]) - int(prayer.Asr[:2])
else:
TimeLeftAsr = (int(Currenttime[:2]) - int(prayer.Asr[:2])) - 24
if int(Currenttime[:2]) <= int(prayer.Maghrib[:2]):
TimeLeftMaghrib = int(Currenttime[:2]) - int(prayer.Maghrib[:2])
else:
TimeLeftMaghrib = (int(Currenttime[:2]) - int(prayer.Maghrib[:2])) - 24
if int(Currenttime[:2]) <= int(prayer.Isha[:2]):
TimeLeftIsha = int(Currenttime[:2]) - int(prayer.Isha[:2])
else:
TimeLeftIsha = (int(Currenttime[:2]) - int(prayer.Isha[:2])) - 24
ListOfTimeLeft = []
ListOfTimeLeft.append(TimeLeftFajar)
ListOfTimeLeft.append(TimeLeftDhuhar)
ListOfTimeLeft.append(TimeLeftAsr)
ListOfTimeLeft.append(TimeLeftMaghrib)
ListOfTimeLeft.append(TimeLeftIsha)
hourDiff = []
for time in ListOfTimeLeft:
if time < 0:
time = -time
hourDiff.append(time)
else:
time = time
hourDiff.append(time)
# final time difference
TimeLeftFajar = hourDiff[0]
TimeLeftDhuhar = hourDiff[1]
TimeLeftAsr = hourDiff[2]
TimeLeftMaghrib = hourDiff[3]
TimeLeftIsha = hourDiff[4]
DataGiven = PrettyTable(["Prayer", "Time"])
DataGiven.add_row(["Fathis", prayer.Fajar12hour])
DataGiven.add_row(["Dhuhar", prayer.Dhuhar12hour])
DataGiven.add_row(["Asr", prayer.Asr12hour])
DataGiven.add_row(["Maghrib", prayer.Maghrib12hour])
DataGiven.add_row(["Isha", prayer.Isha12hour])
# throwing the data
replyFajar = f"you have around {TimeLeftFajar} hours left"
replyDhuhar = f"you have around {TimeLeftDhuhar} hours left"
replyAsr = f"you have around {TimeLeftAsr} hours left"
replyMaghrib = f"you have around {TimeLeftMaghrib} hours left"
replyIsha = f"you have around {TimeLeftIsha} hours left"
if TimeLeftFajar == 1:
replyFajar = "It's almost time now, be ready and make sure you pray!"
if TimeLeftDhuhar == 1:
replyDhuhar = "It's almost time now, be ready and make sure you pray!"
if TimeLeftAsr == 1:
replyAsr = "It's almost time now, be ready and make sure you pray!"
if TimeLeftMaghrib == 1:
replyMaghrib = "It's almost time now, be ready and make sure you pray!"
if TimeLeftIsha == 1:
replyIsha = "It's almost time now, be ready and make sure you pray!"
Fajar = f"Fajar time is {prayer.Fajar12hour}\n{replyFajar}"
Dhuhar = f"Dhuhar time is {prayer.Dhuhar12hour}\n{replyDhuhar}"
Asr = f"Asr time is {prayer.Asr12hour}\n{replyAsr}"
Maghrib = f"Maghrib time is {prayer.Maghrib12hour}\n{replyMaghrib}"
Isha = f"Isha time is {prayer.Isha12hour}\n{replyIsha}"
if message.text == "Fajar":
self.bot.reply_to(message, Fajar, reply_markup=ReplyKeyboardRemove())
if message.text == "Dhuhar":
self.bot.reply_to(message, Dhuhar, reply_markup=ReplyKeyboardRemove())
if message.text == "Asr":
self.bot.reply_to(message, Asr, reply_markup=ReplyKeyboardRemove())
if message.text == "Maghrib":
self.bot.reply_to(message, Maghrib, reply_markup=ReplyKeyboardRemove())
if message.text == "Isha":
self.bot.reply_to(message, Isha, reply_markup=ReplyKeyboardRemove())
if message.text == "Every prayer":
self.bot.send_message(
message.chat.id,
f"```{DataGiven}```",
reply_markup=ReplyKeyboardRemove(),
parse_mode="Markdown",
)
------------------------------------------------------------------------------------------------
def NextPrayerMale():
iterateList = ["Fajuru", "Dhuhr", "Asr", "Maghrib", "Isha"]
day = prayerDB.get_day()
prayerTimes = prayerDB.getPrayerTime(57, day)
timeArray = []
for i in iterateList:
timeArray.append(prayerTimes[i])
--------------------------------------------------------------------------------------------
value = "04:64"
print(value[:2]) #first two
print(value[-2:]) #last two
print(int(value[-2:]) - int(value[:2])) #difference