Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from Harshil
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
  • Loading branch information
Poolitzer and harshil21 authored Jun 26, 2022
commit bd85e45ed058510da78d2c303f970531fc3a35a6
4 changes: 2 additions & 2 deletions telegram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3089,7 +3089,7 @@ def set_webhook(
Telegram will give up after a reasonable amount of attempts.

If you'd like to make sure that the Webhook was set by you, you can specify secret data in
the parameter :paramref:`secret_token`. If specified, the request will contain a header
the parameter ``secret_token``. If specified, the request will contain a header
``X-Telegram-Bot-Api-Secret-Token`` with the secret token as content.

Note:
Expand Down Expand Up @@ -5954,7 +5954,7 @@ def create_invoice_link(
.. versionadded:: 13.13

Args:
title (:obj:`str`): Product name. :tg-const:`telegram.Invoice.MIN_TITLE_LENGTH`-
title (:obj:`str`): Product name. :attr:`telegram.Invoice.MIN_TITLE_LENGTH`-
:tg-const:`telegram.Invoice.MAX_TITLE_LENGTH` characters.
description (:obj:`str`): Product description.
:tg-const:`telegram.Invoice.MIN_DESCRIPTION_LENGTH`-
Expand Down
8 changes: 5 additions & 3 deletions telegram/ext/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,13 +1006,14 @@ def filter(self, message: Message) -> bool:

class _UserAttachment(UpdateFilter):
__slots__ = ()
name = "Filters.user_attachment"

Comment thread
Poolitzer marked this conversation as resolved.
def filter(self, update: Update) -> bool:
return bool(update.effective_user) and bool(
update.effective_user.added_to_attachment_menu
)

user_attachment = _UserAttachment(name="filters.USER_ATTACHMENT")
user_attachment = _UserAttachment()
"""This filter filters *any* message that have a user who added the bot to their
:attr:`attachment menu <telegram.User.added_to_attachment_menu>` as
:attr:`telegram.Update.effective_user`.
Expand All @@ -1022,12 +1023,13 @@ def filter(self, update: Update) -> bool:

class _UserPremium(UpdateFilter):
__slots__ = ()
name = "Filters.premium_user"

Comment thread
Poolitzer marked this conversation as resolved.
def filter(self, update: Update) -> bool:
return bool(update.effective_user) and bool(update.effective_user.is_premium)

premium_user = _UserPremium(name="filters.PREMIUM_USER")
"""This filter filters *any* message that has a
premium_user = _UserPremium()
"""This filter filters *any* message from a
:attr:`Telegram Premium user <telegram.User.is_premium>` as
:attr:`telegram.Update.effective_user`.

Expand Down