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

Feat: Backport API 6.0 to V13#3027

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 23 commits intov13.xfromv13_api6.0
May 25, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
e9203a2
Feat: Backport API 6.0 to V13
PoolitzerMay 12, 2022
c6330bd
Fix: Deepsource fixes and enable pytest workflow.
PoolitzerMay 12, 2022
38c08e0
Fix: Bump python test version
PoolitzerMay 12, 2022
d0a1717
Fix: Black reformat
PoolitzerMay 12, 2022
ca2b1ef
Fix: Ignoring backwards fields in official test
PoolitzerMay 12, 2022
fffdc87
Fix: Pytest fails + one error in de_json
PoolitzerMay 12, 2022
5c67e20
Fix: Github workflows don't like floating point
PoolitzerMay 12, 2022
53ba667
Fix: Remove 3.10, it's more trouble than worth
PoolitzerMay 12, 2022
fede359
Fix: compare unique id's
PoolitzerMay 12, 2022
cfac808
Apply suggestions from code review
PoolitzerMay 12, 2022
44dc5c9
Fix: Proper github url for MenuButtons
PoolitzerMay 12, 2022
43cb8a1
Fix: address review
PoolitzerMay 13, 2022
534062b
Merge remote-tracking branch 'origin/v13_api6.0' into v13_api6.0
PoolitzerMay 13, 2022
303a248
Fix: improve videochatstarted
PoolitzerMay 13, 2022
d97c8c5
Fix: I broke a test.
PoolitzerMay 13, 2022
665fe1f
Fix: remove py3.6 workaround
PoolitzerMay 13, 2022
6b134c3
Feat: add tests
PoolitzerMay 18, 2022
f932248
Fix: own with blocks
PoolitzerMay 18, 2022
81a584f
[skip ci]
PoolitzerMay 19, 2022
206fee7
[pre-commit.ci skip]
PoolitzerMay 19, 2022
dbd798d
Fix: Remove unused type ignore comment
PoolitzerMay 23, 2022
3063f6a
Revert "Fix: Remove unused type ignore comment"
PoolitzerMay 23, 2022
e8a46ad
Fix: battling the CI
PoolitzerMay 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions.github/workflows/test.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,19 @@ on:
pull_request:
branches:
- master
- v13.x
push:
branches:
- master
- v13.x

jobs:
pytest:
name: pytest
runs-on: ${{matrix.os}}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: False
steps:
Expand DownExpand Up@@ -94,27 +96,3 @@ jobs:
env:
TEST_OFFICIAL: "true"
shell: bash --noprofile --norc {0}
test_pre_commit:
name: test-pre-commit
runs-on: ${{matrix.os}}
strategy:
matrix:
python-version: [3.7]
os: [ubuntu-latest]
fail-fast: False
steps:
- uses: actions/checkout@v2
- name: Initialize vendored libs
run:
git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install -r requirements.txt
python -W ignore -m pip install -r requirements-dev.txt
- name: Run pre-commit tests
run: pre-commit run --all-files
7 changes: 6 additions & 1 deletion.pre-commit-config.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
# Make sure that
# * the revs specified here match requirements-dev.txt
# * the additional_dependencies here match requirements.txt

ci:
# We currently only need this behavior on the v13.x branch were we have the vendored urllib
submodules: true

repos:
- repo: https://github.com/psf/black
rev:20.8b1
rev:22.3.0
hooks:
- id: black
args:
Expand Down
7 changes: 4 additions & 3 deletionsREADME.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ We have a vibrant community of developers helping each other in our `Telegram gr
:target: https://pypi.org/project/python-telegram-bot/
:alt: Supported Python versions

.. image:: https://img.shields.io/badge/Bot%20API-5.7-blue?logo=telegram
.. image:: https://img.shields.io/badge/Bot%20API-6.0-blue?logo=telegram
:target: https://core.telegram.org/bots/api-changelog
:alt: Supported Bot API versions

Expand DownExpand Up@@ -87,13 +87,14 @@ Table of contents

- `License`_


============
Introduction
============

This library provides a pure Python interface for the
`Telegram Bot API <https://core.telegram.org/bots/api>`_.
It's compatible with Python versions 3.6.8+. PTB might also work on `PyPy <http://pypy.org/>`_, though there have been a lot of issues before. Hence, PyPy is not officially supported.
It's compatible with Python versions 3.7+. PTB might also work on `PyPy <http://pypy.org/>`_, though there have been a lot of issues before. Hence, PyPy is not officially supported.

