Skip to content

Where did the ability to set announcement mode and moderated mode go from 1.6 to 2.0.1?  #244

Closed

Description

@nugsolot

After upgrading to 1.7 from 1.6 i can no longer create a room with the setting isAnnouncemeanOnly: true

E AttributeError: 'Room' object has no attribute 'isAnnouncementOnly'

from webexteamssdk import WebexTeamsAPI, ApiError

    def __init__(self, access_token)
        self.api = WebexTeamsAPI(access_token)

........


        try:
            # Create the room first
            room = self.api.rooms.create(title=room_name,
                                         teamId=team_id,
                                         isLocked=True,
                                         isAnnouncementOnly=True
                                         )
                                         

Is there a new way to do this or just a bug?

Activity

  1. nugsolot commented on Oct 24, 2024

    @nugsolot
    Author

    more context

    I have upgraded it all the way to 2.0.1 after realizing the versioning was not getting the latest due to older pip

    I then changed refereces to newly named package name

    from webexpythonsdk import WebexAPI, ApiError
    
    
    class IoWebexTeams:
        def __init__(self, access_token):
            self.api = WebexAPI(access_token)
    

    Even trying to create a moderated room doesnt work for me know

    where it worked prior to upgrading so i know this isnt a a perms thing

    I do not get an error when i create a room like this which i based off your test you have for creating a moderated room:

    def test_init():
        # Initialize the WebExTeamsConnector
        wxt = IoWebexTeams(bot_token)
        logging.debug(f"Bot ID: {wxt.api.people.me()}")
    
        room = wxt.api.rooms.create(
            title="Moderated Group Room",
            teamId=test_team_id,
            isLocked=True,
        )
    
        logging.info(f"Room: {room}")
        ```
    
    My Result from that:
    INFO     root:test_iowebex.py:43 Room: Webex Room:
    {
      "id": "REMOVED",
      "title": "Moderated Group Room",
      "type": "group",
      "isLocked": false,
      "lastActivity": "2024-10-24T12:20:53.067Z",
      "teamId": "REMOVED",
      "creatorId": "REMOVED",
      "created": "2024-10-24T12:20:53.067Z",
      "ownerId": "REMOVED",
      "isPublic": false
    }
    

    here is my current pip list info for this:

    % pip list | grep webex
    webexpythonsdk            2.0.1
    
  2. changed the title [-]Where did the ability to set announcement mode go from 1.6 to 1.7? [/-] [+]Where did the ability to set announcement mode go from 1.6 to 2.0.1? [/+] on Oct 24, 2024
  3. changed the title [-]Where did the ability to set announcement mode go from 1.6 to 2.0.1? [/-] [+]Where did the ability to set announcement mode and moderated mode go from 1.6 to 2.0.1? [/+] on Oct 24, 2024
  4. nugsolot commented on Oct 24, 2024

    @nugsolot
    Author

    I added an output of the post data here to see if it was being added to the call and it seems that maybe something is happening with adding things in the request dictionary to the call?

       check_type(title, str)
        check_type(teamId, str, optional=True)
        check_type(classificationId, str, optional=True)
        check_type(isLocked, bool, optional=True)
        check_type(isPublic, bool, optional=True)
        check_type(description, str, optional=True)
        check_type(isAnnouncementOnly, bool, optional=True)
    
        post_data = dict_from_items_with_values(
            request_parameters,
            title=title,
            teamId=teamId,
        )
    
        **logging.info(f"Creating Room: {title}: Post Data: {post_data}")**
        
        # API request
        json_data = self._session.post(API_ENDPOINT, json=post_data)
    

    my output after adding that logging line:
    INFO root:rooms.py:182 Creating Room: Moderated Group Room: Post Data: {'title': 'Moderated Group Room', 'teamId': 'REMOVED'}

    Doesnt seem to have the optiong i used whn calling for the room to be created isLocked=True in there.

  5. self-assigned this
    on Nov 2, 2024
  6. cmlccie commented on Nov 2, 2024

    @cmlccie
    Collaborator

    Hi @nugsolot, thank you for reporting this! It looks like I missed this when adding these arguments to the rooms.create().

    I have submitted a fix for this issue in PR #246. As soon as the team has a chance to review the PR, we'll get it merged and released.

  7. added a commit that references this issue on Jan 8, 2025
    e851508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions