-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Effective attachment #766
Effective attachment #766
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 small docstring things, looks good.
telegram/message.py
Outdated
def effective_attachment(self): | ||
""" | ||
Optional[Union[:class:`telegram.Audio`, :class:`telegram.Game`, :class:`telegram.Document`, | ||
:class:`telegram.Photo`, :class:`telegram.Sticker`, :class:`telegram.Video`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
telegram.Photo does not exists. Should be List[:class:`telegram.PhotoSize`]
telegram/message.py
Outdated
:class:`telegram.Voice`, :class:`telegram.VideoNote`, :class:`telegram.Contact`, | ||
:class:`telegram.Location`, :class:`telegram.Venue`, :class:`telegram.Invoice`, | ||
:class:`telegram.SuccessfulPayment`]]: The attachment that this message was sent with. May | ||
be ``None`` if no attachment was sent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space too much at start of line, makes weird docs.
telegram/message.py
Outdated
@property | ||
def effective_attachment(self): | ||
""" | ||
Optional[Union[:class:`telegram.Audio`, :class:`telegram.Game`, :class:`telegram.Document`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be:
:class:`telegram.Audio` | :class:`telegram.Game` | :class:`telegram.Document` [...]
I'm not sure our sphinx parser understands the optional and union very well
Edit:
After testing it, it understands neither, so something like below might be clearest actually:
:class:`telegram.Audio` or :class:`telegram.Game` or :class:`telegram.Document` or
:class:`telegram.Photo` or :class:`telegram.Sticker` or :class:`telegram.Video` or
:class:`telegram.Voice` or :class:`telegram.VideoNote` or :class:`telegram.Contact` or
:class:`telegram.Location` or :class:`telegram.Venue` or :class:`telegram.Invoice` or
:class:`telegram.SuccessfulPayment`: The attachment that this message was
sent with. May be ``None`` if no attachment was sent.
I thought I had put this here, but apparently I only mentioned it in chat. photo is of type List[:class:'telegram.PhotoSize'] and I would like it visually better if the possible attachments would be listed in alphabetical order. |
[ci skip]
No description provided.