From cdba7b5d2182f12535869672e4c0d0d5ee221266 Mon Sep 17 00:00:00 2001 From: acyphus <983880+ACyphus@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:06:49 -0500 Subject: [PATCH 1/2] Add support for sending to private channels This commit adds `private_channel` to the types of channel that can have messages sent to it. Co-authored-by: Robin Neatherway --- internal/slackclient/client.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/slackclient/client.go b/internal/slackclient/client.go index e66f09b..6e679db 100644 --- a/internal/slackclient/client.go +++ b/internal/slackclient/client.go @@ -326,9 +326,8 @@ func (c *SlackClient) conversations() ([]Channel, error) { "exclude_archived": "true", "limit": "1000", - // TODO: this is the default, we might want to support private - // channels and DMs in the future - "types": "public_channel", + // TODO: we might want to support DMs in the future + "types": "public_channel, private_channel", }, ) if err != nil { From 71a6f2b6d0b8d47f53383a5441b86bf82fc35021 Mon Sep 17 00:00:00 2001 From: acyphus <983880+ACyphus@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:08:17 -0500 Subject: [PATCH 2/2] Change id to name in help text for channel selection In my experience, using the channel name is more reliable than using the channel id. This commit changes the help text to recommend using the channel name --- README.md | 2 +- cmd/gh-slack/cmd/root.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f42594f..e8bc2c9 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This project provides a means of archiving a Slack conversation or thread as mar gh slack -i # defaults to read command gh slack read gh slack read -i - gh slack send -m -c -t + gh slack send -m -c -t # Example configuration (add to gh's configuration file at $HOME/.config/gh/config.yml): extensions: diff --git a/cmd/gh-slack/cmd/root.go b/cmd/gh-slack/cmd/root.go index 99a2cca..81cbc85 100644 --- a/cmd/gh-slack/cmd/root.go +++ b/cmd/gh-slack/cmd/root.go @@ -23,7 +23,7 @@ var rootCmd = &cobra.Command{ Example: ` gh-slack -i # defaults to read command gh-slack read gh-slack read -i - gh-slack send -m -c -t + gh-slack send -m -c -t ` + sendConfigExample, }