Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nugsolot opened this issue Oct 23, 2024 · 3 comments · Fixed by #246
Closed
Assignees
Labels

Comments

@nugsolot
Copy link

nugsolot commented Oct 23, 2024

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?

@nugsolot
Copy link
Author

nugsolot commented Oct 24, 2024

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

@nugsolot nugsolot 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? Oct 24, 2024
@nugsolot nugsolot 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? Oct 24, 2024
@nugsolot
Copy link
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.

@cmlccie
Copy link
Collaborator

cmlccie commented Nov 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants