Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to send messages to a private channel and update help text to use channel name #51

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This project provides a means of archiving a Slack conversation or thread as mar
gh slack -i <issue-url> <slack-permalink> # defaults to read command
gh slack read <slack-permalink>
gh slack read -i <issue-url> <slack-permalink>
gh slack send -m <message> -c <channel-id> -t <team-name>
gh slack send -m <message> -c <channel-name> -t <team-name>

# Example configuration (add to gh's configuration file at $HOME/.config/gh/config.yml):
extensions:
Expand Down
2 changes: 1 addition & 1 deletion cmd/gh-slack/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var rootCmd = &cobra.Command{
Example: ` gh-slack -i <issue-url> <slack-permalink> # defaults to read command
gh-slack read <slack-permalink>
gh-slack read -i <issue-url> <slack-permalink>
gh-slack send -m <message> -c <channel-id> -t <team-name>
gh-slack send -m <message> -c <channel-name> -t <team-name>
` + sendConfigExample,
}

Expand Down
5 changes: 2 additions & 3 deletions internal/slackclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down