Update app.py
Browse files
app.py
CHANGED
|
@@ -147,7 +147,7 @@ async def handle_message(message: cl.Message):
|
|
| 147 |
payload = {"booking_id": bestillingskode}
|
| 148 |
|
| 149 |
try:
|
| 150 |
-
|
| 151 |
response = await async_post_request(API_URL, headers, payload)
|
| 152 |
response.raise_for_status()
|
| 153 |
booking_data = response.json()
|
|
@@ -158,7 +158,29 @@ async def handle_message(message: cl.Message):
|
|
| 158 |
if "error" in booking_data:
|
| 159 |
raise APIResponseError(booking_data["error"])
|
| 160 |
|
| 161 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
table = (
|
| 163 |
"| ๐ญ๐๐๐๐
| ๐๐ป๐ณ๐ผ |\n"
|
| 164 |
"|:-----------|:---------------------|\n"
|
|
|
|
| 147 |
payload = {"booking_id": bestillingskode}
|
| 148 |
|
| 149 |
try:
|
| 150 |
+
|
| 151 |
response = await async_post_request(API_URL, headers, payload)
|
| 152 |
response.raise_for_status()
|
| 153 |
booking_data = response.json()
|
|
|
|
| 158 |
if "error" in booking_data:
|
| 159 |
raise APIResponseError(booking_data["error"])
|
| 160 |
|
| 161 |
+
#table = (
|
| 162 |
+
#"| ๐ญ๐๐๐๐
| ๐๐ป๐ณ๐ผ |\n"
|
| 163 |
+
#"|:----------------|:-------------------------------------------|\n"
|
| 164 |
+
#f"| ๐๐ง๐๐๐ง ๐๐ช๐ข๐๐๐ง | {booking_data.get('order_number', 'N/A')} |\n"
|
| 165 |
+
#f"| ๐ผ๐๐๐๐ฅ๐ฉ๐๐ | {booking_data.get('accepted', 'N/A')} |\n"
|
| 166 |
+
#f"| ๐๐ช๐๐จ๐ฉ๐จ | {booking_data.get('guests', 'N/A')} |\n"
|
| 167 |
+
#f"| ๐๐๐ข๐ ๐๐ง๐ค๐ข | {booking_data.get('time_from', 'N/A')} |\n"
|
| 168 |
+
#f"| ๐๐๐ข๐ ๐๐ค | {booking_data.get('time_to', 'N/A')} |\n"
|
| 169 |
+
#f"| ๐พ๐๐ฃ๐๐๐ก๐ก๐๐ | {'Yes' if booking_data.get('cancelled', 0) else 'No'} |\n"
|
| 170 |
+
#f"| ๐ฟ๐๐จ๐๐ง๐๐ฅ๐ฉ๐๐ค๐ฃ | {booking_data.get('description', 'N/A')} |\n"
|
| 171 |
+
#f"| ๐ผ๐ง๐ง๐๐ซ๐๐ก | {booking_data.get('arrival', 'N/A')} |\n"
|
| 172 |
+
#f"| ๐ฟ๐๐ฅ๐๐ง๐ฉ๐ช๐ง๐ | {booking_data.get('departure', 'N/A')} |\n"
|
| 173 |
+
#f"| ๐ฝ๐๐๐๐๐ฃ๐ | {booking_data.get('bedding', 'N/A')} |\n"
|
| 174 |
+
#f"| ๐๐ค๐๐๐ฉ๐๐ค๐ฃ | Lat: {booking_data.get('lat', 'N/A')}, Long: {booking_data.get('long', 'N/A')} |\n"
|
| 175 |
+
#f"| ๐๐๐ข๐ | {booking_data.get('name', 'N/A')} |\n"
|
| 176 |
+
#f"| ๐พ๐ค๐ฃ๐ฉ๐๐๐ฉ ๐๐๐ข๐ | {booking_data.get('contactname', 'N/A')} |\n"
|
| 177 |
+
#f"| ๐พ๐ค๐ฃ๐ฉ๐๐๐ฉ ๐๐ข๐๐๐ก| {booking_data.get('contactemail', 'N/A')} |\n"
|
| 178 |
+
#f"| ๐พ๐ค๐ฃ๐ฉ๐๐๐ฉ ๐๐๐ค๐ฃ๐| {booking_data.get('contactphone', 'N/A')} |\n"
|
| 179 |
+
#f"| ๐พ๐ค๐ช๐ฃ๐ฉ๐ง๐ฎ ๐พ๐ค๐๐ | {booking_data.get('country_code', 'N/A')} |\n"
|
| 180 |
+
#)
|
| 181 |
+
#combined_message = f"### Informasjon om booking:\n\n{table}"
|
| 182 |
+
#await cl.Message(content=combined_message).send()
|
| 183 |
+
|
| 184 |
table = (
|
| 185 |
"| ๐ญ๐๐๐๐
| ๐๐ป๐ณ๐ผ |\n"
|
| 186 |
"|:-----------|:---------------------|\n"
|