Skip to content
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

Members of current channel #185

Open
Johboh opened this issue May 19, 2019 · 2 comments
Open

Members of current channel #185

Johboh opened this issue May 19, 2019 · 2 comments

Comments

@Johboh
Copy link

Johboh commented May 19, 2019

Hi!
How can I get the members of the current channel that the bot is replying/reacting in?

message.channel._client.channels[message.body['channel']] have members field, but that one only contains one member and that is the bot itself, even when there are more users in the channel.

message.channel._client.users returns ALL users in the organization.

The use case is to do an eightball bot, like:
@bot Should I go home or stay?
I dunno, but maybe <usernname> knows!

But I only want to pick users that are in the channel where the question is asked.

//Johan

@kiaka010
Copy link

Have you tried accessing
message._client.webapi.groups.info(channel='GXXXXXXXX') for private channels and
message._client.webapi.channels.info(channel='CXXXXXXXX') for public channels
you know a channel is Private if it starts with G and public starts with C

@Johboh
Copy link
Author

Johboh commented May 26, 2019

Thanks! I will give it a try.

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

No branches or pull requests

2 participants