mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-09-22 19:22:01 +03:00
formated with black formatter
This commit is contained in:
parent
1fb0615b99
commit
10e0bd1830
6 changed files with 25 additions and 11 deletions
|
@ -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 *
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from .channel import (
|
|||
TextChannel,
|
||||
Thread,
|
||||
ThreadsList,
|
||||
_choose_channel_type
|
||||
_choose_channel_type,
|
||||
)
|
||||
from .thread import *
|
||||
from .webhook import *
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue