This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(message): resolve KeyError in string formatting
- Loading branch information
Showing
4 changed files
with
51 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
from string import Template | ||
from typing import LiteralString | ||
|
||
SEND_MESSAGE_API_URL_TELEGRAM: LiteralString = ( | ||
"https://api.telegram.org/bot{bot_token}/sendMessage" | ||
) | ||
MESSAGE_MARKDOWN_PATTERN: LiteralString = """ | ||
MESSAGE_MARKDOWN_PATTERN = Template(""" | ||
*🚗 **Thông tin phương tiện**:* | ||
- **Biển kiểm soát:** `{plate}` | ||
- **Chủ sở hữu:** `{owner}' | ||
- **Biển kiểm soát:** `${plate}` | ||
- **Chủ sở hữu:** `${owner}` | ||
*⚠️ **Thông tin vi phạm**:* | ||
- **Hành vi vi phạm:** `{action}` | ||
- **Trạng thái:** {status} | ||
- **Thời gian vi phạm:** `{date}` | ||
- **Địa điểm vi phạm** {location} | ||
- **Hành vi vi phạm:** `${action}` | ||
- **Trạng thái:** ${status} | ||
- **Thời gian vi phạm:** `${date}` | ||
- **Địa điểm vi phạm:** `${location}` | ||
*🏢 **Đơn vị phát hiện vi phạm**:* | ||
- **{enforcement_unit}** | ||
- **`${enforcement_unit}`** | ||
*📍 **Nơi giải quyết vụ việc**:* | ||
{resolution_locations} | ||
""" | ||
${resolution_locations} | ||
""") | ||
|
||
RESOLUTION_LOCATION_MARKDOWN_PATTERN: LiteralString = """ | ||
{idx}. **{location_name} | ||
- **Địa chỉ:** {address} | ||
- **Số điện thoại liên lạc:** {phone} | ||
RESOLUTION_LOCATION_MARKDOWN_PATTERN = Template(""" | ||
${idx}. **${location_name} | ||
- **Địa chỉ:** `${address}` | ||
- **Số điện thoại liên lạc:** `${phone}` | ||
""" | ||
""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters