Duplicate images in slack for one URL

My slack bot is giving me two pictures for one URL

one big image and one small image How to eradicate this. i want only one picture per URL.

domain.yml file

slots: city: type: text

intents:

  • greet
  • goodbye
  • affirm
  • deny
  • mood_great
  • mood_unhappy
  • bot_challenge
  • get_weather
  • cmt
  • browser_support
  • getting_access_to_cmt
  • case_manager_tool_url
  • logging_into_case_manager_tool
  • logging_out_of_case_manager_tool
  • ask_help

entities:

  • city

actions:

  • action_get_weather

responses: utter_greet:

  • text: “Hey! How are you?”

utter_cheer_up:

utter_did_that_help:

  • text: “Did that help you?”

utter_happy:

  • text: “Great, carry on!”

utter_goodbye:

  • text: “Bye”

utter_iamabot:

  • text: “I am a privacy-support-bot, powered by Satya”

utter_the_weather:

  • text: “the weather is cool”

utter_ask_location:

  • text: “for which location”

utter_browser_support:

  • text: “Case Manager tool is supported on all browsers that is available from PC@IBM App Store”

utter_getting_access_to_cmt:

utter_case_manager_tool_url:

utter_logging_into_case_manager_tool:

utter_logging_out_of_case_manager_tool:

utter_cmt:

  • text: “case manager tool basics” buttons:
    • title: “Browser Support” payload: “/browser_Support”
    • title: “Getting Access to CMT” payload: “/getting_access_to_cmt”
    • title: “Case Manager Tool URl” payload: “/case_manager_tool_url”
    • title: “Logging into Case Manager Tool” payload: “/logging_into_case_manager_tool”
    • title: “Logging out of Case Manager Tool” payload: “/logging_out_of_case_manager_tool”

utter_ask_help:

  • buttons:
    • payload: /affirm title: :+1:
    • payload: /deny title: :-1: text: Did that help?

session_config: session_expiration_time: 60 carry_over_slots_to_new_session: true

I could easily fix this by instead of sending

await self.client.chat_postMessage( channel=recipient, as_user=True, text=image, blocks=[image_block], )

send an empty string as text (the text field is not even required by the slack API if the message has blocks) like this:

await self.client.chat_postMessage( channel=recipient, as_user=True, text='', blocks=[image_block], )

I’m having the same issue, however, I am using docker-compose which makes it a lot harder to change the source code of channels/slack.py. Are there any work arounds when writing code in actions.py?

I have found a solution

attachment = {
	'image_url': image_url,
	'text': ''
}
dispatcher.utter_message(attachment=attachment)