I have created a bot via MS Teams. I registered the bot in MS Bot Framework portal and then created an app that is connected to this bot on Teams.
I am able to chat with my bot and it responds without an issue. However, it does not work when I try to use the web chat option that is provided to test the bot in the Bot Framework portal. It fails when I try to respond with a ‘forbidden’ error. What could be causing this? This is the Python code I am using to send responses:
credentials = MicrosoftAppCredentials(
app_id=APP_ID,
password=APP_PASSWORD
)
connector = ConnectorClient(credentials, base_url=SERVICE_URL)
connector.conversations.send_to_conversation(
CONVERSATION_ID,
Activity(
type=ActivityTypes.message,
channel_id=CHANNEL_ID,
recipient=ChannelAccount(
id=RECIPIENT_ID
),
from_property=ChannelAccount(
id=FROM_ID,
),
text="HELLO WORLD!"
)
)
All of these attributes such as the SERVICE_URL
and so forth are extracted from the message that is sent by the bot.
How can I refactor this to also reply on the web chat?