@@ -28,6 +28,7 @@ about its business.
2828* :py:class: `~botogram.Voice `
2929* :py:class: `~botogram.Contact `
3030* :py:class: `~botogram.Location `
31+ * :py:class: `~botogram.Permissions `
3132* :py:class: `~botogram.Venue `
3233* :py:class: `~botogram.Update `
3334* :py:class: `~botogram.UserProfilePhotos `
@@ -70,6 +71,13 @@ about its business.
7071 change :py:attr: `~botogram.User.first_name ` or
7172 :py:attr: `~botogram.User.last_name `.
7273
74+ .. py :attribute :: is_bot
75+
76+ is_bot indicates if the user is a bot. due to the telegram privacy rules,
77+ this can be true only when your bot can actually see other bots' messages.
78+
79+
80+
7381 .. versionadded :: 0.2
7482
7583 .. py :attribute :: avatar
@@ -497,6 +505,42 @@ about its business.
497505
498506 *This attribute can be None if it's not provided by Telegram. *
499507
508+ .. py :attribute :: all_members_are_administrators
509+
510+ This attribute is True if all the members of the group are administrator.
511+
512+ *This attribute can be None if it's not provided by Telegram. *
513+
514+ .. py :attribute :: description
515+
516+ The group/channel description
517+
518+ *This attribute can be None if it's not provided by Telegram. *
519+
520+ .. py :attribute :: invite_link
521+
522+ This group chat/channel invite link.
523+
524+ *This attribute can be None if it's not provided by Telegram. *
525+
526+ .. py :attribute :: pinned_message
527+
528+ This group/chat pinned :py:class: `~botogram.Message `
529+
530+ *This attribute can be None if it's not provided by Telegram. *
531+
532+ .. py :attribute :: sticker_set_name
533+
534+ The name of the supergroup's sticker set.
535+
536+ *This attribute can be None if it's not provided by Telegram. *
537+
538+ .. py :attribute :: can_set_sticker_set
539+
540+ This attribute is True if the bot can set this supergroup's sticker set.
541+
542+ *This attribute can be None if it's not provided by Telegram. *
543+
500544 .. py :attribute :: name
501545
502546 The computed name of the chat. If this chat has a title this attribute
@@ -709,6 +753,47 @@ about its business.
709753
710754 .. versionadded :: 0.3
711755
756+ .. py :method :: kick(user[, time=None ])
757+
758+ Kick the user form this group chat.
759+
760+ Remember your bot must be an administrator of the chat in order for this method to work properly.
761+
762+ :param int user: The user you want to kick (user ID or
763+ :py:class: `~botogram.User `)
764+
765+ :param int time: until the user can't enter in the chat (unix time or
766+ datetime format)
767+
768+ .. py :method :: permissions(user)
769+
770+ Retrieve or edit the permissions of the provided user in the current group. This method returns an instance of
771+ :py:class: `~botogram.Permissions `
772+
773+ .. code-block :: python
774+
775+ from datetime import datetime as dt, timedelta
776+ @bot.command (" limit" )
777+ def limit_user (chat , message ):
778+ # Allow only groups
779+ if chat.type not in (" group" , " supergroup" ):
780+ return
781+
782+ # Allow only replies with text in the reply
783+ if message.text is None or message.reply_to_message is None :
784+ return
785+
786+ # Allow only admins to limit people
787+ if message.sender not in chat.admins:
788+ return
789+ with chat.permissions(message.reply_to_message.sender) as perms:
790+ perms.send_messages = False
791+ perms.until_date = dt.now() + timedelta(minutes = 10 )
792+
793+ :param int user: The user you want to change permissions (user ID or :py:class: `~botogram.User `)
794+ :returns: The class to edit permissions
795+ :rtype: :py:class: `~botogram.Permissions `
796+
712797 .. py :method :: send(message, [preview=True , reply_to=None , syntax=None , attach=None , extra=None , notify=True ])
713798
714799 Send the textual *message * to the chat. You may optionally stop clients
@@ -1176,7 +1261,7 @@ about its business.
11761261 This class represents messages received by and sent from your bot. Messages
11771262 serve as a container for many of the core API objects described here.
11781263
1179- .. py :attribute :: message_id
1264+ .. py :attribute :: id
11801265
11811266 The integer ID of the message.
11821267
@@ -2164,6 +2249,39 @@ about its business.
21642249 The float latitude as defined by the sender.
21652250
21662251
2252+ .. py :class :: botogram.Permissions
2253+
2254+ This class represents the permissions of the user.
2255+ If you use this as a context manager, the save method will automatically be called if no exceptions were raised."
2256+ [example with only the context manager, not the full handler]
2257+
2258+ .. py :attribute :: until_date
2259+
2260+ The unix timestamp or datime format of when the changes you're doing will be reverted.
2261+
2262+ .. py :attribute :: send_messages
2263+
2264+ The boolean value if the user can send messages.
2265+
2266+ .. py :attribute :: send_media_messages
2267+
2268+ The boolean value if the user can send media messages.
2269+
2270+ .. py :attribute :: send_other_messages
2271+
2272+ The boolean value if the user can send other messages.
2273+
2274+ .. py :attribute :: add_web_page_previews
2275+
2276+ The boolean value if the user can send web page previews.
2277+
2278+ .. py :method :: save()
2279+
2280+ Send the changes to Telegram.
2281+
2282+ This method automatically detects the changes you made and doesn't do anything if no attribute was changed.
2283+
2284+
21672285.. py :class :: botogram.Venue
21682286
21692287 This object represents a venue (a location with attached a title and an
0 commit comments