-
Notifications
You must be signed in to change notification settings - Fork 6k
Add VideoNote #625
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
Add VideoNote #625
Conversation
This deprecation is totally gonna come back and bite us when the regexp gets removed completely in never version´
tsnoam
left a comment
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.
See comments on code.
| long. Use this method to send video messages | ||
| Args: | ||
| chat_id (int|str): Unique identifier for the message recipient - Chat id. |
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.
s/voice/vide_note/
type: InputFile|str
| url = '{0}/sendVideoNote'.format(self.base_url) | ||
|
|
||
| data = {'chat_id': chat_id, 'video_note': video_note} | ||
|
|
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.
if duration is not None
(and same for length below)
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.
Sure? We don't do that anywhere else in bot.py?
telegram/inputfile.py
Outdated
| self.input_file = data.pop('certificate') | ||
| elif 'video_note' in data: | ||
| self.input_name = 'video_note' | ||
| self.input_file = data.pop('video_note') |
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.
I wonder - we have a lot of branching here. Should we move to a dict here? It's much more pythonic.
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.
Not sure what you meant.. does this work?
telegram/inputfile.py
Outdated
| ]) | ||
|
|
||
| # Add input_file to upload | ||
| # Add input_file to upload |
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.
Please return the leading indentation
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.
Right, danm yapf
telegram/message.py
Outdated
| sticker=None, | ||
| video=None, | ||
| voice=None, | ||
| video_note=None, |
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.
Same note like I left on #628 - should new parameters be added in the middle or in the end of the function?
refs #617
This is where it gets weird....
According to telegram length is Video width and height.. but how that works with one parameter I couldn't tell you.. it also seems to be required but is not marked as such in the documentation....