CarolinePascal commited on
Commit
3502df5
Β·
unverified Β·
1 Parent(s): 9831453

feat(update): updating ETAbot

Browse files
Files changed (1) hide show
  1. app.py +34 -38
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
- now = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
49
- notes = []
50
 
51
  if ReachyMiniType.Lite in types:
52
- if now < datetime(2026, 5, 1) and arrival_date > datetime(2026, 4, 30):
53
- notes.append(
54
- "πŸ“¬ All Reachy Mini Lite orders will be shipped **late April 2026** "
55
- "β€” yours might arrive before the expected date!"
56
- )
 
 
57
 
58
  if ReachyMiniType.Wireless in types:
59
  inv_num = get_invoice_digits(invoice_number)
60
  if inv_num < 7000:
61
- if now < datetime(2026, 4, 1) and arrival_date > datetime(2026, 3, 31):
62
- notes.append(
63
- "πŸ“¬ Reachy Mini Wireless orders with invoice number before 7000 will be shipped **late March 2026/early April 2026** "
64
- "β€” yours might arrive before the expected date!"
65
- )
66
- elif now < datetime(2026, 4, 1) and arrival_date <= datetime(2026, 3, 31):
67
- notes.append(
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
- if now < datetime(2026, 7, 1) and arrival_date > datetime(2026, 6, 15):
73
- notes.append(
74
- "πŸ“¬ Reachy Mini Wireless orders with invoice number 7000 and above will be shipped **early June 2026** "
75
- "β€” yours might arrive before the expected date!"
76
- )
77
- elif now < datetime(2026, 7, 1) and arrival_date <= datetime(2026, 6, 1):
78
- notes.append(
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 < -14:
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)