Skip to content

Conversation

@All-The-Foxes
Copy link
Contributor

@All-The-Foxes All-The-Foxes commented Jul 24, 2025

Description

Set func=None as default for the inline handler. and clean up whitespace.

Describe your tests

This should not break anything, it falls in line with the way the other handlers are written to default func to None when no filter is required.

Python version:
3.13

OS:
Ubuntu 24.04

Checklist:

  • I added/edited example on new feature/change (if exists)
  • My changes won't break backward compatibility
  • I made changes both for sync and async

@All-The-Foxes All-The-Foxes force-pushed the inline_handler_update branch from 2870596 to dd3626f Compare August 22, 2025 17:27
@All-The-Foxes
Copy link
Contributor Author

types.py had option_ids for the class PollAnswer marked as optional, but they are not. That has been fixed.

@All-The-Foxes
Copy link
Contributor Author

types.py is the version taken from the master branch. The only changes are the removal of trailing whitespace and option_ids for the class PollAnswer which were marked as optional when they are not.

@Badiboy
Copy link
Collaborator

Badiboy commented Aug 22, 2025

Too much changes caused by whitespaces, so too hard to review.

Please, tag lines of valuable changes or highlight it in other way to make review possible.

@Badiboy Badiboy requested a review from Copilot August 22, 2025 20:27

This comment was marked as outdated.

Co-authored-by: Copilot <[email protected]>
@All-The-Foxes
Copy link
Contributor Author

line 7405 in types (now corrected, accidentally left the brackets after removing optional)
line 8692 in init
line 1624 in async_telebot

@Badiboy
Copy link
Collaborator

Badiboy commented Aug 28, 2025

line 7405 in types (now corrected, accidentally left the brackets after removing optional)
line 8692 in init
line 1624 in async_telebot

I confirm this changes.

could you please resolve conflicts and it will be merged.

@All-The-Foxes
Copy link
Contributor Author

Resolved.

@Badiboy Badiboy requested a review from Copilot August 30, 2025 07:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR sets the default value of the func parameter to None in the inline_handler method for both sync and async versions of the telebot library. Additionally, it includes minor whitespace cleanup in comments and removes trailing blank lines.

  • Sets func=None as default parameter in inline_handler methods
  • Cleans up documentation formatting and removes extra whitespace
  • Updates type annotation for option_ids to remove Optional wrapper

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
telebot/init.py Updates inline_handler method signature to default func to None
telebot/async_telebot.py Updates async inline_handler method signature and removes trailing whitespace
telebot/types.py Fixes documentation formatting and updates type annotation for option_ids

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 7477 to +7480
def __init__(self, poll_id: str, option_ids: List[int], user: Optional[User] = None, voter_chat: Optional[Chat] = None, **kwargs):
self.poll_id: str = poll_id
self.user: Optional[User] = user
self.option_ids: Optional[List[int]] = option_ids
self.option_ids: List[int] = option_ids
Copy link

Copilot AI Aug 30, 2025

Choose a reason for hiding this comment

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

The type annotation change from Optional[List[int]] to List[int] represents a breaking change to the API. The parameter option_ids can be an empty list when a user retracts their vote (as mentioned in the documentation), but removing the Optional wrapper suggests it can never be None. If None was previously a valid value, this change could break existing code that passes None.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ignore )

@Badiboy
Copy link
Collaborator

Badiboy commented Aug 30, 2025

Thank you!

@Badiboy Badiboy merged commit a3da5e9 into eternnoir:master Aug 30, 2025
7 checks passed
@All-The-Foxes All-The-Foxes deleted the inline_handler_update branch August 30, 2025 07:23
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