formated with black formatter

This commit is contained in:
grey-cat-1908 2022-05-25 10:03:49 +03:00
parent 1fb0615b99
commit 10e0bd1830
6 changed files with 25 additions and 11 deletions

View file

@ -1,9 +1,7 @@
# Copyright MelisaDev 2022 - Present # Copyright MelisaDev 2022 - Present
# Full MIT License can be found in `LICENSE.txt` at the project root. # Full MIT License can be found in `LICENSE.txt` at the project root.
from .client import ( from .client import Client, Bot
Client, Bot
)
from .models import * from .models import *
from .exceptions import * from .exceptions import *

View file

@ -21,7 +21,7 @@ from .channel import (
TextChannel, TextChannel,
Thread, Thread,
ThreadsList, ThreadsList,
_choose_channel_type _choose_channel_type,
) )
from .thread import * from .thread import *
from .webhook import * from .webhook import *

View file

@ -14,7 +14,7 @@ from typing import (
Union, Union,
Dict, Dict,
overload, overload,
TYPE_CHECKING TYPE_CHECKING,
) )
from ...utils import Snowflake, Timestamp from ...utils import Snowflake, Timestamp
@ -380,7 +380,9 @@ class MessageableChannel(Channel):
An iterator of messages. 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: for i in data:
yield i yield i
@ -536,7 +538,18 @@ class MessageableChannel(Channel):
Some of specified parameters is invalid. 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( async def purge(
self, self,

View file

@ -340,7 +340,7 @@ class Message(APIModelBase):
) )
self.interaction = data.get("interaction") self.interaction = data.get("interaction")
self.thread = ( 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.components = data.get("components")
self.sticker_items = data.get("sticker_items") self.sticker_items = data.get("sticker_items")

View file

@ -136,7 +136,7 @@ class RESTApp:
files: List[File] = None, files: List[File] = None,
allowed_mentions: AllowedMentions = None, allowed_mentions: AllowedMentions = None,
delete_after: int = None, delete_after: int = None,
_client_allowed_mentions: AllowedMentions = None _client_allowed_mentions: AllowedMentions = None,
) -> Message: ) -> Message:
"""|coro| """|coro|
@ -333,7 +333,9 @@ class RESTApp:
return Message.from_dict(message) 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| """|coro|
Retrieves all messages that are currently pinned in the channel. Retrieves all messages that are currently pinned in the channel.

View file

@ -1,6 +1,7 @@
import pytest import pytest
from melisa import CacheManager, Snowflake, Guild, TextChannel from melisa import Snowflake, Guild, TextChannel
from melisa.cache import CacheManager
class TestCache: class TestCache: