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

channel created and info about channel #21

Closed
abdoljabbar opened this issue Sep 5, 2016 · 2 comments
Closed

channel created and info about channel #21

abdoljabbar opened this issue Sep 5, 2016 · 2 comments

Comments

@abdoljabbar
Copy link

hi.tnx in advance for ur amazing telebot.
in message event we have 'channelCreated' event.i think that it doesn't work properly.what is that and how to use it.
suppose my bot added to channel how can i access to their info like admin user, membercount, title,...
how can i authorize admin user of channel send pv to me.

@kosmodrey
Copy link
Contributor

Hello!

Event channelCreated is triggered when bot is joined to a new channel. From this event you can get only chat id, title and group type: chat: { id: -113839907, title: 'test2', type: 'group' }. To get full channel details use getChat(<chat_id>) method.

To get chat administrators - getAdmins(<chat_id>) and for members - countMembers(<chat_id>)

@abdoljabbar
Copy link
Author

abdoljabbar commented Sep 8, 2016

channelCreated not triggered for me, but i found another way to get channel info and therefor get channel admin.
it's simple just replace chat id with channel id that start with @.
getChat(@channel_id) for channel info
and getAdmin(@channel_id) for it's admin
tnx

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