pyropy / fastapi-socketio

Easily integrate socket.io with your FastAPI app 🚀
Apache License 2.0
328 stars 31 forks source link

enter_room and leave_room don't work #24

Closed Roxe322 closed 2 years ago

Roxe322 commented 2 years ago

Hello! In https://github.com/pyropy/fastapi-socketio/pull/20 you added ability to join and leave rooms, but you made it as properties so when you call sio.enter_room(sid, room)

it results to

TypeError: enter_room() missing 2 required positional arguments: 'sid' and 'room'

It should be not properties but methods.

Roxe322 commented 2 years ago

Otherwise, it could be just proxy-properties, without any params:

    @property
    def enter_room(self):
        return self._sio.enter_room

    @property
    def leave_room(self):
        return self._sio.leave_room
Roxe322 commented 2 years ago

So I made a pull request: https://github.com/pyropy/fastapi-socketio/pull/25