errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.12k stars 614 forks source link

SlackRoom' object has no attribute '_channel_info #1544

Closed Salem249 closed 8 months ago

Salem249 commented 2 years ago

I am...

I am running...

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?

nzlosh commented 2 years ago

_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.