Skip to content

Commit

Permalink
* Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pylakey committed Apr 16, 2022
1 parent 3a24aa6 commit beab642
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 165 deletions.
13 changes: 8 additions & 5 deletions aiotdlib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import sys
import typing
import uuid
from collections import AsyncIterator
from functools import (
partial,
update_wrapper,
)
from pathlib import Path
from typing import (
AsyncIterator,
Optional,
TypeVar,
Union,
Expand Down Expand Up @@ -434,7 +434,6 @@ def validator_files_directory(cls, value, values):

class Config:
env_prefix = 'aiotdlib_'
secrets_dir = '/run/secrets'
use_enum_values = True
allow_population_by_field_name = True

Expand Down Expand Up @@ -698,8 +697,8 @@ async def __set_tdlib_parameters(self) -> RequestResult:
return await self.api.set_tdlib_parameters(
parameters=TdlibParameters(
use_test_dc=self.settings.use_test_dc,
database_directory=os.path.join(f"{self.settings.files_directory}","database"),
files_directory=os.path.join(f"{self.settings.files_directory}","files"),
database_directory=os.path.join(f"{self.settings.files_directory}", "database"),
files_directory=os.path.join(f"{self.settings.files_directory}", "files"),
use_file_database=self.settings.use_file_database,
use_chat_info_database=self.settings.use_chat_info_database,
use_message_database=self.settings.use_message_database,
Expand Down Expand Up @@ -1384,7 +1383,8 @@ async def send_text(
disable_notification=disable_notification,
send_when_online=send_when_online,
send_date=send_date,
request_timeout=request_timeout
request_timeout=request_timeout,
protect_content=protect_content
)

async def edit_text(
Expand Down Expand Up @@ -2187,6 +2187,9 @@ async def forward_messages(
:param request_timeout: amounts of seconds to wait of response, (asyncio.TimeoutError`) will be be raised if request lasts more than `request_timeout seconds, defaults to None
:type request_timeout: int
:param protect_content: Pass true if the content of the message must be protected from forwarding and saving; for bots only
:type protect_content: :class:`bool`
:return: response from TDLib
:rtype: aiotdlib.api.types.Messages
"""
Expand Down
6 changes: 2 additions & 4 deletions aiotdlib/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
ABC,
abstractmethod,
)
from collections import (
Callable,
Coroutine,
)
from typing import (
Any,
Callable,
Coroutine,
NoReturn,
Optional,
Union,
Expand Down
8 changes: 6 additions & 2 deletions aiotdlib/handlers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from __future__ import annotations

import asyncio
from collections.abc import Callable
from typing import (
Any,
Callable,
Coroutine,
Optional,
TYPE_CHECKING,
TypeVar,
Union,
)
Expand All @@ -16,8 +17,11 @@
FilterCallable,
)

if TYPE_CHECKING:
from client import Client

SomeUpdate = TypeVar('SomeUpdate', bound=BaseObject)
HandlerCallable = Callable[['aiotdlib.Client', SomeUpdate], Coroutine[Any, Any, None]]
HandlerCallable = Callable[['Client', SomeUpdate], Coroutine[Any, Any, None]]


class Handler(object):
Expand Down
2 changes: 1 addition & 1 deletion aiotdlib/middlewares.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections.abc import Callable
from typing import (
Any,
Callable,
Coroutine,
TypeVar,
)
Expand Down
Loading

0 comments on commit beab642

Please sign in to comment.