Skip to content

CloudAdapter' object has no attribute 'create_connector_client' #2061

Closed
@BasileBerckmoes

Description

@BasileBerckmoes

Version 4.14.7

In my MS Teams bot i want to loop over all members that are already in the Team when i add the bot.

To do this i wrote

    async def on_installation_update_add(self, turn_context: TurnContext):
        # Get the team details
        team_details = await TeamsInfo.get_team_details(turn_context)
        
        if team_details:
            team_id = team_details.id
            # Retrieve all members of the team
            team_members = await TeamsInfo.get_team_members(turn_context, team_id)
            for member in team_members:
                if member.id != turn_context.activity.recipient.id:  # Avoid messaging the bot itself
                    # Prepare the message

It seems that TeamsInfo.get_team_members(turn_context, team_id) is not compatible with CloudAdapter.

settings is not a known attribute of class <class 'botbuilder.schema.teams._models_py3.TeamsChannelData'> and will be ignored
source is not a known attribute of class <class 'botbuilder.schema.teams._models_py3.TeamsChannelData'> and will be ignored

[on_turn_error] unhandled error: 'CloudAdapter' object has no attribute 'create_connector_client'
Traceback (most recent call last):
File "\env\lib\site-packages\botbuilder\core\bot_adapter.py", line 174, in run_pipeline
return await self._middleware.receive_activity_with_status(
File "\env\lib\site-packages\botbuilder\core\middleware_set.py", line 69, in receive_activity_with_status
return await self.receive_activity_internal(context, callback)
File "\env\lib\site-packages\botbuilder\core\middleware_set.py", line 79, in receive_activity_internal
return await callback(context)
File "/app\bots\main_bot.py", line 30, in on_turn
await self.teams_bot.on_turn(turn_context)
File "\env\lib\site-packages\botbuilder\core\activity_handler.py", line 92, in on_turn
await self.on_installation_update(turn_context)
File "\env\lib\site-packages\botbuilder\core\activity_handler.py", line 384, in on_installation_update
return await self.on_installation_update_add(turn_context)
File "/app\bots\teams_bot.py", line 42, in on_installation_update_add
team_details = await TeamsInfo.get_team_details(turn_context)
File "\env\lib\site-packages\botbuilder\core\teams\teams_info.py", line 120, in get_team_details
teams_connector = await TeamsInfo.get_teams_connector_client(turn_context)
File "\env\lib\site-packages\botbuilder\core\teams\teams_info.py", line 305, in get_teams_connector_client
connector_client = await TeamsInfo._get_connector_client(turn_context)
File "\env\lib\site-packages\botbuilder\core\teams\teams_info.py", line 321, in _get_connector_client
return await turn_context.adapter.create_connector_client(
AttributeError: 'CloudAdapter' object has no attribute 'create_connector_client'

Thanks for having a look

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or an unintended behavior.needs-triageThe issue has just been created and it has not been reviewed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions