# Send botpress event on chat start

**URL:** <https://forums.rocket.chat/t/send-botpress-event-on-chat-start/14508>\
**Category:** Rocket.Chat Apps\
**Created:** [July 19, 2022, 10:07am UTC](https://forums.rocket.chat/t/send-botpress-event-on-chat-start/14508 "2022-07-19T10:07:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benc35](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@benc35](https://forums.rocket.chat/u/benc35)\
**Post date:** [July 19, 2022, 10:07am UTC](https://forums.rocket.chat/t/send-botpress-event-on-chat-start/14508/1 "2022-07-19T10:07:45Z")

</div>

Hi. Apologies if this is the wrong sub, I’m new here 🙂

I’m using [hlatki01/botpress-connector](https://github.com/hlatki01/botpress-connector) to connect RocketChat to my botpress bot. It’s working fine. However, visitors have to type something into the livechat widget to trigger an initial bot response. I’d prefer the bot agent to start the conversation as soon as the widget is opened. The [botpress docs](https://botpress.com/docs/messaging-channels/botpress-webchat/website-embedding#acting-proactively) say the way to do this is by sending a botpress event from the page:

```auto
window.botpressWebChat.sendEvent({
  type: "proactive-trigger",
  channel: "web",
  payload: {
    text: "fake message",
  },
})

```

… and catching the event in a botpress `before_incoming_middleware ` hook.

However, I’m not embedding botpress on the page - I don’t _have_ `window.botpressWebChat`. I’m a bit stuck - how can I trigger some sort of event when the livechat widget is opened, so that the botpress agent receives it and can greet the visitor?

---

<div class="post-metadata">

**Author:** ![johnson.cherian](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@johnson.cherian](https://forums.rocket.chat/u/johnson.cherian)\
**Post date:** [April 11, 2023, 9:40am UTC](https://forums.rocket.chat/t/send-botpress-event-on-chat-start/14508/2 "2023-04-11T09:40:46Z")

</div>

Hi Did u figure out the issue.?
