feat: enhance group duty pin command functionality
- Updated the `pin_duty_cmd` to handle cases where no message ID is found by sending a new duty message, pinning it, saving the pin, and scheduling the next update. - Improved error handling for message sending and pinning operations, providing appropriate replies based on success or failure. - Enhanced unit tests to cover the new behavior, ensuring proper functionality and error handling in various scenarios.
This commit is contained in:
@@ -52,7 +52,9 @@ export function buildDayDetailContent(dateKey, duties, eventSummaries) {
|
||||
? t(lang, "duty.today") + ", " + ddmm
|
||||
: ddmm;
|
||||
|
||||
const dutyList = (duties || []).filter((d) => d.event_type === "duty");
|
||||
const dutyList = (duties || [])
|
||||
.filter((d) => d.event_type === "duty")
|
||||
.sort((a, b) => new Date(a.start_at || 0) - new Date(b.start_at || 0));
|
||||
const unavailableList = (duties || []).filter((d) => d.event_type === "unavailable");
|
||||
const vacationList = (duties || []).filter((d) => d.event_type === "vacation");
|
||||
const summaries = eventSummaries || [];
|
||||
|
||||
Reference in New Issue
Block a user