slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.64k stars 1.13k forks source link

Attachment does not send text in proper way? #1127

Open Dregorio1 opened 1 year ago

Dregorio1 commented 1 year ago

What happened

I have table (string) like: +-----+---------------------------------------------------+--------------+--------+\n| # | FIRST NAME | LAST NAME | SALARY | \n+-----+---------------------------------------------------+--------------+--------+\n| 1 | Very long string is here, really very long string | Stark | 3000 |\n+-----+---------------------------------------------------+--------------+--------+

I wrapped it in "``" and send asAttachment` but in slack I see that the table is formatted wrong like:

+-----+---------------------------------------------------+
--------------+--------+
|   # | FIRST NAME                                        
| LAST NAME    | SALARY |    
+-----+---------------------------------------------------+
--------------+--------+
|   1 | Very long string is here, really very long string 
| Stark        |   3000 |
+-----+---------------------------------------------------+
--------------+--------+

Expected behavior

+-----+---------------------------------------------------+--------------+--------+
|   # | FIRST NAME                                        | LAST NAME    | SALARY |    
+-----+---------------------------------------------------+--------------+--------+
|   1 | Very long string is here, really very long string | Stark        |   3000 |
+-----+---------------------------------------------------+--------------+--------+

How I can send it in proper way?

Versions