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

Fix UploadFileV2 when using text content #1291

Merged

Conversation

calebmckay
Copy link
Contributor

@calebmckay calebmckay commented May 24, 2024

Fixes #1290.

postWithMultipartResponse works better for uploading this way, per the Slack docs.

POST the contents of your file to the URL returned in step 1. This can be done by sending the raw bytes, or can be a multipart form ended request. If all went well, Slack will respond with an HTTP 200.

@kalavt
Copy link

kalavt commented Jun 6, 2024

@calebmckay can we merge?

@candiduslynx candiduslynx merged commit d959a37 into slack-go:master Jun 6, 2024
4 checks passed
renovate bot referenced this pull request in validator-labs/validator Jul 16, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/slack-go/slack](https://togithub.com/slack-go/slack) |
`v0.13.0` -> `v0.13.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fslack-go%2fslack/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fslack-go%2fslack/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fslack-go%2fslack/v0.13.0/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fslack-go%2fslack/v0.13.0/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>slack-go/slack (github.com/slack-go/slack)</summary>

###
[`v0.13.1`](https://togithub.com/slack-go/slack/releases/tag/v0.13.1)

[Compare
Source](https://togithub.com/slack-go/slack/compare/v0.13.0...v0.13.1)

#### What's Changed

v0.13.1 is now available. It contains **no breaking changes** but does
expose some new fields previously unavailable.

##### Enhancements

- Added `UnfurlLinks` and `UnfurlMedia` to `WebhookMessage` by
[@&#8203;lheiskan](https://togithub.com/lheiskan) in
[https://github.com/slack-go/slack/pull/1208](https://togithub.com/slack-go/slack/pull/1208)
- Added `isReadOnly` property to `Conversation` struct by
[@&#8203;GGonryun](https://togithub.com/GGonryun) in
[https://github.com/slack-go/slack/pull/1232](https://togithub.com/slack-go/slack/pull/1232)

##### Bug Fixes

- Fixed `UploadFileV2` when using text content by
[@&#8203;calebmckay](https://togithub.com/calebmckay) in
[https://github.com/slack-go/slack/pull/1291](https://togithub.com/slack-go/slack/pull/1291)
- Made `Channel` optional on `UploadFileV2` by
[@&#8203;0xdeafcafe](https://togithub.com/0xdeafcafe) in
[https://github.com/slack-go/slack/pull/1293](https://togithub.com/slack-go/slack/pull/1293)

##### Chores / Code Cleanup

- Replace a Loop with Slice by
[@&#8203;testwill](https://togithub.com/testwill) in
[https://github.com/slack-go/slack/pull/1211](https://togithub.com/slack-go/slack/pull/1211)
- Added Deprecation Notice for `files.upload` by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1300](https://togithub.com/slack-go/slack/pull/1300)
- Added Go Test Coverage for 1.21 and 1.22 by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1298](https://togithub.com/slack-go/slack/pull/1298)

##### Documentation Updates

- Updated Inline Docs and API References by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1299](https://togithub.com/slack-go/slack/pull/1299)
- Added an example for `Pagination` by
[@&#8203;adamrothman](https://togithub.com/adamrothman) in
[https://github.com/slack-go/slack/pull/1201](https://togithub.com/slack-go/slack/pull/1201)
- Added an example for `ConversationHistory` by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1302](https://togithub.com/slack-go/slack/pull/1302)
- Added an example for `AddRemoteFile` and `DeleteFile` by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1303](https://togithub.com/slack-go/slack/pull/1303)

#### New Contributors

- [@&#8203;calebmckay](https://togithub.com/calebmckay) made their first
contribution in
[https://github.com/slack-go/slack/pull/1291](https://togithub.com/slack-go/slack/pull/1291)
- [@&#8203;lheiskan](https://togithub.com/lheiskan) made their first
contribution in
[https://github.com/slack-go/slack/pull/1208](https://togithub.com/slack-go/slack/pull/1208)
- [@&#8203;GGonryun](https://togithub.com/GGonryun) made their first
contribution in
[https://github.com/slack-go/slack/pull/1232](https://togithub.com/slack-go/slack/pull/1232)
- [@&#8203;0xdeafcafe](https://togithub.com/0xdeafcafe) made their first
contribution in
[https://github.com/slack-go/slack/pull/1293](https://togithub.com/slack-go/slack/pull/1293)
- [@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) made their
first contribution in
[https://github.com/slack-go/slack/pull/1300](https://togithub.com/slack-go/slack/pull/1300)
- [@&#8203;adamrothman](https://togithub.com/adamrothman) made their
first contribution in
[https://github.com/slack-go/slack/pull/1201](https://togithub.com/slack-go/slack/pull/1201)

**Full Changelog**:
slack-go/slack@v0.13.0...v0.13.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/validator-labs/validator).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzMS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJnbyJdfQ==-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
ymotongpoo referenced this pull request in ymotongpoo/opentelemetry-collector-extra Aug 13, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/slack-go/slack](https://togithub.com/slack-go/slack) |
`v0.13.0` -> `v0.13.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fslack-go%2fslack/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fslack-go%2fslack/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fslack-go%2fslack/v0.13.0/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fslack-go%2fslack/v0.13.0/v0.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>slack-go/slack (github.com/slack-go/slack)</summary>

###
[`v0.13.1`](https://togithub.com/slack-go/slack/releases/tag/v0.13.1)

[Compare
Source](https://togithub.com/slack-go/slack/compare/v0.13.0...v0.13.1)

#### What's Changed

v0.13.1 is now available. It contains **no breaking changes** but does
expose some new fields previously unavailable.

##### Enhancements

- Added `UnfurlLinks` and `UnfurlMedia` to `WebhookMessage` by
[@&#8203;lheiskan](https://togithub.com/lheiskan) in
[https://github.com/slack-go/slack/pull/1208](https://togithub.com/slack-go/slack/pull/1208)
- Added `isReadOnly` property to `Conversation` struct by
[@&#8203;GGonryun](https://togithub.com/GGonryun) in
[https://github.com/slack-go/slack/pull/1232](https://togithub.com/slack-go/slack/pull/1232)

##### Bug Fixes

- Fixed `UploadFileV2` when using text content by
[@&#8203;calebmckay](https://togithub.com/calebmckay) in
[https://github.com/slack-go/slack/pull/1291](https://togithub.com/slack-go/slack/pull/1291)
- Made `Channel` optional on `UploadFileV2` by
[@&#8203;0xdeafcafe](https://togithub.com/0xdeafcafe) in
[https://github.com/slack-go/slack/pull/1293](https://togithub.com/slack-go/slack/pull/1293)

##### Chores / Code Cleanup

- Replace a Loop with Slice by
[@&#8203;testwill](https://togithub.com/testwill) in
[https://github.com/slack-go/slack/pull/1211](https://togithub.com/slack-go/slack/pull/1211)
- Added Deprecation Notice for `files.upload` by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1300](https://togithub.com/slack-go/slack/pull/1300)
- Added Go Test Coverage for 1.21 and 1.22 by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1298](https://togithub.com/slack-go/slack/pull/1298)

##### Documentation Updates

- Updated Inline Docs and API References by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1299](https://togithub.com/slack-go/slack/pull/1299)
- Added an example for `Pagination` by
[@&#8203;adamrothman](https://togithub.com/adamrothman) in
[https://github.com/slack-go/slack/pull/1201](https://togithub.com/slack-go/slack/pull/1201)
- Added an example for `ConversationHistory` by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1302](https://togithub.com/slack-go/slack/pull/1302)
- Added an example for `AddRemoteFile` and `DeleteFile` by
[@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) in
[https://github.com/slack-go/slack/pull/1303](https://togithub.com/slack-go/slack/pull/1303)

#### New Contributors

- [@&#8203;calebmckay](https://togithub.com/calebmckay) made their first
contribution in
[https://github.com/slack-go/slack/pull/1291](https://togithub.com/slack-go/slack/pull/1291)
- [@&#8203;lheiskan](https://togithub.com/lheiskan) made their first
contribution in
[https://github.com/slack-go/slack/pull/1208](https://togithub.com/slack-go/slack/pull/1208)
- [@&#8203;GGonryun](https://togithub.com/GGonryun) made their first
contribution in
[https://github.com/slack-go/slack/pull/1232](https://togithub.com/slack-go/slack/pull/1232)
- [@&#8203;0xdeafcafe](https://togithub.com/0xdeafcafe) made their first
contribution in
[https://github.com/slack-go/slack/pull/1293](https://togithub.com/slack-go/slack/pull/1293)
- [@&#8203;lorenzoaiello](https://togithub.com/lorenzoaiello) made their
first contribution in
[https://github.com/slack-go/slack/pull/1300](https://togithub.com/slack-go/slack/pull/1300)
- [@&#8203;adamrothman](https://togithub.com/adamrothman) made their
first contribution in
[https://github.com/slack-go/slack/pull/1201](https://togithub.com/slack-go/slack/pull/1201)

**Full Changelog**:
slack-go/slack@v0.13.0...v0.13.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/ymotongpoo/opentelemetry-collector-extra).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
kelseymills added a commit to incident-io/slack that referenced this pull request Nov 7, 2024
* Add example of updating modal

* socketmode.Client.run: Fix slack-go#1125 by allowing producer of channel to close when it is finished, and consumer to see the close

* socketmode.Client.run: Fix small race potential on 'firstErr' as the outer goroutine did not wait on all inner goroutines that had a chance to set it, also make sure to check error for context.Canceled appropriately

* socketmode.Client.Events: Change all events produced to Events channel via a method that has an escape hatch; unable to change public Events field without breaking api, though

* socketmode.Client.run: Cover edge case where all goroutines exit nil, when getting buffered (first) error

* socketmode: Slight refactor of Send/Ack on Client to allow passing contexts for channel ops, though they are very similar now

* socketmode: Shore up error handling via errors.Is/As/(Un)Wrapping, other small changes

* delete dupulicated code at L181

* Change comments at L183 to suggestion

Co-authored-by: Naoki Kanatani <k12naoki@gmail.com>

* Change http response StatusUnauthorized at L188 to StatusInternalServerError

Co-authored-by: Naoki Kanatani <k12naoki@gmail.com>

* socketmode example: use embedded api client in socketmode client

* socketmode remove duplicate debug logging

* socketmode bytes no longer used

* socketmodehandler: implemented RunEventLoopContext method. now socketmodehandler will react on context cancellation

* socketmode: awaiting of message receiver goroutine in run method to avoid panics

* bugfix: silly mistake in runLoop method, renamed closed to ok (recv chan)

* Export the Binder type from slacktest

* Add ReplyUsers to Msg Struct

This is something that Slack returns by default on API response.

* add support for user_profile_changed callback event

* add test

* add 2FA type to slack user

Signed-off-by: Ivan Milchev <ivan@mondoo.com>

* Remove omitempty

* Test with Go 1.18~1.20

* Update README for slacktest

* Add actions/stale action

* Increase operations-per-run

* Bump up golangci-lint and its action to latest

* Add git repository's checkout option

* Add setup-go step

* gofmt

* Add 'FIXME's for deadman timer reset race

* Fix race on deadman timer Elapsed+Reset by more efficient use of ticker and ping time channel. Remove deadman file as it is no longer needed

* Add UnfurlLinks and UnfurlMedia to WebhookMessage

* to support 'classic unfurl' configuration options in webhook messages.
* https://api.slack.com/reference/messaging/link-unfurling#classic_unfurl

* chore: unnecessary use of fmt.Sprintf

* Redact tokens in debug log

* Tiny unrelated lint fix

* Add support for refresh tokens

* Conversation inviteShared support

* Create structs for manifest endpoint

* Add requests to validate manifests

* Add create and delete methods, implement common interface

* Add tokens

* Finish manifest methods

* Fix linting

* Rename value

* More tests, return manifest itself when exporting

* Undo pointer and take reference manually

* More tests

* Add options for tokens

* Use correct method

* use config token

* Pass config token as param

* Small bugfix

* add `omitempty` to ConfirmationBlockObject.Deny

a

* change case "/humboldttest": to case "/slash" to handle http request correctly

* remove post message because it's not related to sample of updating modal

* add time.sleep to wait to see updated modal

* Add examples

* add time pkg

* Re-phrase example docs

* Add is_enterprise_install flag to command, interactions, and oauth2 response

* Add blocks in slackevents.MessageEvent

* Add support for Rich Text Input

* Add Video Block (slack-go#1210)

Add support for Video Blocks

Ref. https://api.slack.com/reference/block-kit/blocks#video

cf. slack-go#1205

---------

Co-authored-by: David Parsley <parsley@linuxjedi.org>
Co-authored-by: Ben Bourdin <ben-bourdin451@users.noreply.github.com>

* Add rich_text_input block conv

* Create openid.connect.token function to fetch access token

* Fix incorrectly commented functions

* Improved comment for GetOpenIDConnectToken

* Add RichTextList support

* Add support for Indent field

Co-authored-by: SimonLiuRoblox <84740141+SimonLiuRoblox@users.noreply.github.com>

* Add block element type FileInput

* Add Files field related to FileInput element in the BlockAction

* add connected_team_ids, shared_team_ids, internal_team_ids, is_global_shared field to conversation

* fix: expose is_enterprise_install field

* Add "edited" field to the app mention event

* Fix linter

* Fix: always add context to errors during block serde

Signed-off-by: kayos@tcp.direct <kayos@tcp.direct>

* Add WithURL support for ButtonBlockElement

* add rich_text_quote and rich_text_preformatted

* add deleted timestamp for deleted msg events

* Adding structure comments & definitions

* Parse string or boolean for SlashCommand.IsEnterpriseInstall

* validate text length

* Add missing message option for link_names

* fix some typos

* ignore vendor

* bots.info

* chat.scheduledMessages.list

* files.list

* usergroups.create

* usergroups.list

* reactions.list

* search.all
search.files
search.messages

* team.accessLogs

* team.billableInfo

* team.profile.get

* pr-prep

* Fix UploadFileV2 when using text content (slack-go#1291)

* Trigger GitHub Actions

* chore: slice replace loop (slack-go#1211)

* chore: slice replace loop

* Trigger GitHub Actions

---------

Co-authored-by: Lorenzo Aiello <lorenzo.aiello@flightsimcorp.com>

* Add isReadOnly property to Conversation struct (slack-go#1232)

Co-authored-by: Miguel Campos <miguel@fullstory.com>

* chore: make channel optional on `UploadFileV2` (slack-go#1293)

* Support no channel

* added test

* fix channel id param name

* chore: Adding Deprecation Notice for files.upload (slack-go#1300)

* ci: Adding Go Test Coverage for 1.21 and 1.22 (slack-go#1298)

* docs: Updating Inline Docs and API References (slack-go#1299)

* docs: Add an example demonstrating correct usage of GetUsersPaginated (slack-go#1201)

* Add an example demonstrating correct usage of GetUsersPaginated

* Requeue GitHub Actions

---------

Co-authored-by: Lorenzo Aiello <lorenzo.aiello@slack-corp.com>

* docs: Adding an example for AddRemoteFile and DeleteFile (slack-go#1303)

* docs: Adding an example for ConversationHistory (slack-go#1302)

* slackevents: support metadata in MessageEvent (slack-go#1307)

Support for receiving metadata when reading conversation history was
first added in PR slack-go#1083. This commit extends metadata support to message
events when connected to the Slack WebSocket API.

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* chore: replace ioutil with io or os package (slack-go#1310)

* add file access field to file struct for slackevents (slack-go#1312)

* Add slack_file to image block (slack-go#1311)

Co-authored-by: Rhys M <rhysm@protonmail.com>

* feat: Events api reconcilation (slack-go#1306)

* events added with test

* added events with tests

* added all events and changes done

* feat: Add support for parsing AppRateLimited events (slack-go#1308)

The code changes in this commit add support for parsing AppRateLimited events in the `ParseEvent` function. This allows the application to handle rate-limited events from the Slack API.

* feat: Add Properties.Canvas to Channel (slack-go#1228)

* Add Properties.Canvas to Channel

* Trigger GitHub Actions

---------

Co-authored-by: Lorenzo Aiello <lorenzo.aiello@slack-corp.com>

* fix: create multipart form when multipart request (slack-go#1117)

* fix: create multipart form when multipart request

* call createFormFields in go func()

del coment

* Trigger GitHub Actions

---------

Co-authored-by: Lorenzo Aiello <lorenzo.aiello@slack-corp.com>

* feat: Add go version 1.23 to test matrix (test.yml) (slack-go#1315)

* ci: Bump GitHub Actions to Latest Versions

* fix: fix deprecated comment for UploadFile and UploadFileContext (slack-go#1316)

* Support publishing a messge to a specific thread (slack-go#1309)

Support publishing a messge to a specific thread
https://api.slack.com/interactivity/handling#publishing_in_thread

From slack interactivity documentation:
Publishing responses in thread 
If you want to publish a message to a specific thread, you'll need to
include an attribute response_type and set its value to in_channel.
Then, to specify the thread, include a thread_ts.

Also, be sure to set replace_original to false or you'll overwrite the
message you're wanting to respond to!

* fix: Add required `format` field to rich text date blocks (slack-go#1317)

As per [block kit
docs](https://api.slack.com/reference/block-kit/blocks#date-element-type),
the date element requires a format string to be included. Currently,
submitting a block kit with this element results in a slack API error.

Also added the two optional fields `url` and `fallback` for posterity.

##### PR preparation
Run `make pr-prep` from the root of the repository to run formatting,
linting and tests.

##### Should this be an issue instead
- [ ] is it a convenience method? (no new functionality, streamlines
some use case)
- [ ] exposes a previously private type, const, method, etc.
- [ ] is it application specific (caching, retry logic, rate limiting,
etc)
- [ ] is it performance related.

##### API changes

Since API changes have to be maintained they undergo a more detailed
review and are more likely to require changes.

- no tests, if you're adding to the API include at least a single test
of the happy case.
- If you can accomplish your goal without changing the API, then do so.
- dependency changes. updates are okay. adding/removing need
justification.

###### Examples of API changes that do not meet guidelines:
- in library cache for users. caches are use case specific.
- Convenience methods for Sending Messages, update, post, ephemeral,
etc. consider opening an issue instead.

* fix: Updated RichTextInputBlockElement InitialValue data type (slack-go#1320)

##### Pull Request Guidelines

These are recommendations for pull requests.
They are strictly guidelines to help manage expectations.

##### PR preparation
Run `make pr-prep` from the root of the repository to run formatting,
linting and tests.

##### Should this be an issue instead
- [x] is it a convenience method? (no new functionality, streamlines
some use case)
- [ ] exposes a previously private type, const, method, etc.
- [ ] is it application specific (caching, retry logic, rate limiting,
etc)
- [ ] is it performance related.

Fix for [issue slack-go#1276](slack-go#1276)
Updated the datatype of RichTextInputBlockElement InitialValue from
string to *RichTextBlock

* feat: Add support for unicode parameter in emoji type of rich text blocks (slack-go#1319)

This PR adds support for the `unicode` parameter to the
`RichTextSectionEmojiElement` struct for rich text blocks. While this
parameter is not officially documented in Slack's API, it is present in
the JSON payload of actual Slack messages and represents the Unicode
code point of the emoji.
https://api.slack.com/reference/block-kit/blocks#emoji-element-type

For example, a rich text block with an emoji can include the unicode
field like this:

```json
"blocks": [
    {
      "type": "rich_text",
      "block_id": "xxxxx",
      "elements": [
        {
          "type": "rich_text_section",
          "elements": [
            {
              "type": "emoji",
              "name": "+1",
              "unicode": "1f44d"
            }
          ]
        }
      ]
    }
  ]
```

The unicode parameter behaves similarly to the skin-tone parameter,
which is also undocumented but has already been included in the
structure. This PR aligns the handling of unicode in the same way to
ensure emojis are fully supported in Slack message payloads.

Please review, and feel free to provide feedback if any adjustments are
needed. Thank you!



##### Pull Request Guidelines

These are recommendations for pull requests.
They are strictly guidelines to help manage expectations.

##### PR preparation
Run `make pr-prep` from the root of the repository to run formatting,
linting and tests.

##### Should this be an issue instead
- [ ] is it a convenience method? (no new functionality, streamlines
some use case)
- [ ] exposes a previously private type, const, method, etc.
- [ ] is it application specific (caching, retry logic, rate limiting,
etc)
- [ ] is it performance related.

##### API changes

Since API changes have to be maintained they undergo a more detailed
review and are more likely to require changes.

- no tests, if you're adding to the API include at least a single test
of the happy case.
- If you can accomplish your goal without changing the API, then do so.
- dependency changes. updates are okay. adding/removing need
justification.

###### Examples of API changes that do not meet guidelines:
- in library cache for users. caches are use case specific.
- Convenience methods for Sending Messages, update, post, ephemeral,
etc. consider opening an issue instead.

* Add endpoints for `calls.*` apis and `Type: call` in blockkit (slack-go#1190)

Implement the API methods for the Calls API in Slack
https://api.slack.com/apis/calls

Implemented methods
- `calls.add` - Indicate a new call has been started
- `calls.end` - Indicate to slack that the call has ended
- `calls.info` - Get information about an ongoing slack call object
- `calls.update` - update call information
- `calls.participants.add`
- `calls.participants.remove`

Additionally, I've added the minimal version of `Block{Type: "call",
CallID: string}` which slack recommends/requires be posted back to the
channel https://api.slack.com/apis/calls#post_to_channel.

All implemented functionality is publicly documented. There appear to be
additional attributes on the `type: call` block, however those appear to
be internal values for slack's rendering, so I have left them out. See
this gist for specific responses
https://gist.github.com/winston-stripe/0cac608bd63b42d73a352be53577f7fd

##### Pull Request Guidelines

These are recommendations for pull requests.
They are strictly guidelines to help manage expectations.

##### PR preparation
Run `make pr-prep` from the root of the repository to run formatting,
linting and tests.

##### Should this be an issue instead
- [ ] is it a convenience method? (no new functionality, streamlines
some use case)
- [ ] exposes a previously private type, const, method, etc.
- [ ] is it application specific (caching, retry logic, rate limiting,
etc)
- [ ] is it performance related.

##### API changes

Since API changes have to be maintained they undergo a more detailed
review and are more likely to require changes.

- no tests, if you're adding to the API include at least a single test
of the happy case.
- If you can accomplish your goal without changing the API, then do so.
- dependency changes. updates are okay. adding/removing need
justification.

###### Examples of API changes that do not meet guidelines:
- in library cache for users. caches are use case specific.
- Convenience methods for Sending Messages, update, post, ephemeral,
etc. consider opening an issue instead.

---------

Co-authored-by: Winston Durand <me@winstondurand.com>

* feat: Add Convenience Methods to Block Elements (slack-go#1279)

Adds some convenience methods to block elements to easily add
functionality

---------

Co-authored-by: Lorenzo Aiello <lorenzo.aiello@slack-corp.com>

* feat: Add functions.completeError and functions.completeSuccess (slack-go#1328)

Completion of slack-go#1301

- Adds the new complete functions for the Function Execution Event
- Adds the context version of those methods

---
> this PR to handle event
[function_executed](https://api.slack.com/events/function_executed) and
response the function with
[functions.completeSuccess](https://api.slack.com/methods/functions.completeSuccess)
and
[functions.completeError](https://api.slack.com/methods/functions.completeError)

---------

Co-authored-by: Yoga Setiawan <yogainformatika@gmail.com>

* feat: Add support for external_limited option of inviteShared (slack-go#1330)

Expose the ability to override the [external_limited
option](https://api.slack.com/methods/conversations.inviteShared#arg_external_limited)
for inviteShared.

Adding the param to all the InviteSharedEmailsToConversation, etc.
methods would be a breaking change to those callers, so I opted instead
to expose the underlying helper (renamed to InviteSharedToConversation).

I feel like the convenience methods
(InviteSharedEmailsToConversation/InviteSharedUserIDsToConversation) are
not actually that much more convenient than just using the helper, and I
think we can eventually remove them in favor of having people call
InviteSharedToConversation directly. But that's a future thing.

Although it's slightly inconvenient for the caller to use *bool for
ExternalLimited, the two alternatives I considered are, I think worse:
- Include ExternalLimited as a bool in the InviteSharedParams. I dislike
this way because it gives the SDK user of InviteSharedToConversation a
different default behavior from inviteShared, since the default value in
the API is true.
- Add a bool like NonExternalLimited to InviteSharedParams. This way the
defaulting is consistent with the API if it's not specified; however,
the InviteSharedParams no longer mirror the API args, which I think is
confusing.

* feat: Add support for Canvas API methods (slack-go#1334)

This PR introduces new functionalities for managing canvases and
creating channel-specific canvases.

- CreateCanvas
- DeleteCanvas
- EditCanvas
- SetCanvasAccess
- DeleteCanvasAccess
- LookupCanvasSections
- CreateChannelCanvas

Closes slack-go#1333

* Add back a few things I removed from our version when merging

* Remove duplicate TeamID

* Fix tests

* Fix linting

* Implement interface for generic section

* Fix methods to generate new rich text types

* Implement set elements

* Revert rich text changes

* Delete unnecessary file

---------

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: kayos@tcp.direct <kayos@tcp.direct>
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
Co-authored-by: kouwakai <kouyama112@gmail.com>
Co-authored-by: Ian Burton <iburton@octolabs.io>
Co-authored-by: KouWakai <35868597+KouWakai@users.noreply.github.com>
Co-authored-by: Naoki Kanatani <k12naoki@gmail.com>
Co-authored-by: kittydoor <me@kitty.sh>
Co-authored-by: lololozhkin <aal@darktree.com>
Co-authored-by: lololozhkin <alexand3r.lozhkin@gmail.com>
Co-authored-by: Kevin Paulisse <kpaulisse@users.noreply.github.com>
Co-authored-by: Aleksa Arsic <85497919+aleksa11010@users.noreply.github.com>
Co-authored-by: Jeffrey Dorrycott <jeffrey@allma.io>
Co-authored-by: Ivan Milchev <ivan@mondoo.com>
Co-authored-by: Lauri Heiskanen <lauri.heiskanen@volument.com>
Co-authored-by: guoguangwu <guoguangwu@magic-shield.com>
Co-authored-by: Daniel Abraham <daniel@autokitteh.com>
Co-authored-by: Barak Amar <barak.amar@treeverse.io>
Co-authored-by: stijndcl <declercq.stijn@outlook.com>
Co-authored-by: Kamil Gwóźdź <kamil@gwozdz.me>
Co-authored-by: David Parsley <david@welldhealth.com>
Co-authored-by: Hussachai Puripunpinyo <hussachai@gmail.com>
Co-authored-by: invzhi <invzhi@protonmail.com>
Co-authored-by: Peiman Jafari <peiman.jafari@activision.com>
Co-authored-by: walkure <walkure@kmc.gr.jp>
Co-authored-by: David Parsley <parsley@linuxjedi.org>
Co-authored-by: Ben Bourdin <ben-bourdin451@users.noreply.github.com>
Co-authored-by: Daniel Michaels <dan@danielms.site>
Co-authored-by: Daniel Pieper <daniel.pieper@personio.de>
Co-authored-by: Daniel Pieper <40295712+daniel-pieper-personio@users.noreply.github.com>
Co-authored-by: SimonLiuRoblox <84740141+SimonLiuRoblox@users.noreply.github.com>
Co-authored-by: Aotokitsuruya <contact@aotoki.me>
Co-authored-by: Peter Nguyen <peter.nguyen@zendesk.com>
Co-authored-by: Alvin See <asee@zendesk.com>
Co-authored-by: IbirbyZh <040796@gmail.com>
Co-authored-by: kayos@tcp.direct <kayos@tcp.direct>
Co-authored-by: Josh Branham <jbranham@salsify.com>
Co-authored-by: Rustam Gilyazov <16064414+rusq@users.noreply.github.com>
Co-authored-by: Jeremy Birtola <jeremy@birtola.com>
Co-authored-by: Andres Peñaloza <andres.gonzalez@hover.to>
Co-authored-by: Robby Dyer <rdyer@chegg.com>
Co-authored-by: yutasb <shibamoto.yuta@gmail.com>
Co-authored-by: candiduslynx <candiduslynx@gmail.com>
Co-authored-by: Alex Shcherbakov <candiduslynx@users.noreply.github.com>
Co-authored-by: Caleb McKay <11079725+calebmckay@users.noreply.github.com>
Co-authored-by: Lorenzo Aiello <lorenzo.aiello@flightsimcorp.com>
Co-authored-by: Lorenzo Aiello <lorenzo.aiello@slack-corp.com>
Co-authored-by: Miguel Campos <amodestduck@gmail.com>
Co-authored-by: Miguel Campos <miguel@fullstory.com>
Co-authored-by: Alexander Forbes-Reed <github@alex.forbes.red>
Co-authored-by: Adam Rothman <rothman.adam@gmail.com>
Co-authored-by: Robert Fratto <robertfratto@gmail.com>
Co-authored-by: Naka Masato <masatonaka1989@gmail.com>
Co-authored-by: Peter Nguyen <33224337+zFlabmonsta@users.noreply.github.com>
Co-authored-by: rhysm <rhysm@users.noreply.github.com>
Co-authored-by: Rhys M <rhysm@protonmail.com>
Co-authored-by: Arya Khochare <91268931+Aryakoste@users.noreply.github.com>
Co-authored-by: K.Utsunomiya <32708603+nemuvski@users.noreply.github.com>
Co-authored-by: ku KUMAGAI <ku0522a@gmail.com>
Co-authored-by: mineo <euonymuslke@gmail.com>
Co-authored-by: ICHINOSE Shogo <shogo82148@gmail.com>
Co-authored-by: Nikolai <shulyakovskiy@mail.ru>
Co-authored-by: Luke Josh <92695731+luke-josh@users.noreply.github.com>
Co-authored-by: Manjish <manjish77@gmail.com>
Co-authored-by: YutoKashiwagi <58618766+YutoKashiwagi@users.noreply.github.com>
Co-authored-by: Winston Durand <68715117+winston-stripe@users.noreply.github.com>
Co-authored-by: Winston Durand <me@winstondurand.com>
Co-authored-by: Obed S. <113571073+obed-sj@users.noreply.github.com>
Co-authored-by: Gideon Williams <gideon@gideonw.com>
Co-authored-by: Yoga Setiawan <yogainformatika@gmail.com>
Co-authored-by: Bennett Amodio <amodio.bennett@gmail.com>
Co-authored-by: Jaro Spisak <61154065+jarospisak-unity@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UploadFileV2 uploads incorrectly when using text Content parameter
3 participants