telegram.ChatJoinRequest¶
-
class
telegram.
ChatJoinRequest
(chat, from_user, date, bio=None, invite_link=None, bot=None, **_kwargs)¶ Bases:
telegram.base.TelegramObject
This object represents a join request sent to a chat.
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
chat
,from_user
anddate
are equal.Note
Since Bot API 5.5, bots are allowed to contact users who sent a join request to a chat where the bot is an administrator with the
can_invite_users
administrator right – even if the user never interacted with the bot before.New in version 13.8.
- Parameters
chat (
telegram.Chat
) – Chat to which the request was sent.from_user (
telegram.User
) – User that sent the join request.date (
datetime.datetime
) – Date the request was sent.bio (
str
, optional) – Bio of the user.invite_link (
telegram.ChatInviteLink
, optional) – Chat invite link that was used by the user to send the join request.bot (
telegram.Bot
, optional) – The Bot to use for instance methods.
-
chat
¶ Chat to which the request was sent.
- Type
-
from_user
¶ User that sent the join request.
- Type
-
date
¶ Date the request was sent.
- Type
datetime.datetime
-
bio
¶ Optional. Bio of the user.
- Type
str
-
invite_link
¶ Optional. Chat invite link that was used by the user to send the join request.
-
approve
(timeout=None, api_kwargs=None)¶ Shortcut for:
bot.approve_chat_join_request(chat_id=update.effective_chat.id, user_id=update.effective_user.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.approve_chat_join_request()
.- Returns
On success,
True
is returned.- Return type
bool
-
classmethod
de_json
(data, bot)¶
-
decline
(timeout=None, api_kwargs=None)¶ Shortcut for:
bot.decline_chat_join_request(chat_id=update.effective_chat.id, user_id=update.effective_user.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.decline_chat_join_request()
.- Returns
On success,
True
is returned.- Return type
bool
-
to_dict
()¶