File tree 2 files changed +99
-252
lines changed
2 files changed +99
-252
lines changed Original file line number Diff line number Diff line change 1
- import { xmtpClient , type Message } from "./lib/helper.js" ;
1
+ import { send , xmtpClient , type DecodedMessage } from "./lib/helper.js" ;
2
2
3
3
async function main ( ) {
4
4
const client = await xmtpClient ( {
5
5
walletKey : process . env . WALLET_KEY as string ,
6
- onMessage : async ( message : Message ) => {
7
- console . log (
8
- `Decoded message: ${ message . content . text } by ${ message . sender . address } ` ,
9
- ) ;
10
- await client . send ( {
11
- message : "gm" ,
12
- originalMessage : message ,
13
- } ) ;
6
+ onMessage : async ( message : DecodedMessage ) => {
7
+ console . log ( message ) ;
8
+ await send ( "gm" , message . senderInboxId , client ) ;
14
9
} ,
15
10
} ) ;
16
11
17
12
console . log (
18
- `XMTP agent initialized on ${ client . address } \nSend a message on https://converse.xyz /dm/${ client . address } ` ,
13
+ `XMTP agent initialized on ${ client . accountAddress } \nSend a message on https://xmtp.chat /dm/${ client . accountAddress } ` ,
19
14
) ;
20
15
}
21
16
You can’t perform that action at this time.
0 commit comments