Skip to content

Commit

Permalink
Add some comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
eternnoir committed Jun 7, 2016
1 parent 5bd8e9d commit cdb6d67
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,25 +295,53 @@ def get_user_profile_photos(self, user_id, offset=None, limit=None):
return types.UserProfilePhotos.de_json(result)

def get_chat(self, chat_id):
"""
Use this method to get up to date information about the chat (current name of the user for one-on-one
conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
:param chat_id:
:return:
"""
result = apihelper.get_chat(self.token, chat_id)
return types.Chat.de_json(result)

def leave_chat(self, chat_id):
"""
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
:param chat_id:
:return:
"""
result = apihelper.leave_chat(self.token, chat_id)
return result

def get_chat_administrators(self, chat_id):
"""
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects
that contains information about all chat administrators except other bots.
:param chat_id:
:return:
"""
result = apihelper.get_chat_administrators(self.token, chat_id)
ret = []
for r in result:
ret.append(types.ChatMember.de_json(r))
return ret

def get_chat_members_count(self, chat_id):
"""
Use this method to get the number of members in a chat. Returns Int on success.
:param chat_id:
:return:
"""
result = apihelper.get_chat_members_count(self.token, chat_id)
return result

def get_chat_member(self, chat_id, user_id):
"""
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
:param chat_id:
:param user_id:
:return:
"""
result = apihelper.get_chat_member(self.token, chat_id, user_id)
return types.ChatMember.de_json(result)

Expand Down

0 comments on commit cdb6d67

Please sign in to comment.