From 10e0bd1830b2d7b76591c4f2eca2fc93a4b049d0 Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Wed, 25 May 2022 10:03:49 +0300 Subject: [PATCH] formated with black formatter --- melisa/__init__.py | 4 +--- melisa/models/guild/__init__.py | 2 +- melisa/models/guild/channel.py | 19 ++++++++++++++++--- melisa/models/message/message.py | 2 +- melisa/rest.py | 6 ++++-- tests/test_caching.py | 3 ++- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/melisa/__init__.py b/melisa/__init__.py index 6121e20..2b17834 100644 --- a/melisa/__init__.py +++ b/melisa/__init__.py @@ -1,9 +1,7 @@ # Copyright MelisaDev 2022 - Present # Full MIT License can be found in `LICENSE.txt` at the project root. -from .client import ( - Client, Bot -) +from .client import Client, Bot from .models import * from .exceptions import * diff --git a/melisa/models/guild/__init__.py b/melisa/models/guild/__init__.py index 5905dfb..515f947 100644 --- a/melisa/models/guild/__init__.py +++ b/melisa/models/guild/__init__.py @@ -21,7 +21,7 @@ from .channel import ( TextChannel, Thread, ThreadsList, - _choose_channel_type + _choose_channel_type, ) from .thread import * from .webhook import * diff --git a/melisa/models/guild/channel.py b/melisa/models/guild/channel.py index a04b713..dc638cd 100644 --- a/melisa/models/guild/channel.py +++ b/melisa/models/guild/channel.py @@ -14,7 +14,7 @@ from typing import ( Union, Dict, overload, - TYPE_CHECKING + TYPE_CHECKING, ) from ...utils import Snowflake, Timestamp @@ -380,7 +380,9 @@ class MessageableChannel(Channel): An iterator of messages. """ - data = self._client.rest.get_channel_messages_history(self.id, limit, around=around, before=before, after=after) + data = self._client.rest.get_channel_messages_history( + self.id, limit, around=around, before=before, after=after + ) for i in data: yield i @@ -536,7 +538,18 @@ class MessageableChannel(Channel): Some of specified parameters is invalid. """ - return self._client.rest.create_message(self.id, content, tts=tts, embed=embed, embeds=embeds, file=file, files=files, allowed_mentions=allowed_mentions, delete_after=delete_after, _client_allowed_mentions=self._client.allowed_mentions) + return self._client.rest.create_message( + self.id, + content, + tts=tts, + embed=embed, + embeds=embeds, + file=file, + files=files, + allowed_mentions=allowed_mentions, + delete_after=delete_after, + _client_allowed_mentions=self._client.allowed_mentions, + ) async def purge( self, diff --git a/melisa/models/message/message.py b/melisa/models/message/message.py index ef28712..b5fcc3a 100644 --- a/melisa/models/message/message.py +++ b/melisa/models/message/message.py @@ -340,7 +340,7 @@ class Message(APIModelBase): ) self.interaction = data.get("interaction") self.thread = ( - Thread.from_dict(data['thread']) if data.get("thread") is not None else None + Thread.from_dict(data["thread"]) if data.get("thread") is not None else None ) self.components = data.get("components") self.sticker_items = data.get("sticker_items") diff --git a/melisa/rest.py b/melisa/rest.py index 14fce80..5e887ac 100644 --- a/melisa/rest.py +++ b/melisa/rest.py @@ -136,7 +136,7 @@ class RESTApp: files: List[File] = None, allowed_mentions: AllowedMentions = None, delete_after: int = None, - _client_allowed_mentions: AllowedMentions = None + _client_allowed_mentions: AllowedMentions = None, ) -> Message: """|coro| @@ -333,7 +333,9 @@ class RESTApp: return Message.from_dict(message) - async def fetch_channel_pins(self, channel_id: Union[Snowflake, int, str]) -> AsyncIterator[Message]: + async def fetch_channel_pins( + self, channel_id: Union[Snowflake, int, str] + ) -> AsyncIterator[Message]: """|coro| Retrieves all messages that are currently pinned in the channel. diff --git a/tests/test_caching.py b/tests/test_caching.py index 13161a9..61ecad1 100644 --- a/tests/test_caching.py +++ b/tests/test_caching.py @@ -1,6 +1,7 @@ import pytest -from melisa import CacheManager, Snowflake, Guild, TextChannel +from melisa import Snowflake, Guild, TextChannel +from melisa.cache import CacheManager class TestCache: