Skip to content

Commit a0c7589

Browse files
committed
chore: move common methods to examples, sort alphabetically
1 parent d6ad5f7 commit a0c7589

1 file changed

Lines changed: 20 additions & 27 deletions

File tree

cmd/api/api.go

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,28 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
6868
" 5. Interactive prompt Select from stored workspaces (CLI tooling token)",
6969
"",
7070
"See all methods at: https://docs.slack.dev/reference/methods",
71-
"",
72-
"Common methods:",
73-
" api.test Test your API connection",
74-
" auth.test Check authentication",
75-
" chat.postMessage Send a message to a channel",
76-
" chat.update Update a message",
77-
" chat.delete Delete a message",
78-
" conversations.list List channels",
79-
" conversations.history Fetch messages from a channel",
80-
" conversations.info Get channel details",
81-
" conversations.members List members in a channel",
82-
" conversations.create Create a channel",
83-
" users.list List workspace members",
84-
" users.info Get user details",
85-
" files.upload Upload a file",
86-
" reactions.add Add an emoji reaction",
87-
" reactions.list List reactions for a user",
88-
" bookmarks.add Add a bookmark to a channel",
89-
" pins.add Pin a message",
90-
" views.open Open a modal view",
91-
" views.update Update a modal view",
9271
}, "\n"),
9372
Example: style.ExampleCommandsf([]style.ExampleCommand{
94-
{Command: "api auth.test", Meaning: "Test authentication with the current workspace"},
95-
{Command: "api chat.postMessage channel=C0123456 text=\"Hello\"", Meaning: "Post a message"},
96-
{Command: "api users.list --team myworkspace", Meaning: "List users in a specific workspace"},
97-
{Command: `api chat.postMessage --json '{"channel":"C0123456","text":"Hello"}'`, Meaning: "Send a JSON body"},
98-
{Command: "api auth.test --include", Meaning: "Show HTTP status and response headers"},
99-
{Command: "api conversations.history -X GET channel=C0123456", Meaning: "Use GET method"},
73+
{Command: "api api.test", Meaning: "Test your API connection"},
74+
{Command: "api auth.test", Meaning: "Check authentication"},
75+
{Command: "api bookmarks.add channel_id=C0123456 title=Docs link=https://example.com", Meaning: "Add a bookmark to a channel"},
76+
{Command: "api chat.postMessage channel=C0123456 text=\"Hello\"", Meaning: "Send a message to a channel using form-encoded string"},
77+
{Command: `api chat.postMessage --json '{"channel":"C0123456","text":"Hello"}'`, Meaning: "Send a message to a channel using JSON"},
78+
{Command: "api chat.update channel=C0123456 ts=1234567890.123456 text=\"Updated\"", Meaning: "Update a message"},
79+
{Command: "api conversations.create name=new-channel", Meaning: "Create a channel"},
80+
{Command: "api conversations.history channel=C0123456", Meaning: "Fetch messages from a channel"},
81+
{Command: "api conversations.info channel=C0123456", Meaning: "Get channel details"},
82+
{Command: "api conversations.list", Meaning: "List channels"},
83+
{Command: "api conversations.members channel=C0123456", Meaning: "List members in a channel"},
84+
{Command: "api files.upload channels=C0123456 filename=report.csv", Meaning: "Upload a file"},
85+
{Command: "api pins.add channel=C0123456 timestamp=1234567890.123456", Meaning: "Pin a message"},
86+
{Command: "api reactions.add channel=C0123456 timestamp=1234567890.123456 name=thumbsup", Meaning: "Add an emoji reaction"},
87+
{Command: "api reactions.list user=U0123456", Meaning: "List reactions for a user"},
88+
{Command: "api users.info user=U0123456", Meaning: "Get user details"},
89+
{Command: "api users.list", Meaning: "List workspace members"},
90+
{Command: "api users.profile.get user=U0123456", Meaning: "Get a user's profile"},
91+
{Command: "api views.open trigger_id=T0123456 view={...}", Meaning: "Open a modal view"},
92+
{Command: "api views.update view_id=V0123456 view={...}", Meaning: "Update a modal view"},
10093
}),
10194
Args: cobra.MinimumNArgs(1),
10295
PreRunE: func(cmd *cobra.Command, args []string) error {

0 commit comments

Comments
 (0)