|
132 | 132 | matchDates[date] = {**matchDates[date], "location": location} |
133 | 133 | else: |
134 | 134 | print("❗ No data avalibale - Existting") |
135 | | - |
136 | 135 | # If match dates: |
137 | 136 | if matchDates: |
138 | 137 | for date in matchDates: |
139 | 138 | dateStr = str(date) |
140 | 139 | dateParts = dateStr.split("، ") |
141 | 140 | dateMonth = dateParts[1] |
| 141 | + matchTime = dateParts[2] |
| 142 | + matchTime = matchTime.replace( |
| 143 | + dateParts[2].split(":")[0], str((int(dateParts[2].split(":")[0]) + 1)) |
| 144 | + ) |
142 | 145 | dateDay = int(dateMonth.split(" ")[0]) |
| 146 | + |
| 147 | + matchDec = matchDates[date] |
| 148 | + team1 = matchDec["team1"] |
| 149 | + team2 = matchDec["team2"] |
| 150 | + team2 = team2 if team1 == "ريال مدريد" else team1 |
| 151 | + team1 = "ريال مدريد" |
| 152 | + location = matchDec["location"] |
| 153 | + title = matchDec["title"] |
143 | 154 | if dateDay == datetime.now().date().day: # In case today: |
144 | 155 | print(f"Founded match today: {date}") |
145 | | - |
146 | | - matchDec = matchDates[date] |
147 | | - team1 = matchDec["team1"] |
148 | | - team2 = matchDec["team2"] |
149 | | - location = matchDec["location"] |
150 | | - if not team1 == "ريال مدريد": |
151 | | - team1 = "ريال مدريد" |
152 | | - team2 = team1 |
153 | | - |
154 | 156 | messageText = ( |
155 | | - f"<b>تذكير بمباراة اليوم - الساعة {dateParts[2]}</b>\n\n" |
156 | | - f"<b>{team1}</b> و <b>{team2}</b> - علي ملعب {location}" |
| 157 | + f"<b>تذكير بمباراة اليوم - الساعة {matchTime}</b>\n\n" |
| 158 | + f"- <b>{team1}</b> و <b>{team2}</b> - <b>{title}</b>\n\n" |
| 159 | + f"- علي ملعب {location}" |
157 | 160 | ) |
158 | | - |
159 | 161 | print("Send to telegram - Sending") |
160 | 162 | isSuccessSend = asyncio.run( |
161 | 163 | send_text_message( |
|
171 | 173 | continue |
172 | 174 | print("Telegram message sended successfully") |
173 | 175 | elif (dateDay - datetime.now().date().day) == 0: # In case tomorrow: |
174 | | - matchDec = matchDates[date] |
175 | | - team1 = matchDec["team1"] |
176 | | - team2 = matchDec["team2"] |
177 | | - location = matchDec["location"] |
178 | | - if not team1 == "ريال مدريد": |
179 | | - team1 = "ريال مدريد" |
180 | | - team2 = team1 |
181 | | - |
182 | 176 | messageText = ( |
183 | 177 | f"<b>توجد مباراة غداً - الساعة {dateParts[2]}</b>\n\n" |
184 | | - f"<b>{team1}</b> و <b>{team2}</b> - علي ملعب {location}" |
| 178 | + f"- <b>{team1}</b> و <b>{team2}</b> - <b>{title}</b>\n\n" |
| 179 | + f"- علي ملعب {location}" |
185 | 180 | ) |
186 | | - |
187 | 181 | print(f"Founded match tomorrow: {date}") |
188 | 182 | print("Send to telegram - Sending") |
189 | 183 | isSuccessSend = asyncio.run( |
|
0 commit comments