Skip to content
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

Bot API 7.4: Stars, effects, etc #2285

Merged
merged 11 commits into from
Jun 1, 2024
Merged

Conversation

coder2020official
Copy link
Collaborator

@coder2020official coder2020official commented May 28, 2024

May 28, 2024
Bot API 7.4

…ndPhoto, sendVideo, sendAnimation, sendAudio, sendDocument, sendSticker, sendVideoNote, sendVoice, sendLocation, sendVenue, sendContact, sendPoll, sendDice, sendInvoice, sendGame, and sendMediaGroup.
…utMediaAnimation, InputMediaPhoto, InputMediaVideo, InlineQueryResultGif, InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo, InlineQueryResultCachedGif, InlineQueryResultCachedMpeg4Gif, InlineQueryResultCachedPhoto, and InlineQueryResultCachedVideo.
…essage, sendPhoto, sendVideo, sendAnimation, sendAudio, sendDocument, sendSticker, sendVideoNote, sendVoice, sendLocation, sendVenue, sendContact, sendPoll, sendDice, sendInvoice, sendGame, and sendMediaGroup.
…ation, sendPhoto, sendVideo, copyMessage, and editMessageCaption.
@coder2020official
Copy link
Collaborator Author

@Badiboy need your opinion on 2 unchecked points, which are related to provider_token
it is made optional only for Telegram Stars; We have to maintain backward compatibility without changing position of parameter. What do you suggest?
I am not sure on whether they accept empty string too. I asked a question from the dev. If so - we could ask users to pass an empty string to use Stars

@coder2020official
Copy link
Collaborator Author

I am sort of done on the rest, though not sure on how correct my implementation was; I might have hurried at some points

@Badiboy
Copy link
Collaborator

Badiboy commented May 28, 2024

Got it, will take a look.

@coder2020official
Copy link
Collaborator Author

Dev said passing empty string for provider_token is fine

@Badiboy
Copy link
Collaborator

Badiboy commented May 28, 2024

Dev said passing empty string for provider_token is fine

image

It is obviously mentioned in announcement )

@coder2020official
Copy link
Collaborator Author

I mean, it says omitted, which would mean not passing provider_token
Dev said we can still pass empty string for provider_token

@Badiboy
Copy link
Collaborator

Badiboy commented May 28, 2024

it says omitted,

It says LEFT EMPTY. Not ommited.

@coder2020official
Copy link
Collaborator Author

Screenshot 2024-05-28 at 6 51 52 PM

@Badiboy
Copy link
Collaborator

Badiboy commented May 28, 2024

Lol, we read different sources )

@coder2020official coder2020official marked this pull request as ready for review May 31, 2024 10:47
@Badiboy
Copy link
Collaborator

Badiboy commented May 31, 2024

image

@coder2020official , could you please clarify, why you used post here?

@Badiboy
Copy link
Collaborator

Badiboy commented May 31, 2024

it is made optional only for Telegram Stars; We have to maintain backward compatibility without changing position of parameter. What do you suggest?

I propose to allow users to pass NONE to this parameter (obviously) and add check
if "provider_token" is not None:
in helper.
This will allow to ommit this parameter in request and keep possibility to send empty string if needed.

telebot/types.py Outdated
@@ -4483,6 +4494,8 @@ def to_dict(self):
json_dict['photo_height'] = self.photo_height
if self.description:
json_dict['description'] = self.description
if self.show_caption_above_media:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if self.show_caption_above_media:
to
if self.show_caption_above_media is not None:

Here and everywhere.

@Badiboy
Copy link
Collaborator

Badiboy commented May 31, 2024

Except "post" question and left comment LGTM.

@coder2020official
Copy link
Collaborator Author

If we make provider_token optional, backward compatibility will be gone

@Badiboy
Copy link
Collaborator

Badiboy commented May 31, 2024

If we make provider_token optional, backward compatibility will be gone

I said nothing about "make optional". I said "allow to pass NONE" :)

@coder2020official
Copy link
Collaborator Author

So I just change API helper as you said? And adjust the provider_token to Union[str, None]?

@Badiboy
Copy link
Collaborator

Badiboy commented May 31, 2024

So I just change API helper as you said? And adjust the provider_token to Union[str, None]?

Yep, I don't see other ways.

@coder2020official
Copy link
Collaborator Author

@Badiboy I think I'm done

@Badiboy Badiboy merged commit 6455bf6 into eternnoir:master Jun 1, 2024
8 checks passed
@Badiboy
Copy link
Collaborator

Badiboy commented Jun 1, 2024

@coder2020official Release?

@coder2020official
Copy link
Collaborator Author

No, there is one issue that needs to be closed before that;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants