# Message Menu in Slack

**URL:** <https://forum.rasa.com/t/message-menu-in-slack/4806>\
**Category:** Rasa Open Source\
**Created:** [January 31, 2019, 7:17am UTC](https://forum.rasa.com/t/message-menu-in-slack/4806 "2019-01-31T07:17:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asya](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@Asya](https://forum.rasa.com/u/Asya)\
**Post date:** [January 31, 2019, 7:17am UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/1 "2019-01-31T07:17:46Z")

</div>

Hey, I am trying out different features that can be incorporated in a slack channel. i was able to figure out how to display and track a button control. But similarly would like to know how to incorporate other interactive components like message menu into Slack. also I would like to know how to send files into the channel via custom actions

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [March 1, 2019, 2:00pm UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/2 "2019-03-01T14:00:37Z")

</div>

Hi again Aysa,

Most of the actions you are looking for are found in `rasa_core.channels.slack` – there you’ll find methods like `send_text_with_buttons` and `_get_button_reply` as well as `send_attachment`.

---

<div class="post-metadata">

**Author:** ![mohan](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mohan](https://forum.rasa.com/u/mohan)\
**Post date:** [March 1, 2019, 2:08pm UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/3 "2019-03-01T14:08:58Z")

</div>

@erohmensing i’m very new to rasa could you please provide sample code for send\_attachment

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [March 1, 2019, 2:38pm UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/4 "2019-03-01T14:38:42Z")

</div>

@mohan, have you set up your slack channel yet?

---

<div class="post-metadata">

**Author:** ![mohan](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mohan](https://forum.rasa.com/u/mohan)\
**Post date:** [March 1, 2019, 2:55pm UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/5 "2019-03-01T14:55:57Z")

</div>

Yes… I tried using [Creating a graph in the custom action and rendering the graph to the UI](http://forum.rasa.com/t/creating-a-graph-in-the-custom-action-and-rendering-the-graph-to-the-ui/2658/6?u=mohan) but i’m not getting any attachment in chat window and also not getting any error. Here is the code

```
   from rasa_core.channels.slack import SlackBot
   my_slack = SlackBot('slack token')
   my_slack.send_attachment(recipient_id=None,attachment='attachment path')
```

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [March 13, 2019, 10:40am UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/6 "2019-03-13T10:40:25Z")

</div>

Is your slackbot working at all? I.e. are you getting a message in the chat window with no attachment? Can you successfully send messages? That will help me figure out if it’s an attachment problem

---

<div class="post-metadata">

**Author:** ![mohan](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mohan](https://forum.rasa.com/u/mohan)\
**Post date:** [March 13, 2019, 1:57pm UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/7 "2019-03-13T13:57:42Z")

</div>

@erohmensing Yes I’m able to send and receive messages… but for attachment i get Attachment: file\_name, do i have to configure slack to receive images or have to work with the code?

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [March 13, 2019, 4:54pm UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/8 "2019-03-13T16:54:22Z")

</div>

If you’re trying to send images, I think you want `send_image_url` rather than `send_attachment`.

Here’s what the method looks like:

```auto
def send_image_url(self, recipient_id, image_url, message=""):
        image_attachment = [{"image_url": image_url,
                             "text": message}]
        recipient = self.slack_channel or recipient_id
        return super(SlackBot, self).api_call("chat.postMessage",
                                              channel=recipient,
                                              as_user=True,
                                              attachments=image_attachment)

```

---

<div class="post-metadata">

**Author:** ![mohan](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mohan](https://forum.rasa.com/u/mohan)\
**Post date:** [March 14, 2019, 7:10am UTC](https://forum.rasa.com/t/message-menu-in-slack/4806/9 "2019-03-14T07:10:29Z")

</div>

Thank you @erohmensing , It didn’t help i want to send image itself.
