poshbotio / PoshBot

Powershell-based bot framework
MIT License
536 stars 108 forks source link

[slack] Card with only ImageUrl shows empty text string #174

Closed mkevenaar closed 4 years ago

mkevenaar commented 5 years ago

When you create a new Card with only an ImageUrl ``` is shown twice in the response.

Expected Behavior

When only an ImageUrl is added, only the image is shown

Current Behavior

It also adds an empty line

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a card with New-PoshBotCardResponse -ImageUrl https://my.image.url/image.png
  2. Display the card in Slack
  3. Notice the empty backticks on top

Context

{"DataTime":"2019-08-23 09:00:48Z","Class":"SlackBackend","Method":"SendMessage","Severity":"Normal","LogLevel":"Debug","Message":"Sending card response back to Slack channel [REMOVED]","Data":{"color":"#008000","image_url":"https://my.image.url/image.png","fallback":"no data","text":"```\r\n```","mrkdwn_in":["text"]}}

The text element contains a new line: "text":"```\r\n```"

Your Environment

devblackops commented 5 years ago

Thanks @mkevenaar. We'll get this fixed.

mkevenaar commented 4 years ago

@devblackops Thanks this worked perfectly!