In addition to the pure API implementation, this library features a number of high-level classes to
make the development of bots easy and straightforward. These classes are contained in the
Expand All@@ -111,7 +112,7 @@ Installing both ``python-telegram-bot`` and ``python-telegram-bot-raw`` in conju
Telegram API support
====================

All types and methods of the Telegram Bot API **5.7** are supported.
All types and methods of the Telegram Bot API **6.0** are supported.

==========
Installing
Expand Down
6 changes: 3 additions & 3 deletionsREADME_RAW.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ We have a vibrant community of developers helping each other in our `Telegram gr
:target: https://pypi.org/project/python-telegram-bot-raw/
:alt: Supported Python versions

.. image:: https://img.shields.io/badge/Bot%20API-5.7-blue?logo=telegram
.. image:: https://img.shields.io/badge/Bot%20API-6.0-blue?logo=telegram
:target: https://core.telegram.org/bots/api-changelog
:alt: Supported Bot API versions

Expand DownExpand Up@@ -91,7 +91,7 @@ Introduction

This library provides a pure Python, lightweight interface for the
`Telegram Bot API <https://core.telegram.org/bots/api>`_.
It's compatible with Python versions 3.6.8+. PTB-Raw might also work on `PyPy <http://pypy.org/>`_, though there have been a lot of issues before. Hence, PyPy is not officially supported.
It's compatible with Python versions 3.7+. PTB-Raw might also work on `PyPy <http://pypy.org/>`_, though there have been a lot of issues before. Hence, PyPy is not officially supported.

``python-telegram-bot-raw`` is part of the `python-telegram-bot <https://python-telegram-bot.org>`_ ecosystem and provides the pure API functionality extracted from PTB. It therefore does *not* have independent release schedules, changelogs or documentation. Please consult the PTB resources.

Expand All@@ -105,7 +105,7 @@ Installing both ``python-telegram-bot`` and ``python-telegram-bot-raw`` in conju
Telegram API support
====================

All types and methods of the Telegram Bot API **5.7** are supported.
All types and methods of the Telegram Bot API **6.0** are supported.

==========
Installing
Expand Down
8 changes: 8 additions & 0 deletionsdocs/source/telegram.chatadministratorrights.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/chatadministratorrights.py

telegram.ChatAdministratorRights
================================

.. autoclass:: telegram.ChatAdministratorRights
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdocs/source/telegram.menubutton.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/menubutton.py

telegram.MenuButton
===================

.. autoclass:: telegram.MenuButton
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdocs/source/telegram.menubuttoncommands.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/menubutton.py

telegram.MenuButtonCommands
===========================

.. autoclass:: telegram.MenuButtonCommands
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdocs/source/telegram.menubuttondefault.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/menubutton.py

telegram.MenuButtonDefault
==========================

.. autoclass:: telegram.MenuButtonDefault
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdocs/source/telegram.menubuttonwebapp.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/menubutton.py

telegram.MenuButtonWebApp
=========================

.. autoclass:: telegram.MenuButtonWebApp
:members:
:show-inheritance:
12 changes: 12 additions & 0 deletionsdocs/source/telegram.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,6 +17,7 @@ telegram package
telegram.botcommandscopechatmember
telegram.callbackquery
telegram.chat
telegram.chatadministratorrights
telegram.chataction
telegram.chatinvitelink
telegram.chatjoinrequest
Expand DownExpand Up@@ -51,6 +52,10 @@ telegram package
telegram.keyboardbuttonpolltype
telegram.location
telegram.loginurl
telegram.menubutton
telegram.menubuttoncommands
telegram.menubuttondefault
telegram.menubuttonwebapp
telegram.message
telegram.messageautodeletetimerchanged
telegram.messageid
Expand All@@ -64,18 +69,25 @@ telegram package
telegram.replykeyboardremove
telegram.replykeyboardmarkup
telegram.replymarkup
telegram.sentwebappmessage
telegram.telegramobject
telegram.update
telegram.user
telegram.userprofilephotos
telegram.venue
telegram.video
telegram.videochatended
telegram.videochatparticipantsinvited
telegram.videochatscheduled
telegram.videochatstarted
telegram.videonote
telegram.voice
telegram.voicechatstarted
telegram.voicechatended
telegram.voicechatscheduled
telegram.voicechatparticipantsinvited
telegram.webappdata
telegram.webappinfo
telegram.webhookinfo

