File tree Expand file tree Collapse file tree 5 files changed +23
-6
lines changed Expand file tree Collapse file tree 5 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ const agent = await Agent.createFromEnv({
1616} ) ;
1717
1818agent . on ( "text" , async ( ctx ) => {
19- const messageBody1 = await getMessageBody ( ctx ) ;
19+ const messageBody1 = await getMessageBody (
20+ ctx ,
21+ "America/Argentina/Buenos_Aires" ,
22+ ) ;
2023 if ( ctx . isDm ( ) ) {
2124 await ctx . sendText ( messageBody1 ) ;
2225 } else if ( ctx . isGroup ( ) && ctx . message . content . includes ( "@gm" ) ) {
Original file line number Diff line number Diff line change @@ -333,7 +333,10 @@ appConfig.menus["load-test-menu"].actions.forEach((action: MenuAction) => {
333333initializeAppFromConfig ( appConfig ) ;
334334
335335agent . on ( "text" , async ( ctx ) => {
336- const messageBody1 = await getMessageBody ( ctx ) ;
336+ const messageBody1 = await getMessageBody (
337+ ctx ,
338+ "America/Argentina/Buenos_Aires" ,
339+ ) ;
337340 const message = ctx . message ;
338341 const content = message . content ;
339342 const isTagged =
Original file line number Diff line number Diff line change @@ -18,12 +18,23 @@ export interface AgentConfig {
1818 live : boolean ;
1919}
2020
21- export async function getMessageBody ( ctx : MessageContext ) {
21+ export async function getMessageBody ( ctx : MessageContext , timezone ?: string ) {
2222 try {
2323 const messageContent = ctx . message . content as string ;
2424 const senderAddress = ( await ctx . getSenderAddress ( ) ) as string ;
2525
26- const messageBody1 = `replying content: ${ messageContent } sent by ${ senderAddress } on ${ ctx . message . sentAt . toISOString ( ) } on converstion ${ ctx . conversation . id } ` ;
26+ let dateString : string ;
27+ if ( timezone ) {
28+ dateString = ctx . message . sentAt . toLocaleString ( "en-US" , {
29+ timeZone : timezone ,
30+ dateStyle : "medium" ,
31+ timeStyle : "long" ,
32+ } ) ;
33+ } else {
34+ dateString = ctx . message . sentAt . toISOString ( ) ;
35+ }
36+
37+ const messageBody1 = `replying content: ${ messageContent } sent by ${ senderAddress } on ${ dateString } on converstion ${ ctx . conversation . id } ` ;
2738
2839 console . log ( messageBody1 ) ;
2940 return messageBody1 ;
Original file line number Diff line number Diff line change 1- {"deployedAt" : " 2025-11-25T20:55:20Z" , "version" : " 0.5.1" }
1+ { "deployedAt" : " 2025-11-25T20:55:20Z" , "version" : " 0.5.1" }
Original file line number Diff line number Diff line change 11{
22 "name" : " xmtp-qa-tools" ,
3- "version" : " 0.5.1 " ,
3+ "version" : " 0.5.2 " ,
44 "private" : true ,
55 "type" : " module" ,
66 "workspaces" : [
You can’t perform that action at this time.
0 commit comments