@@ -15,19 +15,63 @@ import (
1515 "github.com/urfave/cli/v3"
1616)
1717
18- var chatsCreate = cli.Command {
18+ var chatsCreate = requestflag . WithInnerFlags ( cli.Command {
1919 Name : "create" ,
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 {
2323 & requestflag.Flag [map [string ]any ]{
2424 Name : "chat" ,
25+ Required : true ,
2526 BodyRoot : true ,
2627 },
2728 },
2829 Action : handleChatsCreate ,
2930 HideHelpCommand : true ,
30- }
31+ }, map [string ][]requestflag.HasOuterFlag {
32+ "chat" : {
33+ & 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" ,
42+ },
43+ & 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" ,
47+ },
48+ & 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" ,
57+ },
58+ & 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" ,
62+ },
63+ & 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" ,
72+ },
73+ },
74+ })
3175
3276var chatsRetrieve = cli.Command {
3377 Name : "retrieve" ,
0 commit comments