@@ -20,55 +20,77 @@ var chatsCreate = requestflag.WithInnerFlags(cli.Command{
2020 Usage : "Create a single/group chat (mode='create') or start a direct chat from merged\n user data (mode='start')." ,
2121 Suggest : true ,
2222 Flags : []cli.Flag {
23- & requestflag.Flag [map [string ]any ]{
24- Name : "chat" ,
23+ & requestflag.Flag [string ]{
24+ Name : "account-id" ,
25+ Usage : "Account to create or start the chat on." ,
2526 Required : true ,
26- BodyRoot : true ,
27+ BodyPath : "accountID" ,
28+ },
29+ & requestflag.Flag [bool ]{
30+ Name : "allow-invite" ,
31+ Usage : "Whether invite-based DM creation is allowed when required by the platform. Used for mode='start'." ,
32+ Default : true ,
33+ BodyPath : "allowInvite" ,
34+ },
35+ & requestflag.Flag [string ]{
36+ Name : "message-text" ,
37+ Usage : "Optional first message content if the platform requires it to create the chat." ,
38+ BodyPath : "messageText" ,
39+ },
40+ & requestflag.Flag [string ]{
41+ Name : "mode" ,
42+ Usage : "Operation mode. Defaults to 'create' when omitted." ,
43+ BodyPath : "mode" ,
44+ },
45+ & requestflag.Flag [[]string ]{
46+ Name : "participant-id" ,
47+ Usage : "Required when mode='create'. User IDs to include in the new chat." ,
48+ BodyPath : "participantIDs" ,
49+ },
50+ & requestflag.Flag [string ]{
51+ Name : "title" ,
52+ Usage : "Optional title for group chats when mode='create'; ignored for single chats on most platforms." ,
53+ BodyPath : "title" ,
54+ },
55+ & requestflag.Flag [string ]{
56+ Name : "type" ,
57+ Usage : "Required when mode='create'. 'single' requires exactly one participantID; 'group' supports multiple participants and optional title." ,
58+ BodyPath : "type" ,
59+ },
60+ & requestflag.Flag [map [string ]any ]{
61+ Name : "user" ,
62+ Usage : "Required when mode='start'. Merged user-like contact payload used to resolve the best identifier." ,
63+ BodyPath : "user" ,
2764 },
2865 },
2966 Action : handleChatsCreate ,
3067 HideHelpCommand : true ,
3168}, map [string ][]requestflag.HasOuterFlag {
32- "chat " : {
69+ "user " : {
3370 & requestflag.InnerFlag [string ]{
34- Name : "chat.account-id" ,
35- Usage : "Account to create or start the chat on." ,
36- InnerField : "accountID" ,
37- },
38- & requestflag.InnerFlag [bool ]{
39- Name : "chat.allow-invite" ,
40- Usage : "Whether invite-based DM creation is allowed when required by the platform. Used for mode='start'." ,
41- InnerField : "allowInvite" ,
71+ Name : "user.id" ,
72+ Usage : "Known user ID when available." ,
73+ InnerField : "id" ,
4274 },
4375 & requestflag.InnerFlag [string ]{
44- Name : "chat.message-text " ,
45- Usage : "Optional first message content if the platform requires it to create the chat ." ,
46- InnerField : "messageText " ,
76+ Name : "user.email " ,
77+ Usage : "Email candidate ." ,
78+ InnerField : "email " ,
4779 },
4880 & requestflag.InnerFlag [string ]{
49- Name : "chat.mode" ,
50- Usage : "Operation mode. Defaults to 'create' when omitted." ,
51- InnerField : "mode" ,
52- },
53- & requestflag.InnerFlag [[]string ]{
54- Name : "chat.participant-ids" ,
55- Usage : "Required when mode='create'. User IDs to include in the new chat." ,
56- InnerField : "participantIDs" ,
81+ Name : "user.full-name" ,
82+ Usage : "Display name hint used for ranking only." ,
83+ InnerField : "fullName" ,
5784 },
5885 & requestflag.InnerFlag [string ]{
59- Name : "chat.title " ,
60- Usage : "Optional title for group chats when mode='create'; ignored for single chats on most platforms ." ,
61- InnerField : "title " ,
86+ Name : "user.phone-number " ,
87+ Usage : "Phone number candidate (E.164 preferred) ." ,
88+ InnerField : "phoneNumber " ,
6289 },
6390 & requestflag.InnerFlag [string ]{
64- Name : "chat.type" ,
65- Usage : "Required when mode='create'. 'single' requires exactly one participantID; 'group' supports multiple participants and optional title." ,
66- InnerField : "type" ,
67- },
68- & requestflag.InnerFlag [map [string ]any ]{
69- Name : "chat.user" ,
70- Usage : "Required when mode='start'. Merged user-like contact payload used to resolve the best identifier." ,
71- InnerField : "user" ,
91+ Name : "user.username" ,
92+ Usage : "Username/handle candidate." ,
93+ InnerField : "username" ,
7294 },
7395 },
7496})
0 commit comments