Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Full Support for Bot API 8.1#4594

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Bibo-Joshi merged 10 commits intomasterfrombot-api-8.1
Dec 7, 2024
Merged

Full Support for Bot API 8.1#4594

Bibo-Joshi merged 10 commits intomasterfrombot-api-8.1
Dec 7, 2024

Conversation

Bibo-Joshi
Copy link
Member

closes#4592

  • Added.. versionadded:: NEXT.VERSION,.. versionchanged:: NEXT.VERSION,.. deprecated:: NEXT.VERSION or.. versionremoved:: NEXT.VERSION to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
  • Created new or adapted existing unit tests
  • Documented code changes according to theCSI standard_
  • Added myself alphabetically toAUTHORS.rst (optional)
  • Added new classes & modules to the docs and all suitable__all__ s
  • Checked theStability Policy in case of deprecations or changes to documented behavior
  • Check the diff files inthis channel for documentation updates

If the PR contains API changes (otherwise, you can ignore this passage)

  • Checked the Bot API specific sections of theStability Policy

  • Created a PR to remove functionality deprecated in the previous Bot API release (see here)

  • New classes:

    • Addedself._id_attrs and corresponding documentation
    • __init__ acceptsapi_kwargs as kw-only
  • Added new shortcuts:

    • Intelegram.Chat &telegram.User for all methods that acceptchat/user_id
    • Intelegram.Message for all methods that acceptchat_id andmessage_id
    • For newtelegram.Message shortcuts: Addedquote argument if methods acceptsreply_to_message_id
    • Intelegram.CallbackQuery for all methods that accept eitherchat_id andmessage_id orinline_message_id
  • If relevant:

    • Added new constants attelegram.constants and shortcuts to them as class variables

    • Link new and existing constants in docstrings instead of hard-coded numbers and strings

    • Add new message types totelegram.Message.effective_attachment

    • Added new handlers for new update types

      • Add the handlers to the warning loop in thetelegram.ext.ConversationHandler
    • Added new filters for new message (sub)types

    • Added or updated documentation for the changed class(es) and/or method(s)

    • Added the new method(s) to_extbot.py

    • Added or updatedbot_methods.rst

    • Updated the Bot API version number in all places:README.rst (including the badge) andtelegram.constants.BOT_API_VERSION_INFO

    • Added logic for arbitrary callback data intelegram.ext.ExtBot for new methods that either accept areply_markup in some form or have a return type that is/containstelegram.Message

@Bibo-JoshiBibo-Joshi added ⚙️ bot-apiaffected functionality: bot-api 🔌 enhancementpr description: enhancement labelsDec 5, 2024
@codecovCodecov
Copy link

codecovbot commentedDec 5, 2024
edited
Loading

❌ 1 Tests Failed:

Tests completedFailedPassedSkipped
636416363452
View the top 1 failed tests by shortest run time
tests.ext.test_updater.TestUpdater::test_webhook_arbitrary_callback_data[invaliddata]
Stack Traces | 0.003s run time
self=<tests.ext.test_updater.TestUpdaterobjectat0x000001BD6F826080>monkeypatch=<_pytest.monkeypatch.MonkeyPatchobjectat0x000001BD72346050>cdc_bot=PytestExtBot[token=695104088:AAHfzylIOjSIIS-eOnI20y2E20HodHsfz-0]invalid_data=True,chat_id='675666224'@pytest.mark.parametrize("invalid_data", [True,False],ids=("invalid data","valid data"))asyncdeftest_webhook_arbitrary_callback_data(self,monkeypatch,cdc_bot,invalid_data,chat_id    ):"""Here we only test one simple setup. telegram.ext.ExtBot.insert_callback_data is tested        extensively in test_bot.py in conjunction with get_updates."""updater=Updater(bot=cdc_bot,update_queue=asyncio.Queue())monkeypatch.setattr(updater.bot,"set_webhook",return_true)try:ip="127.0.0.1"port=randrange(1024,49152)# Select random portasyncwithupdater:>awaitupdater.start_webhook(ip,port,url_path="TOKEN")tests\ext\test_updater.py:980:__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _telegram\ext\_updater.py:601:instart_webhookawaitself._start_webhook(telegram\ext\_updater.py:693:in_start_webhookawaitself._httpd.serve_forever(ready=ready)telegram\ext\_utils\webhookhandler.py:92:inserve_foreverself._http_server.listen(self.port,address=self.listen)C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\tornado\tcpserver.py:183:inlistensockets=bind_sockets(__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _port=5986,address='127.0.0.1',family=<AddressFamily.AF_UNSPEC:0>backlog=128,flags=<AddressInfo.AI_PASSIVE:1>,reuse_port=Falsedefbind_sockets(port:int,address:Optional[str]=None,family:socket.AddressFamily=socket.AF_UNSPEC,backlog:int=_DEFAULT_BACKLOG,flags:Optional[int]=None,reuse_port:bool=False,    )->List[socket.socket]:"""Creates listening sockets bound to the given port and address.        Returns a list of socket objects (multiple sockets are returned if        the given address maps to multiple IP addresses, which is most common        for mixed IPv4 and IPv6 use).        Address may be either an IP address or hostname.  If it's a hostname,        the server will listen on all IP addresses associated with the        name.  Address may be an empty string or None to listen on all        available interfaces.  Family may be set to either `socket.AF_INET`        or `socket.AF_INET6` to restrict to IPv4 or IPv6 addresses, otherwise        both will be used if available.        The ``backlog`` argument has the same meaning as for        `socket.listen() <socket.socket.listen>`.        ``flags`` is a bitmask of AI_* flags to `~socket.getaddrinfo`, like        ``socket.AI_PASSIVE | socket.AI_NUMERICHOST``.        ``reuse_port`` option sets ``SO_REUSEPORT`` option for every socket        in the list. If your platform doesn't support this option ValueError will        be raised.        """ifreuse_portandnothasattr(socket,"SO_REUSEPORT"):raiseValueError("the platform doesn't support SO_REUSEPORT")sockets= []ifaddress=="":address=Noneifnotsocket.has_ipv6andfamily==socket.AF_UNSPEC:# Python can be compiled with --disable-ipv6, which causes# operations on AF_INET6 sockets to fail, but does not# automatically exclude those results from getaddrinfo# results.# http://bugs.python.org/issue16208family=socket.AF_INETifflagsisNone:flags=socket.AI_PASSIVEbound_port=Noneunique_addresses=set()# type: setforresinsorted(socket.getaddrinfo(address,port,family,socket.SOCK_STREAM,0,flags),key=lambdax:x[0],        ):ifresinunique_addresses:continueunique_addresses.add(res)af,socktype,proto,canonname,sockaddr=resif (sys.platform=="darwin"andaddress=="localhost"andaf==socket.AF_INET6andsockaddr[3]!=0# type: ignore            ):# Mac OS X includes a link-local address fe80::1%lo0 in the# getaddrinfo results for 'localhost'.  However, the firewall# doesn't understand that this is a local address and will# prompt for access (often repeatedly, due to an apparent# bug in its ability to remember granting access to an# application). Skip these addresses.continuetry:sock=socket.socket(af,socktype,proto)exceptsocket.errorase:iferrno_from_exception(e)==errno.EAFNOSUPPORT:continueraiseifos.name!="nt":try:sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)exceptsocket.errorase:iferrno_from_exception(e)!=errno.ENOPROTOOPT:# Hurd doesn't support SO_REUSEADDR.raiseifreuse_port:sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEPORT,1)ifaf==socket.AF_INET6:# On linux, ipv6 sockets accept ipv4 too by default,# but this makes it impossible to bind to both# 0.0.0.0 in ipv4 and :: in ipv6.  On other systems,# separate sockets *must* be used to listen for both ipv4# and ipv6.  For consistency, always disable ipv4 on our# ipv6 sockets and use a separate ipv4 socket when needed.## Python 2.x on windows doesn't have IPPROTO_IPV6.ifhasattr(socket,"IPPROTO_IPV6"):sock.setsockopt(socket.IPPROTO_IPV6,socket.IPV6_V6ONLY,1)# automatic port allocation with port=None# should bind on the same port on IPv4 and IPv6host,requested_port=sockaddr[:2]ifrequested_port==0andbound_portisnotNone:sockaddr=tuple([host,bound_port]+list(sockaddr[2:]))sock.setblocking(False)try:>sock.bind(sockaddr)EPermissionError: [WinError10013]AnattemptwasmadetoaccessasocketinawayforbiddenbyitsaccesspermissionsC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\tornado\netutil.py:162:PermissionError

To view more test analytics, go to theTest Analytics Dashboard
📢 Thoughts on this report?Let us know!

Copy link
Member

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

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

just some doc fixes :)

Bibo-Joshi reacted with rocket emoji
@Bibo-JoshiBibo-Joshi merged commit4327954 intomasterDec 7, 2024
24 checks passed
@Bibo-JoshiBibo-Joshi deleted the bot-api-8.1 branchDecember 7, 2024 09:20
cuevasrja pushed a commit to USB-CI3715/python-telegram-bot that referenced this pull requestDec 9, 2024
cuevasrja added a commit to USB-CI3715/python-telegram-bot that referenced this pull requestDec 13, 2024
…cia entre módulos (#1)* Refactor datetime imports to use alias for consistency* Refactor datetime imports to use alias for consistency across modules* Refactor datetime imports to use alias for consistency in ChatMemberUpdated, Giveaway, Message, MessageOrigin modules* Refactor datetime imports to use alias for consistency in ChatJoinRequest and ChatMember modules* Full Support for Bot API 8.0 (python-telegram-bot#4566,python-telegram-bot#4568,python-telegram-bot#4570,python-telegram-bot#4571,python-telegram-bot#4574,python-telegram-bot#4576,python-telegram-bot#4572)* Documentation Improvements (python-telegram-bot#4573,python-telegram-bot#4565)Co-authored-by: Snehashish Biswas <coderrx06@gmail.com>Co-authored-by: poolitzer <github@poolitzer.eu>* Bump Version to v21.8 (python-telegram-bot#4583)* Bump `srvaroa/labeler` from 1.11.1 to 1.12.0 (python-telegram-bot#4586)Signed-off-by: dependabot[bot] <support@github.com>Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>* Bump `pylint` to v3.3.2 to Improve Python 3.13 Support (python-telegram-bot#4590)* Bump `codecov/codecov-action` from 4 to 5 (python-telegram-bot#4585)Signed-off-by: dependabot[bot] <support@github.com>Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>* Allow `Sequence` Input for `allowed_updates` in `Application` and `Updater` Methods (python-telegram-bot#4589)* Full Support for Bot API 8.1 (python-telegram-bot#4594)* Use `MessageLimit.DEEP_LINK_LENGTH` in `helpers.create_deep_linked_url` (python-telegram-bot#4597)* Bump `pytest` from 8.3.3 to 8.3.4 (python-telegram-bot#4596)Signed-off-by: dependabot[bot] <support@github.com>Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>* Update `aiolimiter` requirement from ~=1.1.0 to >=1.1,<1.3 (python-telegram-bot#4595)Signed-off-by: dependabot[bot] <support@github.com>Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>* Bump Version to v21.9 (python-telegram-bot#4601)* Reorder imports to unify `datetime`  usage across modules---------Signed-off-by: dependabot[bot] <support@github.com>Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>Co-authored-by: Snehashish Biswas <coderrx06@gmail.com>Co-authored-by: poolitzer <github@poolitzer.eu>Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Co-authored-by: Luis Pérez <luis.i.perez.0@gmail.com>Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>Co-authored-by: Juan Andrés Cuevas <juanandrescuevas14@gmail.com>
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsDec 15, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@harshil21harshil21harshil21 approved these changes

@clot27clot27Awaiting requested review from clot27

Assignees
No one assigned
Labels
⚙️ bot-apiaffected functionality: bot-api🔌 enhancementpr description: enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bot API 8.1
2 participants
@Bibo-Joshi@harshil21

[8]ページ先頭

©2009-2025 Movatter.jp