botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 87 forks source link

Bot avatar not changing when specified unless user replies first #1673

Closed quijadev closed 2 years ago

quijadev commented 2 years ago

Describe the bug After creating a before_outgoing_middleware hook to change the bot's avatar based on a validation, the avatar doesn't change until the user sends a message. Potentially, the avatar might not change at all unless the user replies.

To Reproduce Steps to reproduce the behavior:

  1. Create a hook in before_outgoing_middleware that changes the web avatar url based on a condition
  2. Start a conversation and meet that condition through the flow (e.g. if event.payload.text === "help")
  3. The avatar will stay the same until the user replies with a message of their own
  4. The next message sent by the bot will have the correct avatar, despite the condition being met since step 2

Expected behavior The avatar should change immediately as soon as the condition is met without the user having to send another message.

Screenshots bug The avatar should have changed since the first 'Hi Customer.' message.

Environment

Additional context Other than when the avatar changes, everything else works as expected. Avatar change doesn't carry over to new session or flow restart.

github-actions[bot] commented 1 year ago

Available on v12.30.3