errbot icon indicating copy to clipboard operation
errbot copied to clipboard

SlackRoom' object has no attribute '_channel_info

Open Salem249 opened this issue 4 years ago • 1 comments

I am...

  • [ ] Reporting a bug
  • [ ] Suggesting a new feature
  • [x] Requesting help with running my bot
  • [ ] Requesting help writing plugins
  • [ ] Here about something else

I am running...

  • Errbot version:6.1.8
  • OS version: hub.docker.com/python:3.9-slim-buster
  • Python version: 3.9
  • Using a virtual environment: yes (docker)

Issue description

I used to get slack channel members by using members = self.query_room(message.frm.channelname)._channel_info["members"] But now I got the following error 'SlackRoom' object has no attribute '_channel_info'

Additional info

We updated errbot to 6.1.7 from 6.1.1 also we start using skackv3 so this might be the issue. can someone please show me the new way of getting slack channel members?

Salem249 avatar Nov 04 '21 11:11 Salem249

_channel_info is a private member of the Room class. Accessing this variable from outside the class is bad form because it breaks the encapsulation principle. There is a property occupants defined that returns the list of members.

members = self.query_room(message.frm.channelname).occupants

As a side note, channel_info has been deprecated by Slack.

nzlosh avatar Nov 04 '21 12:11 nzlosh