@@ -24,11 +24,16 @@ export default class MessageSend extends BaseCommand {
2424 'thread-id' : Flags . string ( {
2525 description : 'Reply into an existing conversation thread instead of passing person-url' ,
2626 } ) ,
27+ manage : Flags . string ( {
28+ description : 'Manage the conversation right after sending (acts on the same thread)' ,
29+ options : [ 'archive' , 'unarchive' , 'star' , 'unstar' , 'mute' , 'unmute' ] ,
30+ } ) ,
2731 } ;
2832
2933 static override examples = [
3034 '<%= config.bin %> message send https://www.linkedin.com/in/john-doe "Hello John!"' ,
3135 '<%= config.bin %> message send --thread-id 2-abc123... "Sounds good, talk soon!"' ,
36+ '<%= config.bin %> message send https://www.linkedin.com/in/john-doe "Hello John!" --manage archive' ,
3237 ] ;
3338
3439 public async run ( ) : Promise < void > {
@@ -42,18 +47,20 @@ export default class MessageSend extends BaseCommand {
4247
4348 const client = await this . buildAuthenticatedClient ( ) ;
4449
50+ const params : Record < string , unknown > = {
51+ personUrl : args [ 'person-url' ] ,
52+ threadId : flags [ 'thread-id' ] ,
53+ text : args . text ,
54+ } ;
55+
56+ if ( flags . manage ) {
57+ params . manageConversation = { operation : flags . manage } ;
58+ }
59+
4560 try {
46- const result = await runVoidWorkflow (
47- client . sendMessage ,
48- {
49- personUrl : args [ 'person-url' ] ,
50- threadId : flags [ 'thread-id' ] ,
51- text : args . text ,
52- } ,
53- {
54- isQuiet : flags . quiet ,
55- } ,
56- ) ;
61+ const result = await runVoidWorkflow ( client . sendMessage , params , {
62+ isQuiet : flags . quiet ,
63+ } ) ;
5764
5865 formatVoidOutput ( {
5966 errors : result . errors ,
0 commit comments