Skip to content

Commit

Permalink
* Slightly improved generator. Nullable parameters of some api functi…
Browse files Browse the repository at this point in the history
…ons now have Optional[...] type

* Totally removed `stop_signals` parameter of `Client.idle` method

* API types and functions regenerated

* Bumped version to 0.9.0
  • Loading branch information
pylakey committed Aug 28, 2021
1 parent ad1c78c commit e757c55
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 18 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# aiotdlib CHANGELOG

### 0.9.0 - Upgrade to latest TDLib

> This update may contain breaking changes in some scenarios
#### Updated

* TDLib binaries upgraded to
latest [available version](https://github.com/tdlib/td/commit/97fccf7f27c84009460389fdd294739db510f47f)

* API types and functions regenerated

#### Removed

* Totally removed `stop_signals` parameter of `Client.idle` method

### 0.8.5 - Bugfix

#### Updated
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiotdlib.svg)](https://pypi.python.org/pypi/aiotdlib/)
[![PyPI license](https://img.shields.io/pypi/l/aiotdlib.svg)](https://pypi.python.org/pypi/aiotdlib/)

> This wrapper is actual for **[TDLib v1.7.6 (d161323)](https://github.com/tdlib/td/commit/d161323858a782bc500d188b9ae916982526c262)**
> This wrapper is actual for **[TDLib v1.7.6 (97fccf7)](https://github.com/tdlib/td/commit/97fccf7f27c84009460389fdd294739db510f47f)**
>
> This package includes prebuilt TDLib binaries for macOS and Debian Buster.
> You can use your own binary by passing `library_path` argument to `Client` class constructor. Make sure it's built from [this commit](https://github.com/tdlib/td/commit/d161323858a782bc500d188b9ae916982526c262). Compatibility with other versions of library is not guaranteed.
> You can use your own binary by passing `library_path` argument to `Client` class constructor. Make sure it's built from [this commit](https://github.com/tdlib/td/commit/97fccf7f27c84009460389fdd294739db510f47f). Compatibility with other versions of library is not guaranteed.
## Features

* All types and functions are generated automatically
from [tl schema](https://github.com/tdlib/td/blob/d161323858a782bc500d188b9ae916982526c262/td/generate/scheme/td_api.tl)
from [tl schema](https://github.com/tdlib/td/blob/97fccf7f27c84009460389fdd294739db510f47f/td/generate/scheme/td_api.tl)
* All types and functions come with validation and good IDE type hinting (thanks
to [Pydantic](https://github.com/samuelcolvin/pydantic))
* A set of high-level API methods which makes work with tdlib much simpler
Expand Down
2 changes: 1 addition & 1 deletion aiotdlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.8.5"
__version__ = "0.9.0"

from .client import (
Client,
Expand Down
22 changes: 11 additions & 11 deletions aiotdlib/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3255,7 +3255,7 @@ async def create_new_supergroup_chat(
self,
title: str,
is_channel: bool,
param_description: str,
param_description: typing.Optional[str],
location: ChatLocation,
for_import: bool,
*,
Expand Down Expand Up @@ -4224,7 +4224,7 @@ async def edit_inline_message_live_location(
self,
inline_message_id: str,
reply_markup: ReplyMarkup,
location: Location,
location: typing.Optional[Location],
heading: int,
proximity_alert_radius: int,
*,
Expand Down Expand Up @@ -4415,7 +4415,7 @@ async def edit_message_live_location(
chat_id: int,
message_id: int,
reply_markup: ReplyMarkup,
location: Location,
location: typing.Optional[Location],
heading: int,
proximity_alert_radius: int,
*,
Expand Down Expand Up @@ -9420,7 +9420,7 @@ async def register_device(
async def register_user(
self,
first_name: str,
last_name: str,
last_name: typing.Optional[str],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down Expand Up @@ -9894,7 +9894,7 @@ async def report_chat(
chat_id: int,
message_ids: list[int],
reason: ChatReportReason,
text: str,
text: typing.Optional[str],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down Expand Up @@ -9935,7 +9935,7 @@ async def report_chat_photo(
chat_id: int,
file_id: int,
reason: ChatReportReason,
text: str,
text: typing.Optional[str],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down Expand Up @@ -11705,7 +11705,7 @@ async def set_background(

async def set_bio(
self,
bio: str,
bio: typing.Optional[str],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down Expand Up @@ -11794,7 +11794,7 @@ async def set_chat_client_data(
async def set_chat_description(
self,
chat_id: int,
param_description: str,
param_description: typing.Optional[str],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down Expand Up @@ -11857,7 +11857,7 @@ async def set_chat_draft_message(
self,
chat_id: int,
message_thread_id: int,
draft_message: DraftMessage,
draft_message: typing.Optional[DraftMessage],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down Expand Up @@ -12614,7 +12614,7 @@ async def set_log_verbosity_level(
async def set_name(
self,
first_name: str,
last_name: str,
last_name: typing.Optional[str],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down Expand Up @@ -13234,7 +13234,7 @@ async def share_phone_number(
async def start_group_call_recording(
self,
group_call_id: int,
title: str,
title: typing.Optional[str],
*,
request_id: str = None,
request_timeout: int = None,
Expand Down
4 changes: 2 additions & 2 deletions aiotdlib/api/types/identity_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IdentityDocument(BaseObject):
Front side of the document
reverse_side (:class:`DatedFile`)
Reverse side of the document; only for driver license and identity card
Reverse side of the document; only for driver license and identity card; may be null
selfie (:class:`DatedFile`)
Selfie with the document; may be null
Expand All @@ -43,7 +43,7 @@ class IdentityDocument(BaseObject):
number: str = Field(..., min_length=1, max_length=24)
expiry_date: typing.Optional[Date] = None
front_side: DatedFile
reverse_side: DatedFile
reverse_side: typing.Optional[DatedFile] = None
selfie: typing.Optional[DatedFile] = None
translation: list[DatedFile]

Expand Down
2 changes: 1 addition & 1 deletion generator/templates/api_template.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class API:
async def {{ entity.snake_name }}{% if entity.parameters %}(
self,
{%- for parameter in entity.parameters %}
{{ parameter.name }}: {{ parameter.type }},
{{ parameter.name }}: {% if parameter.nullable %}{{ parameter.optional_type }}{% else %}{{ parameter.type }}{% endif %},
{%- endfor %}
*,
request_id: str = None,
Expand Down

0 comments on commit e757c55

Please sign in to comment.