Stickers
Expand Down
8 changes: 8 additions & 0 deletionsdocs/source/telegram.sentwebappmessage.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/sentwebappmessage.py

telegram.SentWebAppMessage
==========================

.. autoclass:: telegram.SentWebAppMessage
:members:
:show-inheritance:
9 changes: 9 additions & 0 deletionsdocs/source/telegram.videochatended.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/videochatended.py

telegram.VideoChatEnded
=======================

.. autoclass:: telegram.VideoChatEnded
:members:
:show-inheritance:

8 changes: 8 additions & 0 deletionsdocs/source/telegram.videochatparticipantsinvited.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/videochatparticipantsinvited.py

telegram.VideoChatParticipantsInvited
=====================================

.. autoclass:: telegram.VideoChatParticipantsInvited
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdocs/source/telegram.videochatscheduled.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/videochatscheduled.py

telegram.VideoChatScheduled
===========================

.. autoclass:: telegram.VideoChatScheduled
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdocs/source/telegram.videochatstarted.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/videochatstarted.py

telegram.VideoChatStarted
=========================

.. autoclass:: telegram.VideoChatStarted
:members:
:show-inheritance:
2 changes: 2 additions & 0 deletionsdocs/source/telegram.voicechatended.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,3 +7,5 @@ telegram.VoiceChatEnded
:members:
:show-inheritance:

.. versionchanged:: v13.12
Since Bot API 6.0, voice chat was renamed to video chat.
2 changes: 2 additions & 0 deletionsdocs/source/telegram.voicechatparticipantsinvited.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,3 +7,5 @@ telegram.VoiceChatParticipantsInvited
:members:
:show-inheritance:

.. versionchanged:: v13.12
Since Bot API 6.0, voice chat was renamed to video chat.
2 changes: 2 additions & 0 deletionsdocs/source/telegram.voicechatscheduled.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,3 +7,5 @@ telegram.VoiceChatScheduled
:members:
:show-inheritance:

.. versionchanged:: v13.12
Since Bot API 6.0, voice chat was renamed to video chat.
2 changes: 2 additions & 0 deletionsdocs/source/telegram.voicechatstarted.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,3 +7,5 @@ telegram.VoiceChatStarted
:members:
:show-inheritance:

.. versionchanged:: v13.12
Since Bot API 6.0, voice chat was renamed to video chat.
8 changes: 8 additions & 0 deletionsdocs/source/telegram.webappdata.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/webappdata.py

telegram.WebAppData
===================

.. autoclass:: telegram.WebAppData
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdocs/source/telegram.webappinfo.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
:github_url: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/webappinfo.py

telegram.WebAppInfo
===================

.. autoclass:: telegram.WebAppInfo
:members:
:show-inheritance:
28 changes: 10 additions & 18 deletionsexamples/chatmemberbot.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,24 +44,16 @@ def extract_status_change(
return None

old_status, new_status = status_change
was_member = (
old_status
in [
ChatMember.MEMBER,
ChatMember.CREATOR,
ChatMember.ADMINISTRATOR,
]
or (old_status == ChatMember.RESTRICTED and old_is_member is True)
)
is_member = (
new_status
in [
ChatMember.MEMBER,
ChatMember.CREATOR,
ChatMember.ADMINISTRATOR,
]
or (new_status == ChatMember.RESTRICTED and new_is_member is True)
)
was_member = old_status in [
ChatMember.MEMBER,
ChatMember.CREATOR,
ChatMember.ADMINISTRATOR,
] or (old_status == ChatMember.RESTRICTED and old_is_member is True)
is_member = new_status in [
ChatMember.MEMBER,
ChatMember.CREATOR,
ChatMember.ADMINISTRATOR,
] or (new_status == ChatMember.RESTRICTED and new_is_member is True)

return was_member, is_member

Expand Down
2 changes: 1 addition & 1 deletionrequirements-dev.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@ cryptography!=3.4,!=3.4.1,!=3.4.2,!=3.4.3

pre-commit
# Make sure that the versions specified here match the pre-commit settings!
black==20.8b1
black==22.3.0
flake8==3.9.2
pylint==2.8.3
mypy==0.812
Expand Down
1 change: 0 additions & 1 deletionsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,7 +98,6 @@ def get_setup_kwargs(raw=False):
'Topic :: Internet',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp