Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
CarolinePascal commited on
feat(update): updating ETAbot
Browse files
app.py
CHANGED
|
@@ -45,45 +45,41 @@ def get_invoice_digits(invoice_number: str) -> int:
|
|
| 45 |
|
| 46 |
|
| 47 |
def early_shipping_notes(types: set[ReachyMiniType], invoice_number: str, arrival_date: datetime) -> str:
|
| 48 |
-
|
| 49 |
-
|
| 50 |
|
| 51 |
if ReachyMiniType.Lite in types:
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
"
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
|
| 58 |
if ReachyMiniType.Wireless in types:
|
| 59 |
inv_num = get_invoice_digits(invoice_number)
|
| 60 |
if inv_num < 7000:
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
"
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
"β οΈ Reachy Mini Wireless orders with invoice number before 7000 will be shipped **late March 2026/early April 2026** "
|
| 69 |
-
"β your shipment might be delayed, and we apologize for the inconvenience."
|
| 70 |
-
)
|
| 71 |
else:
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
"
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
"β οΈ There is a chance your Reachy Mini Wireless shipment might be delayed until **early June 2026**. "
|
| 80 |
-
"The Wireless version has been trickier to produce due to longer supply times "
|
| 81 |
-
"for some components (especially the Raspberry Pi). We apologize for the inconvenience."
|
| 82 |
-
)
|
| 83 |
|
| 84 |
notes.append(
|
| 85 |
"π You can manage your order through our Stripe customer portal:\n"
|
| 86 |
-
"https://billing.stripe.com/p/login/7sY5kFal10614vB4W873G00"
|
|
|
|
| 87 |
)
|
| 88 |
|
| 89 |
return "\n\n".join(notes)
|
|
@@ -117,14 +113,16 @@ def format_eta_result(purchase_date: datetime) -> str:
|
|
| 117 |
today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
| 118 |
days_until = (arrival_date - today).days
|
| 119 |
|
| 120 |
-
if days_until
|
| 121 |
-
status = "β
Your Reachy Mini must already have been delivered! Check with your carrier or contact sales@pollen-robotics.com if you haven't received it."
|
| 122 |
-
elif days_until < 0:
|
| 123 |
-
status = "β³ The delivery seems to have been delayed a bit. It should arrive any day now β hang tight!"
|
| 124 |
-
elif days_until <= 7:
|
| 125 |
-
status = "π The delivery is right around the corner! Your Reachy Mini will be there very soon."
|
| 126 |
-
else:
|
| 127 |
status = f"π Your Reachy Mini is on its way! About **{days_until} days** to go."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
return (
|
| 130 |
f"ποΈ Purchase date: **{purchase_date.strftime('%B %d, %Y')}**\n"
|
|
@@ -202,8 +200,6 @@ class DatePickerView(discord.ui.View):
|
|
| 202 |
self._build_day_buttons()
|
| 203 |
|
| 204 |
def _build_selects(self):
|
| 205 |
-
today = datetime.now()
|
| 206 |
-
|
| 207 |
year_options = [
|
| 208 |
discord.SelectOption(
|
| 209 |
label=str(y), value=str(y), default=(y == self.year)
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
def early_shipping_notes(types: set[ReachyMiniType], invoice_number: str, arrival_date: datetime) -> str:
|
| 48 |
+
notes = ["π **Order-specific notes:**"]
|
| 49 |
+
is_delayed = arrival_date < datetime.now()
|
| 50 |
|
| 51 |
if ReachyMiniType.Lite in types:
|
| 52 |
+
msg = "π¬ All Reachy Mini Lite orders should be shipped by **mid May 2026** at the latest. "
|
| 53 |
+
if not is_delayed:
|
| 54 |
+
if arrival_date > datetime(2026, 5, 15):
|
| 55 |
+
msg += "\nYour shipment might arrive before the expected date!"
|
| 56 |
+
else:
|
| 57 |
+
msg += "\nβ οΈ Your shipment might be delayed, we apologize for the inconvenience."
|
| 58 |
+
notes.append(msg)
|
| 59 |
|
| 60 |
if ReachyMiniType.Wireless in types:
|
| 61 |
inv_num = get_invoice_digits(invoice_number)
|
| 62 |
if inv_num < 7000:
|
| 63 |
+
msg = "π¬ Reachy Mini Wireless orders with invoice number before 7000 should be shipped by **mid April 2026**. "
|
| 64 |
+
if not is_delayed:
|
| 65 |
+
if arrival_date > datetime(2026, 4, 15):
|
| 66 |
+
msg += "\nYour shipment might arrive before the expected date!"
|
| 67 |
+
else:
|
| 68 |
+
msg += "\nβ οΈ Your shipment might be delayed, we apologize for the inconvenience."
|
| 69 |
+
notes.append(msg)
|
|
|
|
|
|
|
|
|
|
| 70 |
else:
|
| 71 |
+
msg = "π¬ Reachy Mini Wireless orders with invoice number 7000 and above should be shipped by **mid June 2026**. "
|
| 72 |
+
if not is_delayed:
|
| 73 |
+
if arrival_date > datetime(2026, 6, 15):
|
| 74 |
+
msg += "\nYour shipment might arrive before the expected date!"
|
| 75 |
+
else:
|
| 76 |
+
msg += "\nβ οΈ Your shipment might be delayed, we apologize for the inconvenience."
|
| 77 |
+
notes.append(msg)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
notes.append(
|
| 80 |
"π You can manage your order through our Stripe customer portal:\n"
|
| 81 |
+
"https://billing.stripe.com/p/login/7sY5kFal10614vB4W873G00\n\n"
|
| 82 |
+
"For any questions, contact sales@pollen-robotics.com."
|
| 83 |
)
|
| 84 |
|
| 85 |
return "\n\n".join(notes)
|
|
|
|
| 113 |
today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
| 114 |
days_until = (arrival_date - today).days
|
| 115 |
|
| 116 |
+
if days_until > 0:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
status = f"π Your Reachy Mini is on its way! About **{days_until} days** to go."
|
| 118 |
+
else:
|
| 119 |
+
status = (
|
| 120 |
+
"β³ The delivery seems to have been delayed a bit. "
|
| 121 |
+
"High demand and supply chain issues have put pressure on our production, "
|
| 122 |
+
"and some orders are taking longer than expected. "
|
| 123 |
+
"We apologize for the inconvenience. "
|
| 124 |
+
)
|
| 125 |
+
status += "_Please check the notes below for details on your shipment._"
|
| 126 |
|
| 127 |
return (
|
| 128 |
f"ποΈ Purchase date: **{purchase_date.strftime('%B %d, %Y')}**\n"
|
|
|
|
| 200 |
self._build_day_buttons()
|
| 201 |
|
| 202 |
def _build_selects(self):
|
|
|
|
|
|
|
| 203 |
year_options = [
|
| 204 |
discord.SelectOption(
|
| 205 |
label=str(y), value=str(y), default=(y == self.year)
|