@@ -72,11 +72,11 @@ pub async fn handle_tickets_bot(
7272 user_id,
7373 user_name,
7474 channel_id,
75- created_at as "created_at: String",
75+ strftime('%s', created_at) as "created_at: Option< String> ",
7676 next_message_number as new_message_number,
7777 status,
7878 user_left,
79- closed_at as "closed_at: Option<String>",
79+ strftime('%s', closed_at) as "closed_at: Option<String>",
8080 closed_by,
8181 category_id,
8282 category_name,
@@ -159,11 +159,14 @@ pub async fn handle_tickets_bot(
159159 user_id : thread. user_id ,
160160 user_name : thread. user_name ,
161161 channel_id : thread. channel_id ,
162- created_at : thread. created_at . parse :: < i64 > ( ) . unwrap_or_default ( ) ,
162+ created_at : thread. created_at
163+ . flatten ( )
164+ . and_then ( |ts : String | ts. parse :: < i64 > ( ) . ok ( ) )
165+ . unwrap_or_default ( ) ,
163166 new_message_number : thread. new_message_number . unwrap_or_default ( ) ,
164167 status : thread. status ,
165168 user_left : thread. user_left ,
166- closed_at : thread. closed_at . and_then ( |ts| ts? . parse :: < i64 > ( ) . ok ( ) ) ,
169+ closed_at : thread. closed_at . flatten ( ) . and_then ( |ts : String | ts. parse :: < i64 > ( ) . ok ( ) ) ,
167170 closed_by : thread. closed_by ,
168171 category_id : thread. category_id ,
169172 category_name : thread. category_name ,
@@ -181,11 +184,11 @@ pub async fn handle_tickets_bot(
181184 user_id,
182185 user_name,
183186 channel_id,
184- created_at as "created_at: String",
187+ strftime('%s', created_at) as "created_at: Option< String> ",
185188 next_message_number as new_message_number,
186189 status,
187190 user_left,
188- closed_at as "closed_at: Option<String>",
191+ strftime('%s', closed_at) as "closed_at: Option<String>",
189192 closed_by,
190193 category_id,
191194 category_name,
@@ -263,11 +266,14 @@ pub async fn handle_tickets_bot(
263266 user_id : thread. user_id ,
264267 user_name : thread. user_name ,
265268 channel_id : thread. channel_id ,
266- created_at : thread. created_at . parse :: < i64 > ( ) . unwrap_or_default ( ) ,
269+ created_at : thread. created_at
270+ . flatten ( )
271+ . and_then ( |ts : String | ts. parse :: < i64 > ( ) . ok ( ) )
272+ . unwrap_or_default ( ) ,
267273 new_message_number : thread. new_message_number . unwrap_or_default ( ) ,
268274 status : thread. status ,
269275 user_left : thread. user_left ,
270- closed_at : thread. closed_at . and_then ( |ts| ts? . parse :: < i64 > ( ) . ok ( ) ) ,
276+ closed_at : thread. closed_at . flatten ( ) . and_then ( |ts : String | ts. parse :: < i64 > ( ) . ok ( ) ) ,
271277 closed_by : thread. closed_by ,
272278 category_id : thread. category_id ,
273279 category_name : thread. category_name ,
0 commit comments